| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Vm\Pages;
- use ModulesGarden\ProxmoxAddon\App\Services\Cloud\ProductService;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Backup\Pages\BackupDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Disk\Pages\DiskDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\MountPoint\Pages\MountPointDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Network\Pages\NetworkLxcDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Network\Pages\NetworkQemuDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Reinstall\Pages\GraphsTab;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Reinstall\Pages\IsoDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Reinstall\Pages\ReinstallTab;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Reinstall\Pages\TemplateDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Snapshot\Pages\SnapshotDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\TaskHistory\Pages\TaskHistoryDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\VirtualInterface\Pages\VirtualInterfaceDataTable;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\ClientArea;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\TabsWidget\TabsWidget;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Network\Pages\NetworkTab;
- class VmTabs extends TabsWidget implements ClientArea
- {
- use ProductService;
- public function initContent()
- {
- $this->addElement(new DetailTab);
- if(!$this->configuration()->isDetailsCombinedView()){
- //disk
- if ($this->configuration()->isQemu() && $this->configuration()->isPermissionDisk())
- {
- $this->addElement(new DiskDataTable());
- }
- //mount point
- if ($this->configuration()->isLxc() && $this->configuration()->isPermissionDisk())
- {
- $this->addElement(new MountPointDataTable());
- }
- //network
- if (($this->configuration()->isQemu() && $this->configuration()->isPermissionNetwork()) || ($this->configuration()->isLxc() && $this->configuration()->isPermissionNetwork()))
- {
- $this->addElement(new NetworkTab());
- }
- }
- //snapshot
- if ($this->configuration()->isPermissionSnapshot())
- {
- $this->addElement(new SnapshotDataTable());
- }
- //backup
- if ($this->configuration()->isPermissionBackupJob())
- {
- $this->addElement(new BackupTab());
- }
- elseif ($this->configuration()->isPermissionBackup())
- {
- $this->addElement(new BackupDataTable());
- }
- if ($this->configuration()->isPermissionFirewallOption() && $this->configuration()->isPermissionFirewall())
- {
- $this->addElement(new FirewallTab());
- }
- //task history
- if ($this->configuration()->isPermissionTaskHistory())
- {
- $this->addElement(new TaskHistoryDataTable());
- }
- /**
- * Graphs
- */
- if($this->configuration()->isPermissionGraph()){
- $this->addElement(new GraphsTab());
- }
- /**
- * Reinstall
- */
- if ($this->configuration()->isQemu() && $this->configuration()->isPermissionOsTemplate() && $this->configuration()->isPermissionIsoImage())
- {
- $this->addElement(ReinstallTab::class);
- }
- elseif ($this->configuration()->isQemu() && $this->configuration()->isPermissionOsTemplate())
- {
- $this->addElement(TemplateDataTable::class);
- }
- elseif ($this->configuration()->isQemu() && $this->configuration()->isPermissionIsoImage())
- {
- $this->addElement(IsoDataTable::class);
- //lxc
- }
- elseif ($this->configuration()->isLxc())
- {
- $this->addElement(TemplateDataTable::class);
- }
- }
- }
|