HighAvailabilityClusterSection.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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\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 HighAvailabilityClusterSection extends BoxSection implements AdminArea
  9. {
  10. protected $id = 'highAvailabilityClusterSection';
  11. protected $name = 'highAvailabilityClusterSection';
  12. protected $title = 'highAvailabilityClusterSection';
  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. //State
  32. $field = new Select('customconfigoption[clusterState]');
  33. $field->setDescription('tip');
  34. $this->leftSection->addField($field);
  35. //Group
  36. $field = new Select('customconfigoption[clusterGroup]');
  37. $field->setDescription('tip');
  38. $this->rightSection->addField($field);
  39. //Max. Restart
  40. $field = new Text('customconfigoption[clusterMaxRestart]');
  41. $field->setDescription('tip');
  42. $field->setDefaultValue(1);
  43. $this->leftSection->addField($field);
  44. //Max. Relocate
  45. $field = new Text('customconfigoption[clusterMaxRelocate]');
  46. $field->setDescription('tip');
  47. $field->setDefaultValue(1);
  48. $this->rightSection->addField($field);
  49. }
  50. }