MountPointSection.php 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections\Lxc;
  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 MountPointSection extends BoxSection implements AdminArea
  9. {
  10. protected $id = 'mountPointSection';
  11. protected $name = 'mountPointSection';
  12. protected $title = 'mountPointSection';
  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. //Storage
  32. $field = new Select('customconfigoption[mountPointStorage]');
  33. $field->setDefaultValue('local-lvm');
  34. $field->setDescription('tip');
  35. $this->leftSection->addField($field);
  36. //ACLs
  37. $field = new Select('customconfigoption[mountPointAcl]');
  38. $field->setDefaultValue("default");
  39. $field->setDescription('tip');
  40. $this->rightSection->addField($field);
  41. //Read-Only
  42. $field = new Switcher('customconfigoption[mountPointRo]');
  43. $field->setDescription('tip');
  44. $this->leftSection->addField($field);
  45. //Enable Quota
  46. $field = new Switcher('customconfigoption[mountPointQuota]');
  47. $field->setDescription('tip');
  48. $this->rightSection->addField($field);
  49. //Skip Replication
  50. $field = new Switcher('customconfigoption[mountPointReplicate]');
  51. $field->setDescription('tip');
  52. $this->leftSection->addField($field);
  53. //permissionMountPointBackup
  54. $field = new Switcher('customconfigoption[permissionMountPointBackup]');
  55. $field->setDescription('tip');
  56. $field->setDefaultValue("on");
  57. $this->rightSection->addField($field);
  58. //mountPoint
  59. $field = new Switcher('customconfigoption[mountPoint]');
  60. $field->setDescription('tip');
  61. $this->leftSection->addField($field);
  62. }
  63. }