CloudInitSection.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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\Switcher;
  7. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Text;
  8. use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Textarea;
  9. class CloudInitSection extends TwiceColumnSection implements AdminArea
  10. {
  11. protected $id = 'cloudInitSection';
  12. protected $name = 'cloudInitSection';
  13. protected $title = 'cloudInitSection';
  14. private $sectionFields=[];
  15. protected function initFields()
  16. {
  17. //Enable Cloud-Init
  18. $field = new Switcher('customconfigoption[cloudInit]');
  19. $field->setDescription('tip');
  20. $field->setDefaultValue("on");
  21. $this->addField($field);
  22. //Default User
  23. $field = new Text('customconfigoption[ciuser]');
  24. $field->setDescription('tip');
  25. $this->addField($field);
  26. //cicustom
  27. $field = new Textarea('customconfigoption[cicustom]');
  28. $field->setDescription('tip');
  29. $this->addField($field);
  30. //cloudInitStorage
  31. $field = new Select('customconfigoption[cloudInitStorage]');
  32. $field->setDescription('tip');
  33. $this->rightSection->addField($field);
  34. }
  35. }