|
|
@@ -66,6 +66,8 @@ class VmsDataTable extends DataTable implements ClientArea, AdminArea
|
|
|
$createButton->setIcon('lu-zmdi lu-zmdi-plus');
|
|
|
$createButton->replaceClasses(['lu-btn lu-btn--primary']);
|
|
|
$this->addTitleButton($createButton);
|
|
|
+ $this->createSidebar = sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate");
|
|
|
+ $this->createButton = $createButton;
|
|
|
}
|
|
|
//import
|
|
|
if($isAdmin){
|
|
|
@@ -108,9 +110,14 @@ class VmsDataTable extends DataTable implements ClientArea, AdminArea
|
|
|
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
|
|
|
- sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")->delete();
|
|
|
+ if (sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")) {
|
|
|
+ sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")->delete();
|
|
|
+ }
|
|
|
} else {
|
|
|
-// $this->createButton->addHtmlAttribute("enabled",true);
|
|
|
+ if (!sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")) {
|
|
|
+ sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->add($this->createSidebar);
|
|
|
+ }
|
|
|
+ // $this->createButton->addHtmlAttribute("enabled",true);
|
|
|
}
|
|
|
}
|
|
|
|