MiscellaneousSection.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections;
  3. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
  4. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Select;
  5. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Switcher;
  6. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BoxSection;
  7. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  8. class MiscellaneousSection extends BoxSection implements AdminArea
  9. {
  10. protected $id = 'miscellaneousSection';
  11. protected $name = 'miscellaneousSection';
  12. protected $title = 'miscellaneousSection';
  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. //Backup VM Before Reinstallation
  32. $field = new Switcher('customconfigoption[backupVmBeforeReinstall]');
  33. $field->setDescription('tip');
  34. $this->leftSection->addField($field);
  35. //Reboot VM After Changing Package
  36. $field = new Switcher('customconfigoption[rebootVmAfterUpgrade');
  37. $field->setDescription('tip');
  38. $this->rightSection->addField($field);
  39. //Bandwidth Overage
  40. $field = new Switcher('customconfigoption[suspendOnBandwidthOverage]');
  41. $field->setDescription('tip');
  42. $this->rightSection->addField($field);
  43. //Suspension Action
  44. $field = new Select('customconfigoption[suspensionAction]');
  45. $field->setDescription('tip');
  46. $this->leftSection->addField($field);
  47. //buttons
  48. $field = new Select('customconfigoption[buttonSyle]');
  49. $field->setDefaultValue('tiles');
  50. $field->setDescription('tip');
  51. $this->rightSection->addField($field);
  52. //Details View
  53. $field = new Select('customconfigoption[detailsView]');
  54. $field->setDefaultValue('standard');
  55. $field->setDescription('tip');
  56. $this->leftSection->addField($field);
  57. }
  58. }