|
|
@@ -83,6 +83,27 @@ class VmsDataTable extends DataTable implements ClientArea, AdminArea
|
|
|
//migrate
|
|
|
$this->addActionButton(new MigrateButton());
|
|
|
}
|
|
|
+ if (isAdmin() || $this->configuration()->isPermissionNovnc()){
|
|
|
+ //console
|
|
|
+ $query = VmModel::select("id")
|
|
|
+ ->ofHostingId($this->getWhmcsParamByKey('serviceid'))
|
|
|
+ ->notTemplate()
|
|
|
+ ->getQuery();
|
|
|
+ $dataProv = new QueryDataProvider();
|
|
|
+ $dataProv->setDefaultSorting("name", 'ASC');
|
|
|
+ $dataProv->setData($query);
|
|
|
+ $vmid = $dataProv->getData()->getRecords()->first()->vmid;
|
|
|
+ $consoleUrl = BuildUrl::isClientArea() ? BuildUrl::getUrl('console', 'novnc', ['vm'=> $vmid]) : BuildUrl::getSelfUrl().'&mg-action=novncs&vm='.$vmid;
|
|
|
+ $this->addActionButton(new ConsoleButton());
|
|
|
+ $this->actionButtons['consoleButton']->setConsoleUrl($consoleUrl);
|
|
|
+ logModuleCall(
|
|
|
+ 'proxmoxCloud',
|
|
|
+ __FUNCTION__,
|
|
|
+ $this->actionButtons['consoleButton'],
|
|
|
+ 'Debug',
|
|
|
+ $consoleUrl
|
|
|
+ );
|
|
|
+ }
|
|
|
if(!$isAdmin){
|
|
|
//edit
|
|
|
$this->addActionButton(new ManageButton());
|