| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- <?php
- /* * ********************************************************************
- * Wordpress_Manager 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\Settings\Pages;
- use ModulesGarden\ProxmoxAddon as main;
- use ModulesGarden\ProxmoxAddon\App\UI\Settings\Providers\SettingProvider;
- use ModulesGarden\ProxmoxAddon\App\UI\Settings\Sections\CronSection;
- use ModulesGarden\ProxmoxAddon\App\UI\Settings\Sections\GeneralSection;
- use ModulesGarden\ProxmoxAddon\Core\UI\Interfaces\AdminArea;
- use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\BaseStandaloneFormExtSections;
- /**
- * SettingsContainer
- */
- class SettingsContainer extends BaseStandaloneFormExtSections implements AdminArea
- {
- protected $id = 'settings';
- protected $name = 'settings';
- protected $title = null;
- public function initContent()
- {
- //SettingProvider
- $this->setProvider(new SettingProvider());
- //Crons
- $this->addSection(new CronSection('cron'));
- //General
- $general = new GeneralSection('general');
- //LoadBalancer
- $loadBalancer = new main\App\UI\Settings\Sections\LoadBalancerSection('loadBalancer');
- //Minimum VMID
- $field = new main\Core\UI\Widget\Forms\Fields\Text('proxmoxVPSMinimumVMID');
- $field->addValidator(new main\App\UI\Validators\NumberValidator(1, 100000000 * 100000000 * 100000000));
- $field->setLabelWidth(12);
- $field->setDefaultValue(100);
- $general->addField($field);
- //debug
- $field = new main\Core\UI\Widget\Forms\Fields\Switcher('debug');
- $field->setDescription('description');
- $general->addField($field);
- //Count VMs
- $field = new main\Core\UI\Widget\Forms\Fields\Text('vmsWeight');
- $field->addValidator(new main\App\UI\Validators\NumberValidator(1, null));
- $field->setLabelWidth(12);
- $field->setDescription('description');
- $field->setDefaultValue(1000);
- $loadBalancer->addField($field);
- //Weight CPU
- $field = new main\Core\UI\Widget\Forms\Fields\Text('cpuWeight');
- $field->addValidator(new main\App\UI\Validators\NumberValidator(1, null));
- $field->setLabelWidth(12);
- $field->setDescription('description');
- $field->setDefaultValue(1);
- $loadBalancer->addField($field);
- //Weight Disk
- $field = new main\Core\UI\Widget\Forms\Fields\Text('diskWeight');
- $field->addValidator(new main\App\UI\Validators\NumberValidator(1, null));
- $field->setLabelWidth(12);
- $field->setDescription('description');
- $field->setDefaultValue(1);
- $loadBalancer->addField($field);
- //Weight RAM
- $field = new main\Core\UI\Widget\Forms\Fields\Text('ramWeight');
- $field->addValidator(new main\App\UI\Validators\NumberValidator(1, null));
- $field->setLabelWidth(12);
- $field->setDescription('description');
- $field->setDefaultValue(1);
- $loadBalancer->addField($field);
- //Section
- $this->addSection($general);
- $this->addSection($loadBalancer);
- $this->loadDataToForm();
- }
- }
|