BootSection.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections\Qemu;
  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\Fields\Text;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  7. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  8. class BootSection extends BoxSection implements AdminArea
  9. {
  10. protected $id = 'bootSection';
  11. protected $name = 'bootSection';
  12. protected $title = 'bootSection';
  13. /**
  14. * @var HalfPageSection
  15. */
  16. private $leftSection;
  17. /**
  18. * @var HalfPageSection
  19. */
  20. private $rightSection;
  21. public function initContent()
  22. {
  23. $this->leftSection = new HalfPageSection('leftSection');
  24. $this->rightSection = new HalfPageSection('rightSection');
  25. $this->addSection($this->leftSection)
  26. ->addSection($this->rightSection);
  27. $this->initFields();
  28. }
  29. private function initFields()
  30. {
  31. //Boot Device 1
  32. $field = new Select('customconfigoption[bootDevice1]');
  33. $field->setDescription('tip');
  34. $this->leftSection->addField($field);
  35. //Boot Device 2
  36. $field = new Select('customconfigoption[bootDevice2]');
  37. $field->setDescription('tip');
  38. $this->rightSection->addField($field);
  39. //Boot Device 3
  40. $field = new Select('customconfigoption[bootDevice3]');
  41. $field->setDescription('tip');
  42. $this->leftSection->addField($field);
  43. //Boot Disk
  44. $field = new Text('customconfigoption[bootdisk]');
  45. $field->setDescription('tip');
  46. $this->rightSection->addField($field);
  47. }
  48. }