Procházet zdrojové kódy

try to use console button

andre před 4 roky
rodič
revize
f2c6c4a6a9
1 změnil soubory, kde provedl 4 přidání a 5 odebrání
  1. 4 5
      app/UI/Vms/Buttons/ConsoleButton.php

+ 4 - 5
app/UI/Vms/Buttons/ConsoleButton.php

@@ -32,19 +32,18 @@ class ConsoleButton extends ButtonDataTableModalAction implements ClientArea
 
     public function initContent()
     {
-//        $this->vmModel = \ModulesGarden\ProxmoxAddon\Core\Helper\sl('Vm')->getVmModel();
+        //noVNC
         $this->initIds('consoleButton');
         $this->setDisableByColumnValue("vmid", 0);
-//        $url = (new UrlServiceHelper())->getNoVncConsoleUrl();
-        $url ="clientarea.php?action=productdetails&id={$this->getWhmcsParamByKey('serviceid')}&modop=custom&a=management&mg-page=vm";
+        $url ="#";
         $this->setRawUrl($url)
             ->setRedirectParams(['vm' => ':id']);
     }
 
     public function afterInitContent()
     {
-        $this->htmlAttributes['@click.middle'] = 'redirect($event, ' . $this->parseCustomParams() . ', true)';
-        $this->htmlAttributes['@click'] = 'redirect($event, ' . $this->parseCustomParams() . ')';
+        $serviceUrl = new UrlServiceHelper();
+        $this->htmlAttributes['@click'] = "window.open('{$serviceUrl->getNoVncConsoleUrl()}', '', 'width=900,height=700'); return false;";
     }
 
     public function setRawUrl($url)