MountPointSection.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections\Lxc;
  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 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. }
  59. }