NetworkSection.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections\Qemu;
  3. use ModulesGarden\ProxmoxAddon\App\Services\Utility;
  4. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AdminArea;
  5. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Select;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Switcher;
  7. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Text;
  8. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  9. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  10. class NetworkSection extends BoxSection implements AdminArea
  11. {
  12. protected $id = 'networkSection';
  13. protected $name = 'networkSection';
  14. protected $title = 'networkSection';
  15. /**
  16. * @var HalfPageSection
  17. */
  18. private $leftSection;
  19. /**
  20. * @var HalfPageSection
  21. */
  22. private $rightSection;
  23. public function initContent()
  24. {
  25. $this->leftSection = new HalfPageSection('leftSection');
  26. $this->rightSection = new HalfPageSection('rightSection');
  27. $this->addSection($this->leftSection)
  28. ->addSection($this->rightSection);
  29. $this->initFields();
  30. }
  31. private function initFields()
  32. {
  33. //Network Model
  34. $field = new Select('customconfigoption[networkModel]');
  35. $field->setDescription('tip');
  36. $this->leftSection->addField($field);
  37. //Bridge
  38. $field = new Select('customconfigoption[bridge]');
  39. $field->setDescription('tip');
  40. $this->rightSection->addField($field);
  41. //Disable Additional NIC Creation
  42. $field = new Switcher('customconfigoption[oneNetworkDevice]');
  43. $field->setDescription('tip');
  44. $this->leftSection->addField($field);
  45. //Private Bridge
  46. $field = new Select('customconfigoption[privateBridge]');
  47. $field->setDescription('tip');
  48. $this->rightSection->addField($field);
  49. //Private Network Model
  50. $field = new Select('customconfigoption[networkPrivateModel]');
  51. $field->setDescription('tip');
  52. $this->leftSection->addField($field);
  53. //Firewall
  54. $field = new Switcher('customconfigoption[networkFirewall]');
  55. $field->setDescription('tip');
  56. $this->rightSection->addField($field);
  57. //Multiqueue
  58. $field = new Text('customconfigoption[queues]');
  59. $field->setDescription('tip');
  60. $this->leftSection->addField($field);
  61. //VLAN TAG Range From
  62. $field = new Text('customconfigoption[tagFrom]');
  63. $field->setDescription('tip');
  64. $this->rightSection->addField($field);
  65. //VLAN TAG Range To
  66. $field = new Text('customconfigoption[tagTo]');
  67. $field->setDescription('tip');
  68. $this->leftSection->addField($field);
  69. //Tag
  70. $field = new Select('customconfigoption[tags][]');
  71. $field->enableMultiple();
  72. $field->setDescription('tip');
  73. if(Utility::isIpManagerProxmoxVPSIntegration()){
  74. $field->setDescription('ip_manager_integration_tag');
  75. }
  76. $this->rightSection->addField($field);
  77. //privateNetwork
  78. $field = new Switcher('customconfigoption[privateNetwork]');
  79. $field->setDescription('tip');
  80. $this->leftSection->addField($field);
  81. }
  82. }