| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /* * ********************************************************************
- * Proxmox Product developed. (Dec 7, 2017)
- * *
- *
- * CREATED BY MODULESGARDEN -> http://modulesgarden.com
- * CONTACT -> contact@modulesgarden.com
- *
- *
- * This software is furnished under a license and may be used and copied
- * only in accordance with the terms of such license and with the
- * inclusion of the above copyright notice. This software or any other
- * copies thereof may not be provided or otherwise made available to any
- * other person. No title to and ownership of the software is hereby
- * transferred.
- *
- *
- * ******************************************************************** */
- namespace ModulesGarden\ProxmoxAddon\App\UI\ServerSettings\Forms;
- use ModulesGarden\ProxmoxAddon\App\UI\ServerSettings\Providers\ServerSettingProvider;
- use ModulesGarden\ProxmoxAddon\App\UI\Validators\NumberValidator;
- use ModulesGarden\ProxmoxAddon\Core\UI\Interfaces\AdminArea;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Hidden;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Select;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Text;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields\Textarea;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\FormInTab;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\HalfPageSection;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Sections\RawSection;
- class ServerSettingsForm extends FormInTab implements AdminArea
- {
- protected $id = 'serverSettingsForm';
- protected $name = 'serverSettingsForm';
- protected $title = 'serverSettingsFormTitle';
- public function isRawTitle()
- {
- return false;
- }
- public function initContent()
- {
- $this->unsetShowTitle();
- //SettingProvider
- $this->setProvider(new ServerSettingProvider());
- //Add Sections
- $leftSection = new HalfPageSection('leftSection');
- $rightSection = new HalfPageSection('rightSection');
- $this->addSection($leftSection);
- $this->addSection($rightSection);
- $bottomSection = new RawSection('bottomSection');
- $this->addSection($bottomSection);
- //server_id
- $field = new Hidden('server_id');
- $leftSection->addField($field);
- //VMID From
- $field = new Text('vmid_from');
- $field->setDescription('description');
- $field->addValidator(new NumberValidator());
- $leftSection->addField($field);
- //VMID To
- $field = new Text('vmid_to');
- $field->setDescription('description');
- $field->addValidator(new NumberValidator());
- $rightSection->addField($field);
- //sshHost
- $field = new Text('sshHost');
- $leftSection->addField($field);
- //sshPort
- $field = new Text('sshPort');
- $rightSection->addField($field);
- //sshUser
- $field = new Text('sshUser');
- $leftSection->addField($field);
- //sshPassword
- $field = new Text('sshPassword');
- $rightSection->addField($field);
- //sshKey
- $field = new Textarea('sshKey');
- $bottomSection->addField($field);
- //snippetStorage
- $field = new Select('snippetStorage');
- $bottomSection->addField($field);
- $this->loadDataToForm();
- }
- }
|