|
|
@@ -19,6 +19,7 @@
|
|
|
|
|
|
namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Vms\Buttons;
|
|
|
|
|
|
+use ModulesGarden\ProxmoxAddon\App\Models\VmModel;
|
|
|
use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Vms\Modals\MigrateModal;
|
|
|
use ModulesGarden\Servers\ProxmoxCloudVps\Core\Helper\BuildUrl;
|
|
|
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
|
|
|
@@ -37,7 +38,23 @@ class ConsoleButton extends ButtonDataTableModalAction implements ClientArea
|
|
|
|
|
|
public function afterInitContent()
|
|
|
{
|
|
|
- }
|
|
|
+ $query = VmModel::select("id")
|
|
|
+ ->ofHostingId($this->getWhmcsParamByKey('serviceid'))
|
|
|
+ ->notTemplate()
|
|
|
+ ->getQuery();
|
|
|
+ $dataProv = new QueryDataProvider();
|
|
|
+ $dataProv->setData($query);
|
|
|
+ $vmid = $dataProv->getData()->getRecords()->first()->id;
|
|
|
+ $consoleUrl = isAdmin() ? BuildUrl::getUrl('console', 'novnc', ['vm'=> $vmid]) : 'clientarea.php?action=productdetails&id=' . $this->getWhmcsParamByKey('serviceid') . '&vm=' . $vmid . '&modop=custom&a=management&mg-page=console&mg-action=novnc';
|
|
|
+ $this->setConsoleUrl($consoleUrl);
|
|
|
+ logModuleCall(
|
|
|
+ 'proxmoxCloud',
|
|
|
+ __FUNCTION__,
|
|
|
+ $this->actionButtons,
|
|
|
+ 'Debug',
|
|
|
+ $dataProv->getData()->getRecords()
|
|
|
+ );
|
|
|
+}
|
|
|
|
|
|
public function setConsoleUrl($url)
|
|
|
{
|