CloudInitSection.php 1.3 KB

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