<?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\Network\Pages\NetworkLxcDataTable;
use ModulesGarden\Servers\ProxmoxVps\App\UI\Network\Pages\NetworkQemuDataTable;
use ModulesGarden\Servers\ProxmoxVps\Core\Helper;
use ModulesGarden\Servers\ProxmoxVps\Core\Http\AbstractClientController;
use ModulesGarden\Servers\ProxmoxVps\Core\UI\Traits\WhmcsParams;

class Network extends AbstractClientController
{
    use WhmcsParams;
    use ProductService;

    public function index()
    {
        (new AppParams())->initFromWhmcsParams();
        $this->acl()->network();
        Helper\sl("sidebar")->getSidebar("managementProxmoxVps")->getChild("network")->setActive(true);
        if ($this->configuration()->isQemu())
        {
            return Helper\view()->addElement(NetworkQemuDataTable::class);
        }
        else
        {
            if ($this->configuration()->isLxc())
            {
                return Helper\view()->addElement(NetworkLxcDataTable::class);
            }
        }

    }

}
