NetworkSection.php 2.8 KB

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