MiscellaneousSection.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections;
  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\Switcher;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  7. use ModulesGarden\Servers\ProxmoxVps\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[rebootVmAfterChangePackage]');
  37. $field->setDescription('tip');
  38. $this->rightSection->addField($field);
  39. //Delete Backups After Termination
  40. $field = new Switcher('customconfigoption[deleteBackups]');
  41. $field->setDescription('tip');
  42. $field->setDefaultValue("on");
  43. $this->leftSection->addField($field);
  44. //Use Server Nameservers
  45. $field = new Switcher('customconfigoption[serverNameservers]');
  46. $field->setDescription('tip');
  47. $this->rightSection->addField($field);
  48. //Suspension Action
  49. $field = new Select('customconfigoption[suspensionAction]');
  50. $field->setDescription('tip');
  51. $this->leftSection->addField($field);
  52. //Bandwidth Overage
  53. $field = new Switcher('customconfigoption[suspendOnBandwidthOverage]');
  54. $field->setDescription('tip');
  55. $this->rightSection->addField($field);
  56. }
  57. }