| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections\Lxc;
- use ModulesGarden\ProxmoxAddon\App\Services\Utility;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AdminArea;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Select;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Switcher;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Text;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
- use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
- class NetworkSection extends BoxSection implements AdminArea
- {
- protected $id = 'networkSection';
- protected $name = 'networkSection';
- protected $title = 'networkSection';
- /**
- * @var HalfPageSection
- */
- private $leftSection;
- /**
- * @var HalfPageSection
- */
- private $rightSection;
- public function initContent()
- {
- $this->leftSection = new HalfPageSection('leftSection');
- $this->rightSection = new HalfPageSection('rightSection');
- $this->addSection($this->leftSection)
- ->addSection($this->rightSection);
- $this->initFields();
- }
- private function initFields()
- {
- //IPv4 Network Mode
- $field = new Select('customconfigoption[ipv4NetworkMode]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //IPv6 Network Mode
- $field = new Select('customconfigoption[ipv6NetworkMode]');
- $field->setDescription('tip');
- $field->setDefaultValue('static');
- $this->rightSection->addField($field);
- //Bridge
- $field = new Select('customconfigoption[bridge]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //Private Bridge
- $field = new Select('customconfigoption[privateBridge]');
- $field->setDescription('tip');
- $this->rightSection->addField($field);
- //Firewall
- $field = new Switcher('customconfigoption[networkFirewall]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //VLAN TAG Range From
- $field = new Text('customconfigoption[tagFrom]');
- $field->setDescription('tip');
- $this->rightSection->addField($field);
- //VLAN TAG Range To
- $field = new Text('customconfigoption[tagTo]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- //Tag
- $field = new Select('customconfigoption[tags][]');
- $field->enableMultiple();
- $field->setDescription('tip');
- if(Utility::isIpManagerProxmoxVPSIntegration()){
- $field->setDescription('ip_manager_integration_tag');
- }
- $this->rightSection->addField($field);
- //privateNetwork
- $field = new Switcher('customconfigoption[privateNetwork]');
- $field->setDescription('tip');
- $this->leftSection->addField($field);
- }
- }
|