ContainerSection.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections\Qemu;
  3. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AdminArea;
  4. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Select;
  5. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Text;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  7. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  8. class ContainerSection extends BoxSection implements AdminArea
  9. {
  10. protected $id = 'containerSection';
  11. protected $name = 'containerSection';
  12. protected $title = 'containerSection';
  13. /**
  14. * @var HalfPageSection
  15. */
  16. private $leftSection;
  17. /**
  18. * @var HalfPageSection
  19. */
  20. private $rightSection;
  21. public function initContent()
  22. {
  23. $this->leftSection = new HalfPageSection('leftSection');
  24. $this->rightSection = new HalfPageSection('rightSection');
  25. $this->addSection($this->leftSection)
  26. ->addSection($this->rightSection);
  27. $this->initFields();
  28. }
  29. private function initFields()
  30. {
  31. //VM Template
  32. $field = new Select('customconfigoption[osTemplate]');
  33. $field->setDescription('tip');
  34. $this->leftSection->addField($field);
  35. //ISO Image
  36. $field = new Select('customconfigoption[isoImage]');
  37. $field->setDescription('tip');
  38. $this->rightSection->addField($field);
  39. //cpu
  40. $field = new Select('customconfigoption[cpu]');
  41. $field->setDescription('tip');
  42. $field->setDefaultValue('kvm64');
  43. $this->leftSection->addField($field);
  44. //Number of CPU Sockets
  45. $field = new Text('customconfigoption[sockets]');
  46. $field->setDescription('tip');
  47. $field->setDefaultValue(1);
  48. $this->leftSection->addField($field);
  49. //Number of Cores Per Socket
  50. $field = new Text('customconfigoption[cores]');
  51. $field->setDefaultValue(1);
  52. $field->setDescription('tip');
  53. $this->rightSection->addField($field);
  54. //VCPUs
  55. $field = new Text('customconfigoption[vcpus]');
  56. $field->setDefaultValue(1);
  57. $field->setDescription('tip');
  58. $this->leftSection->addField($field);
  59. //Limit of CPU
  60. $field = new Text('customconfigoption[cpulimit]');
  61. $field->setDescription('tip');
  62. $this->rightSection->addField($field);
  63. //CPU Weight For The VM
  64. $field = new Text('customconfigoption[cpuunits]');
  65. $field->setDescription('tip');
  66. $this->leftSection->addField($field);
  67. //RAM For The VM
  68. $field = new Text('customconfigoption[memory]');
  69. $field->setDescription('tip');
  70. $this->leftSection->addField($field);
  71. //Disk Space
  72. $field = new Text('customconfigoption[diskSize]');
  73. $field->setDescription('tip');
  74. $field->setDefaultValue(32);
  75. $this->rightSection->addField($field);
  76. //Additional Disks Space
  77. $field = new Text('customconfigoption[additionalDiskSize]');
  78. $field->setDescription('tip');
  79. $this->leftSection->addField($field);
  80. //Network Rate Limit
  81. $field = new Text('customconfigoption[rate]');
  82. $field->setDescription('tip');
  83. $this->rightSection->addField($field);
  84. //Minimum Network Rate Limit
  85. $field = new Text('customconfigoption[minimumRate]');
  86. $field->setDescription('tip');
  87. $this->leftSection->addField($field);
  88. //Amount of IPv4 Addresses
  89. $field = new Text('customconfigoption[ipv4]');
  90. $field->setDescription('tip');
  91. $this->rightSection->addField($field);
  92. //Amount of IPv6 Addresses
  93. $field = new Text('customconfigoption[ipv6]');
  94. $field->setDescription('tip');
  95. $this->leftSection->addField($field);
  96. //Backups Size Limit
  97. $field = new Text('customconfigoption[backupMaxSize]');
  98. $field->setDescription('tip');
  99. $this->rightSection->addField($field);
  100. //Backup Files Limit
  101. $field = new Text('customconfigoption[backupMaxFiles]');
  102. $field->setDescription('tip');
  103. $this->leftSection->addField($field);
  104. //Bandwidth Limit
  105. $field = new Text('customconfigoption[bandwidth]');
  106. $field->setDescription('tip');
  107. $this->rightSection->addField($field);
  108. //Snapshots Limit
  109. $field = new Text('customconfigoption[snapshotMaxFiles]');
  110. $field->setDescription('tip');
  111. $this->rightSection->addField($field);
  112. //Snapshot Jobs
  113. $field = new Text('customconfigoption[snapshotJobs]');
  114. $field->setDescription('tip');
  115. $field->setDefaultValue(1);
  116. $this->rightSection->addField($field);
  117. }
  118. }