DefaultConfigurationSection.php 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections\Qemu;
  3. use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections\TwiceColumnSection;
  4. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
  5. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Select;
  6. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Text;
  7. class DefaultConfigurationSection extends TwiceColumnSection implements AdminArea
  8. {
  9. protected $id = 'defaultConfigurationSection';
  10. protected $name = 'defaultConfigurationSection';
  11. protected $title = 'defaultConfigurationSection';
  12. protected function initFields()
  13. {
  14. //cpu
  15. $field = new Select('customconfigoption[cpu]');
  16. $field->setDescription('tip');
  17. $field->setDefaultValue('kvm64');
  18. $this->addField($field);
  19. //Number of CPU Sockets
  20. $field = new Text('customconfigoption[sockets]');
  21. $field->setDescription('tip');
  22. $field->setDefaultValue(10);
  23. $this->addField($field);
  24. //Number of Cores Per Socket
  25. $field = new Text('customconfigoption[cores]');
  26. $field->setDefaultValue(10);
  27. $field->setDescription('tip');
  28. $this->addField($field);
  29. //VCPUs
  30. $field = new Text('customconfigoption[vcpus]');
  31. $field->setDefaultValue(10);
  32. $field->setDescription('tip');
  33. $this->addField($field);
  34. //Limit of CPU
  35. $field = new Text('customconfigoption[cpulimit]');
  36. $field->setDefaultValue(10);
  37. $field->setDescription('tip');
  38. $this->addField($field);
  39. //CPU Weight For The VM
  40. $field = new Text('customconfigoption[cpuunits]');
  41. $field->setDefaultValue(10240);
  42. $field->setDescription('tip');
  43. $this->addField($field);
  44. //RAM For The VM
  45. $field = new Text('customconfigoption[memory]');
  46. $field->setDefaultValue(3000);
  47. $field->setDescription('tip');
  48. $this->addField($field);
  49. //Disk Space
  50. $field = new Text('customconfigoption[storageSize]');
  51. $field->setDescription('tip');
  52. $field->setDefaultValue(300);
  53. $this->addField($field);
  54. //Amount of IPv4 Addresses
  55. $field = new Text('customconfigoption[ipv4]');
  56. $field->setDescription('tip');
  57. $this->addField($field);
  58. //Amount of IPv6 Addresses
  59. $field = new Text('customconfigoption[ipv6]');
  60. $field->setDescription('tip');
  61. $this->addField($field);
  62. //Backups Size Limit
  63. $field = new Text('customconfigoption[backupMaxSize]');
  64. $field->setDescription('tip');
  65. $this->addField($field);
  66. //Backup Files Limit
  67. $field = new Text('customconfigoption[backupMaxFiles]');
  68. $field->setDescription('tip');
  69. $this->addField($field);
  70. //Bandwidth Limit
  71. $field = new Text('customconfigoption[bandwidth]');
  72. $field->setDescription('tip');
  73. $this->addField($field);
  74. //Snapshots Limit
  75. $field = new Text('customconfigoption[snapshotMaxFiles]');
  76. $field->setDescription('tip');
  77. $this->addField($field);
  78. //Private Network Limit
  79. $field = new Text('customconfigoption[virtualNetworks]');
  80. $field->setDescription('tip');
  81. $field->setDefaultValue(1);
  82. $this->addField($field);
  83. }
  84. }