http://modulesgarden.com * CONTACT -> contact@modulesgarden.com * * * This software is furnished under a license and may be used and copied * only in accordance with the terms of such license and with the * inclusion of the above copyright notice. This software or any other * copies thereof may not be provided or otherwise made available to any * other person. No title to and ownership of the software is hereby * transferred. * * * ******************************************************************** */ namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Home\Pages; use ModulesGarden\ProxmoxAddon\App\Services\Cloud\ProductService; use ModulesGarden\ProxmoxAddon\App\Services\UrlService; use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Home\Buttons\RedirectButton; use ModulesGarden\Servers\ProxmoxCloudVps\Core\Helper\BuildUrl; use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Builder\BaseContainer; use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea; use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\ClientArea; use function ModulesGarden\Servers\ProxmoxCloudVps\Core\Helper\isAdmin; class ServiceManagement extends BaseContainer implements ClientArea, AdminArea { use ProductService; /** * @var UrlService */ private $urlService; public function initContent() { $this->initIds('serviceManagement'); //Url Service $this->urlService = new UrlService(); //Reinstall if (isAdmin() || $this->configuration()->isPermissionReinstall()) { $this->addServiceButton('reinstall'); } //Backups if (isAdmin() || $this->configuration()->isPermissionBackup() || $this->configuration()->isPermissionBackupJob()) { $this->addServiceButton('backup'); } //Backup Jobs if (isAdmin() || $this->configuration()->isPermissionBackupJob()) { $this->addServiceButton('backupJob'); } //Graphs if (isAdmin() || $this->configuration()->isPermissionGraph()) { $this->addServiceButton('graph'); } //Task History if (isAdmin() || $this->configuration()->isPermissionTaskHistory()) { $this->addServiceButton('taskHistory'); } //Network if (isAdmin() || $this->configuration()->isPermissionNetwork()) { $this->addServiceButton('network'); } //Snapshots if (isAdmin() || $this->configuration()->isPermissionSnapshot()) { $this->addServiceButton('snapshot'); } //Firewall if (isAdmin() || $this->configuration()->isPermissionFirewall()) { $this->addServiceButton('firewall'); } //Firewall Options if (isAdmin() || $this->configuration()->isPermissionFirewallOption()) { $this->addServiceButton('firewallOption'); } //Disks if (isAdmin() || $this->configuration()->isPermissionDisk()) { $this->addServiceButton('disk'); } } private function addServiceButton($id) { $rd = new RedirectButton($id); $rd->setHref($this->urlService->getUrl($id)); $rd->setImageUrl(BuildUrl::getAppAssetsURL() . DS . 'img' . DS . 'buttons' . DS . $id . '.png'); $this->addButton($rd); } }