AdvancedSection.php 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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\Fields\Textarea;
  8. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BoxSection;
  9. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  10. class AdvancedSection extends BoxSection implements AdminArea
  11. {
  12. protected $id = 'advancedSection';
  13. protected $name = 'advancedSection';
  14. protected $title = 'advancedSection';
  15. /**
  16. * @var HalfPageSection
  17. */
  18. private $leftSection;
  19. /**
  20. * @var HalfPageSection
  21. */
  22. private $rightSection;
  23. public function initContent()
  24. {
  25. $this->leftSection = new HalfPageSection('leftSection');
  26. $this->rightSection = new HalfPageSection('rightSection');
  27. $this->addSection($this->leftSection)
  28. ->addSection($this->rightSection);
  29. $this->initFields();
  30. }
  31. private function initFields()
  32. {
  33. //Minimum RAM For The VM
  34. $field = new Text('customconfigoption[balloon]');
  35. $field->setDescription('tip');
  36. $this->leftSection->addField($field);
  37. //Memory Shares
  38. $field = new Text('customconfigoption[shares]');
  39. $field->setDescription('tip');
  40. $this->rightSection->addField($field);
  41. //Arguments-
  42. $field = new Textarea('customconfigoption[args]');
  43. $field->setDescription('tip');
  44. $this->leftSection->addField($field);
  45. //Local Time For Real Time Clock
  46. $field = new Switcher('customconfigoption[localtime]');
  47. $field->setDescription('tip');
  48. $this->rightSection->addField($field);
  49. //Maximum Tolerated Downtime
  50. $field = new Text('customconfigoption[migrate_downtime]');
  51. $field->setDescription('tip');
  52. $this->rightSection->addField($field);
  53. //Maximum Speed For Migrations [MB/s]
  54. $field = new Text('customconfigoption[migrate_speed]');
  55. $field->setDescription('tip');
  56. $this->leftSection->addField($field);
  57. //Hardware Watchdog Device
  58. $field = new Text('customconfigoption[watchdog]');
  59. $field->setDescription('tip');
  60. $this->rightSection->addField($field);
  61. //Initial Date Of The Real Time Clock
  62. $field = new Text('customconfigoption[startdate]');
  63. $field->setDescription('tip');
  64. $this->leftSection->addField($field);
  65. //Startup
  66. $field = new Text('customconfigoption[startup]');
  67. $field->setDescription('tip');
  68. $this->rightSection->addField($field);
  69. //Time Drift Fix
  70. $field = new Switcher('customconfigoption[tdf]');
  71. $field->setDescription('tip');
  72. $this->leftSection->addField($field);
  73. //bwlimit
  74. $field = new Text('customconfigoption[bwlimit]');
  75. $field->setDescription('tip');
  76. $this->rightSection->addField($field);
  77. //bios
  78. $field = new Select('customconfigoption[bios]');
  79. $field->setDescription('tip');
  80. $this->rightSection->addField($field);
  81. //machine
  82. $field = new Select('customconfigoption[machine]');
  83. $field->setDescription('tip');
  84. $this->leftSection->addField($field);
  85. }
  86. }