MiscellaneousSection.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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\Fields\Text;
  7. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  8. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  9. class MiscellaneousSection extends BoxSection implements AdminArea
  10. {
  11. protected $id = 'miscellaneousSection';
  12. protected $name = 'miscellaneousSection';
  13. protected $title = 'miscellaneousSection';
  14. /**
  15. * @var HalfPageSection
  16. */
  17. private $leftSection;
  18. /**
  19. * @var HalfPageSection
  20. */
  21. private $rightSection;
  22. public function initContent()
  23. {
  24. $this->leftSection = new HalfPageSection('leftSection');
  25. $this->rightSection = new HalfPageSection('rightSection');
  26. $this->addSection($this->leftSection)
  27. ->addSection($this->rightSection);
  28. $this->initFields();
  29. }
  30. private function initFields()
  31. {
  32. //Backup VM Before Reinstallation
  33. $field = new Switcher('customconfigoption[backupVmBeforeReinstall]');
  34. $field->setDescription('tip');
  35. $this->leftSection->addField($field);
  36. //Reboot VM After Changing Package
  37. $field = new Switcher('customconfigoption[rebootVmAfterChangePackage]');
  38. $field->setDescription('tip');
  39. $this->rightSection->addField($field);
  40. //Delete Backups After Termination
  41. $field = new Switcher('customconfigoption[deleteBackups]');
  42. $field->setDescription('tip');
  43. $field->setDefaultValue("on");
  44. $this->leftSection->addField($field);
  45. //Use Server Nameservers
  46. $field = new Switcher('customconfigoption[serverNameservers]');
  47. $field->setDescription('tip');
  48. $this->rightSection->addField($field);
  49. //Suspension Action
  50. $field = new Select('customconfigoption[suspensionAction]');
  51. $field->setDescription('tip');
  52. $this->leftSection->addField($field);
  53. //Bandwidth Overage
  54. $field = new Switcher('customconfigoption[suspendOnBandwidthOverage]');
  55. $field->setDescription('tip');
  56. $this->rightSection->addField($field);
  57. //MinimumVmid
  58. $field = new Text('customconfigoption[minimumVmid]');
  59. $field->setDescription('tip');
  60. $this->rightSection->addField($field);
  61. }
  62. }