NetworkSection.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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->setDecimal(1);
  55. $field->setDescription('tip');
  56. $this->addField($field);
  57. //VLAN TAG Range To
  58. $field = new Text('customconfigoption[tagTo]');
  59. $field->setDecimal(4094);
  60. $field->setDescription('tip');
  61. $this->addField($field);
  62. //Tag
  63. $field = new Select('customconfigoption[tags][]');
  64. $field->enableMultiple();
  65. $field->setDescription('tip');
  66. if(Utility::isIpManagerProxmoxVPSIntegration()){
  67. $field->setDescription('ip_manager_integration_tag');
  68. }
  69. $this->addField($field);
  70. }
  71. }