FirewallSection.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections;
  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\Fields\Text;
  7. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BoxSection;
  8. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  9. class FirewallSection extends BoxSection implements AdminArea
  10. {
  11. protected $id = 'firewallSection';
  12. protected $name = 'firewallSection';
  13. protected $title = 'firewallSection';
  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. /**
  33. * @deprecated
  34. //Interfaces
  35. $field = new Select('customconfigoption[firewallInterfaces][]');
  36. $field->setDescription('tip');
  37. $field->enableMultiple();
  38. $this->leftSection->addField($field);
  39. */
  40. //Firewall Rules Limit
  41. $field = new Text('customconfigoption[firewallMaxRules]');
  42. $field->setDefaultValue(10);
  43. $field->setDescription('tip');
  44. $this->rightSection->addField($field);
  45. //IPSet IP Filter
  46. $field = new Switcher('customconfigoption[ipsetIpFilter]');
  47. $field->setDescription('tip');
  48. $this->leftSection->addField($field);
  49. }
  50. }