| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections\Qemu;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Select;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Switcher;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BoxSection;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
- class AdditonalDisk extends BoxSection implements AdminArea
- {
- protected $id = 'additonalDisk';
- protected $name = 'additonalDisk';
- protected $title = 'additonalDisk';
- /**
- * @var HalfPageSection
- */
- private $leftSection;
- /**
- * @var HalfPageSection
- */
- private $rightSection;
- public function initContent()
- {
- $this->leftSection = new HalfPageSection('leftSection');
- $this->rightSection = new HalfPageSection('rightSection');
- $this->addSection($this->leftSection)
- ->addSection($this->rightSection);
- $this->initFields();
- }
- private function initFields()
- {
- //Disks Storage
- $field = new Select('customconfigoption[additionalDiskStorage]');
- $field->setDefaultValue('local-lvm');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //Disks Type
- $field = new Select('customconfigoption[additionalDiskType][]');
- $field->setDescription('tip');
- $field->enableMultiple();
- $field->setDefaultValue(["ide"]);
- $this->rightSection->addField($field);
- //Disk Format
- $field = new Select('customconfigoption[additionalDiskFormat][]');
- $field->enableMultiple();
- $field->setDefaultValue(["raw"]);
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //Disk Skip Replication
- $field = new Switcher('customconfigoption[additionalDiskReplicate]');
- $field->setDescription('tip');
- $this->rightSection->addField($field);
- //Disk Cache
- $field = new Select('customconfigoption[additionalDiskCache]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //Disk Discard
- $field = new Switcher('customconfigoption[additionalDiskDiscard]');
- $field->setDescription('tip');
- $this->rightSection->addField($field);
- //Disk IO Thread
- $field = new Switcher('customconfigoption[additionalDiskIoThread]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //Allow Backups On Additional Disks
- $field = new Switcher('customconfigoption[permissionAdditionalDiskBackup]');
- $field->setDescription('tip');
- $this->rightSection->addField($field);
- //Limits
- $field = new Switcher('customconfigoption[additionalDiskSpeed]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //ssd
- $field = new Switcher('customconfigoption[additionalDiskSsd]');
- $field->setDescription('tip');
- $this->rightSection->addField($field);
- }
- }
|