Quellcode durchsuchen

finish using console button

andre vor 4 Jahren
Ursprung
Commit
2b1e2607a1
1 geänderte Dateien mit 7 neuen und 12 gelöschten Zeilen
  1. 7 12
      app/UI/Vms/Buttons/ConsoleButton.php

+ 7 - 12
app/UI/Vms/Buttons/ConsoleButton.php

@@ -24,6 +24,8 @@ use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
 use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\ClientArea;
 use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Buttons\ButtonDataTableModalAction;
 
+use function ModulesGarden\Servers\ProxmoxCloudVps\Core\Helper\isAdmin;
+
 class ConsoleButton extends ButtonDataTableModalAction implements ClientArea
 {
     protected $icon           = 'lu-zmdi lu-zmdi-desktop-windows';
@@ -32,9 +34,11 @@ class ConsoleButton extends ButtonDataTableModalAction implements ClientArea
     {
         $this->initIds('consoleButton');
         $this->setDisableByColumnValue("vmid", 0);
-        $url = "clientarea.php?action=productdetails&id={$this->getWhmcsParamByKey('serviceid')}&modop=custom&a=management&mg-page=console&mg-action=novnc";
-//        $url = "window.open('" . $target . "', '', 'width=900,height=700'); return false;";
-//        $url ="clientarea.php?action=productdetails&id={$this->getWhmcsParamByKey('serviceid')}&modop=custom&a=management&mg-page=vm";
+        if(isAdmin()){
+            $url = "admin/clientsservices.php?userid=3&productselect={$this->getWhmcsParamByKey('serviceid')}&mg-action=novncs";
+        } else {
+            $url = "clientarea.php?action=productdetails&id={$this->getWhmcsParamByKey('serviceid')}&modop=custom&a=management&mg-page=console&mg-action=novnc";
+        }
         $this->setRawUrl($url)
             ->setRedirectParams(['vm' => ':id']);
     }
@@ -43,15 +47,6 @@ class ConsoleButton extends ButtonDataTableModalAction implements ClientArea
     {
         $this->htmlAttributes['@click.middle'] = 'popup($event, ' . $this->parseCustomParams() . ',' . '' . ')';
         $this->htmlAttributes['@click'] = 'popup($event, ' . $this->parseCustomParams() . ',' . '\'width=900,height=700\'' . ')';
-
-        logModuleCall(
-            'proxmoxCloud',
-            __FUNCTION__,
-            $this->parseCustomParams(),
-            'Debug',
-            $this->htmlAttributes
-        );
-        
     }
 
     public function setRawUrl($url)