<?php

namespace ModulesGarden\Servers\ProxmoxVps\App\Http\Client;

use ModulesGarden\ProxmoxAddon\App\Services\Vps\ProductService;
use ModulesGarden\Servers\ProxmoxVps\App\Helpers\AppParams;
use ModulesGarden\Servers\ProxmoxVps\App\UI\Disk\Pages\DiskDataTable;
use ModulesGarden\Servers\ProxmoxVps\App\UI\MountPoint\Pages\MountPointDataTable;
use ModulesGarden\Servers\ProxmoxVps\Core\Helper;
use ModulesGarden\Servers\ProxmoxVps\Core\Http\AbstractClientController;
use ModulesGarden\Servers\ProxmoxVps\Core\UI\Traits\WhmcsParams;

class Disk extends AbstractClientController
{
    use WhmcsParams;
    use ProductService;

    public function index()
    {
        (new AppParams())->initFromWhmcsParams();
        $this->acl()->disk();
        Helper\sl("sidebar")->getSidebar("managementProxmoxVps")->getChild("disk")->setActive(true);

        if ($this->configuration()->isQemu())
        {
            return Helper\view()->addElement(DiskDataTable::class);
        }
        elseif ($this->configuration()->isLxc())
        {
            return Helper\view()->addElement(MountPointDataTable::class);
        }
    }

}
