<?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\Sections\BoxSection;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Widget\Forms\Sections\HalfPageSection;

class ConfigurableOptionUnitsSection extends BoxSection implements AdminArea
{
    protected $id = 'configurableOptionUnitsSection';
    protected $name = 'configurableOptionUnitsSection';
    protected $title = 'configurableOptionUnitsSection';
    /**
     * @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()
    {
        //Memory- MB/GB
        $field = new Select('customconfigoption[memoryUnit]');
        $field->setDescription('tip');
        $field->setDefaultValue("mb");
        $this->leftSection->addField($field);
        //Disk Size - MB/GB/TB
        $field = new Select('customconfigoption[storageUnit]');
        $field->setDescription('tip');
        $field->setDefaultValue("gb");
        $this->rightSection->addField($field);
    }

}
