| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\VmClone\Sections;
- use ModulesGarden\ProxmoxAddon\App\Services\Cloud\ProductService;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\ClientArea;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\Models\Whmcs\Server;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Text;
- use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BaseSection;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\VmClone\Validators\SearchdomainValidator;
- use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\VmClone\Validators\NameserverValidator;
- class DnsSection extends BaseSection implements ClientArea
- {
- use ProductService;
- public function initContent()
- {
- $this->initIds('dnsSection');
- $this->initFields();
- }
- public function initFields()
- {
- if($this->configuration()->isPermissionSearchdomain()){
- $domain = new Text('searchdomain');
- $domain->addValidator(new SearchdomainValidator(false));
- $domain->setDescription('description');
- $this->addField($domain);
- }
- if($this->configuration()->isPermissionNameservers()){
- $server = Server::select('id', 'nameserver1ip', 'nameserver2ip')->findOrFail($this->getWhmcsParamByKey('serverid'));
- //ns1
- $ns1 = new Text('nameserver[0]');
- $ns1->addValidator(new NameserverValidator());
- $ns1->setDefaultValue(trim($server->nameserver1ip));
- $ns1->setDescription('description');
- $this->addField($ns1);
- //ns2
- $ns2 = new Text('nameserver[1]');
- $ns2->addValidator(new NameserverValidator());
- $ns2->setDefaultValue(trim($server->nameserver2ip));
- $ns2->setDescription('description');
- $this->addField($ns2);
- }
- }
- }
|