|
|
@@ -66,20 +66,23 @@ class VmsDataTable extends DataTable implements ClientArea, AdminArea
|
|
|
$createButton->setRawUrl($url);
|
|
|
$createButton->setIcon('lu-zmdi lu-zmdi-plus');
|
|
|
$createButton->replaceClasses(['lu-btn lu-btn--primary']);
|
|
|
+ $vmCreateSidebar = $vmCreateSidebar ? $vmCreateSidebar : sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate");
|
|
|
|
|
|
logModuleCall(
|
|
|
'proxmoxCloud',
|
|
|
__FUNCTION__,
|
|
|
- $resurceManager->vcpus()->free(),
|
|
|
+ $vmCreateSidebar,
|
|
|
'Debug',
|
|
|
- $resurceManager->disk()->free()
|
|
|
+ ''
|
|
|
);
|
|
|
-
|
|
|
+
|
|
|
//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()) {
|
|
|
$createButton->addHtmlAttribute("disabled",true);
|
|
|
//delete sidebar button
|
|
|
sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->getChild("vmcreate")->delete();
|
|
|
+ } else {
|
|
|
+ sl("sidebar")->getSidebar("virtualMachinesProxmoxCloudVps")->add($vmCreateSidebar);
|
|
|
}
|
|
|
$this->addTitleButton($createButton);
|
|
|
}
|