ConfigurableOptionUnitsSection.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections\Lxc;
  3. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AdminArea;
  4. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Select;
  5. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  7. class ConfigurableOptionUnitsSection extends BoxSection implements AdminArea
  8. {
  9. protected $id = 'configurableOptionUnitsSection';
  10. protected $name = 'configurableOptionUnitsSection';
  11. protected $title = 'configurableOptionUnitsSection';
  12. /**
  13. * @var HalfPageSection
  14. */
  15. private $leftSection;
  16. /**
  17. * @var HalfPageSection
  18. */
  19. private $rightSection;
  20. public function initContent()
  21. {
  22. $this->leftSection = new HalfPageSection('leftSection');
  23. $this->rightSection = new HalfPageSection('rightSection');
  24. $this->addSection($this->leftSection)
  25. ->addSection($this->rightSection);
  26. $this->initFields();
  27. }
  28. private function initFields()
  29. {
  30. //SWAP For the VM - MB/GB
  31. $field = new Select('customconfigoption[swapUnit]');
  32. $field->setDefaultValue("mb");
  33. $field->setDescription('tip');
  34. $this->leftSection->addField($field);
  35. //Memory- MB/GB
  36. $field = new Select('customconfigoption[memoryUnit]');
  37. $field->setDefaultValue("mb");
  38. $field->setDescription('tip');
  39. $this->rightSection->addField($field);
  40. //Disk Size - MB/GB/TB
  41. $field = new Select('customconfigoption[diskUnit]');
  42. $field->setDefaultValue("gb");
  43. $field->setDescription('tip');
  44. $this->leftSection->addField($field);
  45. //Additional Disks Size - MB/GB/TB
  46. $field = new Select('customconfigoption[additionalDiskUnit]');
  47. $field->setDescription('tip');
  48. $field->setDefaultValue("gb");
  49. $this->rightSection->addField($field);
  50. }
  51. }