ConfigurationSection.php 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections\Qemu;
  3. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
  4. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Select;
  5. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Switcher;
  6. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Text;
  7. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BoxSection;
  8. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  9. class ConfigurationSection extends BoxSection implements AdminArea
  10. {
  11. protected $id = 'configurationSection';
  12. protected $name = 'configurationSection';
  13. protected $title = 'configurationSection';
  14. /**
  15. * @var HalfPageSection
  16. */
  17. private $leftSection;
  18. /**
  19. * @var HalfPageSection
  20. */
  21. private $rightSection;
  22. public function initContent()
  23. {
  24. $this->leftSection = new HalfPageSection('leftSection');
  25. $this->rightSection = new HalfPageSection('rightSection');
  26. $this->addSection($this->leftSection)
  27. ->addSection($this->rightSection);
  28. $this->initFields();
  29. }
  30. private function initFields()
  31. {
  32. //OS Type - default 2.6/3.x
  33. $field = new Select('customconfigoption[ostype]');
  34. $field->setDescription('tip');
  35. $field->setDefaultValue("l26");
  36. $this->leftSection->addField($field);
  37. //ACPI - switch, default off
  38. $field = new Switcher('customconfigoption[acpi]');
  39. $field->setDescription('tip');
  40. $field->setDefaultValue("off");
  41. $this->rightSection->addField($field);
  42. //Automatic Restart After Crash
  43. $field = new Switcher('customconfigoption[autostart]');
  44. $field->setDescription('tip');
  45. $this->rightSection->addField($field);
  46. //cdrom
  47. $field = new Text('customconfigoption[cdrom]');
  48. $field->setDescription('tip');
  49. $this->leftSection->addField($field);
  50. //CD/DVD-ROM Type
  51. $field = new Select('customconfigoption[cdromType]');
  52. $field->setDescription('tip');
  53. $this->leftSection->addField($field);
  54. //PCID
  55. $field = new Switcher('customconfigoption[pcid]');
  56. $field->setDescription('tip');
  57. $this->rightSection->addField($field);
  58. //Numa
  59. $field = new Switcher('customconfigoption[numa]');
  60. $field->setDescription('tip');
  61. $this->leftSection->addField($field);
  62. //SPEC-CTRL
  63. $field = new Switcher('customconfigoption[spec-ctrl]');
  64. $field->setDescription('tip');
  65. $this->leftSection->addField($field);
  66. //Startup Freeze CPU
  67. $field = new Switcher('customconfigoption[freeze]');
  68. $field->setDescription('tip');
  69. $this->leftSection->addField($field);
  70. //Hotplug
  71. $field = new Select('customconfigoption[hotplug][]');
  72. $field->setDescription('tip');
  73. $field->enableMultiple();
  74. $this->rightSection->addField($field);
  75. //Keyboard
  76. $field = new Select('customconfigoption[keyboard]');
  77. $field->setDescription('tip');
  78. $this->leftSection->addField($field);
  79. //KVM Hardware Virtualization
  80. $field = new Switcher('customconfigoption[kvm]');
  81. $field->setDescription('tip');
  82. $field->setDefaultValue("on");
  83. $this->rightSection->addField($field);
  84. //Start At Boot
  85. $field = new Switcher('customconfigoption[onboot]');
  86. $field->setDescription('tip');
  87. $this->rightSection->addField($field);
  88. //Add The VM To The Specific Pool
  89. $field = new Select('customconfigoption[pool]');
  90. $field->setDescription('tip');
  91. $this->leftSection->addField($field);
  92. //Allow Reboot
  93. $field = new Switcher('customconfigoption[reboot]');
  94. $field->setDescription('tip');
  95. $this->rightSection->addField($field);
  96. //USB Tablet Device
  97. $field = new Switcher('customconfigoption[tablet]');
  98. $field->setDescription('tip');
  99. $this->rightSection->addField($field);
  100. //VGA Type
  101. $field = new Select('customconfigoption[vga]');
  102. $field->setDescription('tip');
  103. $this->leftSection->addField($field);
  104. //Search For Templates In All Nodes
  105. $field = new Switcher('customconfigoption[osTemplatesInAllNodes]');
  106. $field->setDescription('tip');
  107. $field->setDefaultValue("on");
  108. $this->leftSection->addField($field);
  109. //Clone Mode
  110. $field = new Select('customconfigoption[cloneMode]');
  111. $field->setDescription('tip');
  112. $field->setDefaultValue("full");
  113. $this->rightSection->addField($field);
  114. //Start after created
  115. $field = new Switcher('customconfigoption[start]');
  116. $field->setDescription('tip');
  117. $field->setDefaultValue("on");
  118. $this->leftSection->addField($field);
  119. //Clone On The Same Storage As Source
  120. $field = new Switcher('customconfigoption[cloneOnTheSameStorage]');
  121. $field->setDescription('tip');
  122. $this->rightSection->addField($field);
  123. //md-clear
  124. $field = new Switcher('customconfigoption[md-clear]');
  125. $field->setDescription('tip');
  126. $this->leftSection->addField($field);
  127. //ssbd
  128. $field = new Switcher('customconfigoption[ssbd]');
  129. $field->setDescription('tip');
  130. $this->rightSection->addField($field);
  131. //ibpb
  132. $field = new Switcher('customconfigoption[ibpb]');
  133. $field->setDescription('tip');
  134. $this->leftSection->addField($field);
  135. //virt-ssbd
  136. $field = new Switcher('customconfigoption[virt-ssbd]');
  137. $field->setDescription('tip');
  138. $this->rightSection->addField($field);
  139. //amd-ssbd
  140. $field = new Switcher('customconfigoption[amd-ssbd]');
  141. $field->setDescription('tip');
  142. $this->leftSection->addField($field);
  143. //amd-no-ssb
  144. $field = new Switcher('customconfigoption[amd-no-ssb]');
  145. $field->setDescription('tip');
  146. $this->rightSection->addField($field);
  147. //pdpe1gb
  148. $field = new Switcher('customconfigoption[pdpe1gb]');
  149. $field->setDescription('tip');
  150. $this->rightSection->addField($field);
  151. //hv-tlbflush
  152. $field = new Switcher('customconfigoption[hv-tlbflush]');
  153. $field->setDescription('tip');
  154. $this->rightSection->addField($field);
  155. //hv-evmcs
  156. $field = new Switcher('customconfigoption[hv-evmcs]');
  157. $field->setDescription('tip');
  158. $this->rightSection->addField($field);
  159. //aes
  160. $field = new Switcher('customconfigoption[aes]');
  161. $field->setDescription('tip');
  162. $this->rightSection->addField($field);
  163. //vgaMemory
  164. $field = new Text('customconfigoption[vgaMemory]');
  165. $field->setDescription('tip');
  166. $this->leftSection->addField($field);
  167. }
  168. }