<?php

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

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

class AdditonalDiskSpeedSection extends BoxSection implements AdminArea
{
    protected $id = 'additonalDiskSpeedSection';
    protected $name = 'additonalDiskSpeedSection';
    protected $title = 'additonalDiskSpeedSection';
    /**
     * @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()
    {
        //Read Limit (MB/s)
        $field = new Text('customconfigoption[additionalDiskMbps_rd]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
        //Write Limit (MB/s)
        $field = new  Text('customconfigoption[additionalDiskMbps_wr]');
        $field->setDescription('tip');
        $this->rightSection->addField($field);
        //Read Limit (ops/s)
        $field = new  Text('customconfigoption[additionalDiskIops_rd]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
        //Read Max Burst (ops)
        $field = new  Text('customconfigoption[additionalDiskIops_rd_max]');
        $field->setDescription('tip');
        $this->rightSection->addField($field);
        //Write Limit (ops/s)
        $field = new  Text('customconfigoption[additionalDiskIops_wr]');
        $field->setDescription('tip');
        $this->leftSection->addField($field);
        //Write Max Burst (ops)
        $field = new  Text('customconfigoption[additionalDiskIops_wr_max]');
        $field->setDescription('tip');
        $this->rightSection->addField($field);
    }

}
