Browse Source

try to reenable vmcreate after delete action

andre 4 years ago
parent
commit
f862b7a834
1 changed files with 5 additions and 4 deletions
  1. 5 4
      app/UI/Vms/Pages/VmsDataTable.php

+ 5 - 4
app/UI/Vms/Pages/VmsDataTable.php

@@ -97,26 +97,27 @@ class VmsDataTable extends DataTable implements ClientArea, AdminArea
             ->addColumn((new Column('disk')))
             ->addColumn((new Column('osTemplate')));
         $resurceManager = new ResourceManager();
+        $sidebars = sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChildren();
         //deaktivate createVM Button in case of lack of ressources
         if($resurceManager->disk()->free() < $resurceManager->disk()->getMin() || $resurceManager->vcpus()->free() < $resurceManager->vcpus()->getMin() || $resurceManager->memory()->free() < $resurceManager->memory()->getMin()) {
 //            $this->createButton->addHtmlAttribute("disabled",true);
             //delete sidebar button
-/*            if (sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")) {
+            if (isset($sidebars['vmcreate'])) {
                 sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")->delete();
             }
         } else {
-            if (!sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")) {
+            if (!isset($sidebars['vmcreate'])) {
                 sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->add($this->createSidebar);
             }
             //            $this->createButton->addHtmlAttribute("enabled",true); */
 
-            logModuleCall(
+/*            logModuleCall(
                 'proxmoxCloud',
                 __FUNCTION__,
                 sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChildren(),
                 'Debug',
                 $this
-            );
+            ); */
         
         }
     }