<?php

namespace ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\Product\Sections\Qemu;

use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Interfaces\AdminArea;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Select;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Fields\Text;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\BoxSection;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;

class BootSection extends BoxSection implements AdminArea
{
    protected $id = 'bootSection';
    protected $name = 'bootSection';
    protected $title = 'bootSection';
    /**
     * @var HalfPageSection
     */
    private $leftSection;
    /**
     * @var HalfPageSection
     */
    private $rightSection;

    public function initContent()
    {
        $this->leftSection  = new HalfPageSection('leftSection');
        $this->rightSection = new HalfPageSection('rightSection');
        $this->addSection($this->leftSection)
            ->addSection($this->rightSection);
        $this->initFields();
    }

    private function initFields()
    {
        //Boot Device 1
        $field = new Select('customconfigoption[bootDevice1]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
        //Boot Device 2
        $field = new Select('customconfigoption[bootDevice2]');
        $field->setDescription('tip');
        $this->rightSection->addField($field);
        //Boot Device 3
        $field = new Select('customconfigoption[bootDevice3]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
        //Boot Disk
        $field = new Text('customconfigoption[bootdisk]');
        $field->setDescription('tip');
        $this->rightSection->addField($field);
    }

}
