GeneralSection.php 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxAddon product developed. (Sep 12, 2018)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\ProxmoxAddon\App\UI\ServerSettings\Sections;
  20. use ModulesGarden\ProxmoxAddon\App\UI\Validators\NumberValidator;
  21. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Hidden;
  22. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Select;
  23. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Text;
  24. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Textarea;
  25. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\BoxSection;
  26. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\HalfPageSection;
  27. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\RawSection;
  28. /**
  29. * Description of CronSection
  30. *
  31. * @author Pawel Kopec <pawelk@modulesgardne.com>
  32. */
  33. class GeneralSection extends BoxSection
  34. {
  35. protected $id = 'generalSection';
  36. protected $name = 'generalSection';
  37. protected $title = 'generalSectionTitle';
  38. public function initContent()
  39. {
  40. //Add Sections
  41. $leftSection = new HalfPageSection('leftSection');
  42. $rightSection = new HalfPageSection('rightSection');
  43. $this->addSection($leftSection);
  44. $this->addSection($rightSection);
  45. $bottomSection = new RawSection('bottomSection');
  46. $this->addSection($bottomSection);
  47. //server_id
  48. $field = new Hidden('server_id');
  49. $leftSection->addField($field);
  50. //VMID From
  51. $field = new Text('vmid_from');
  52. $field->setDescription('description');
  53. $field->addValidator(new NumberValidator());
  54. $leftSection->addField($field);
  55. //VMID To
  56. $field = new Text('vmid_to');
  57. $field->setDescription('description');
  58. $field->addValidator(new NumberValidator());
  59. $rightSection->addField($field);
  60. //sshHost
  61. $field = new Text('sshHost');
  62. $leftSection->addField($field);
  63. //sshPort
  64. $field = new Text('sshPort');
  65. $rightSection->addField($field);
  66. //sshUser
  67. $field = new Text('sshUser');
  68. $leftSection->addField($field);
  69. //sshPassword
  70. $field = new Text('sshPassword');
  71. $rightSection->addField($field);
  72. //sshKey
  73. $field = new Textarea('sshKey');
  74. $bottomSection->addField($field);
  75. //snippetStorage
  76. $field = new Select('snippetStorage');
  77. $bottomSection->addField($field);
  78. }
  79. }