ConsoleSection.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\App\UI\Settings\Sections;
  3. use ModulesGarden\ProxmoxAddon\App\UI\Validators\IpAddressAndHostnameValidator;
  4. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Text;
  5. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\BoxSection;
  6. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\HalfPageSection;
  7. class ConsoleSection extends BoxSection
  8. {
  9. protected $id = 'consoleSection';
  10. protected $name = 'consoleSection';
  11. protected $title = 'consoleSection';
  12. public function initContent(){
  13. //Add Sections
  14. $leftSection = new HalfPageSection('leftSection');
  15. $rightSection = new HalfPageSection('rightSection');
  16. $this->addSection($leftSection);
  17. $this->addSection($rightSection);
  18. //consoleHost
  19. $field = new Text('consoleHost');
  20. $field->addValidator(new IpAddressAndHostnameValidator());
  21. $leftSection->addField($field);
  22. //consoleApiKey
  23. $field = new Text('consoleApiKey');
  24. $rightSection->addField($field);
  25. }
  26. }