AdditonalDiskSpeedSection.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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\Text;
  5. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  7. class AdditonalDiskSpeedSection extends BoxSection implements AdminArea
  8. {
  9. protected $id = 'additonalDiskSpeedSection';
  10. protected $name = 'additonalDiskSpeedSection';
  11. protected $title = 'additonalDiskSpeedSection';
  12. /**
  13. * @var HalfPageSection
  14. */
  15. private $leftSection;
  16. /**
  17. * @var HalfPageSection
  18. */
  19. private $rightSection;
  20. public function initContent()
  21. {
  22. $this->leftSection = new HalfPageSection('leftSection');
  23. $this->rightSection = new HalfPageSection('rightSection');
  24. $this->addSection($this->leftSection)
  25. ->addSection($this->rightSection);
  26. $this->initFields();
  27. }
  28. private function initFields()
  29. {
  30. //Read Limit (MB/s)
  31. $field = new Text('customconfigoption[additionalDiskMbps_rd]');
  32. $field->setDescription('tip');
  33. $this->leftSection->addField($field);
  34. //Write Limit (MB/s)
  35. $field = new Text('customconfigoption[additionalDiskMbps_wr]');
  36. $field->setDescription('tip');
  37. $this->rightSection->addField($field);
  38. //Read Limit (ops/s)
  39. $field = new Text('customconfigoption[additionalDiskIops_rd]');
  40. $field->setDescription('tip');
  41. $this->leftSection->addField($field);
  42. //Read Max Burst (ops)
  43. $field = new Text('customconfigoption[additionalDiskIops_rd_max]');
  44. $field->setDescription('tip');
  45. $this->rightSection->addField($field);
  46. //Write Limit (ops/s)
  47. $field = new Text('customconfigoption[additionalDiskIops_wr]');
  48. $field->setDescription('tip');
  49. $this->leftSection->addField($field);
  50. //Write Max Burst (ops)
  51. $field = new Text('customconfigoption[additionalDiskIops_wr_max]');
  52. $field->setDescription('tip');
  53. $this->rightSection->addField($field);
  54. }
  55. }