<?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\Graph\Pages\CpuGraph;
use ModulesGarden\Servers\ProxmoxVps\App\UI\Graph\Pages\DiskGraph;
use ModulesGarden\Servers\ProxmoxVps\App\UI\Graph\Pages\MemoryGraph;
use ModulesGarden\Servers\ProxmoxVps\App\UI\Graph\Pages\NetworkGraph;
use ModulesGarden\Servers\ProxmoxVps\Core\Helper;
use ModulesGarden\Servers\ProxmoxVps\Core\Http\AbstractClientController;

class Graph extends AbstractClientController
{
    use ProductService;

    public function index()
    {
        (new AppParams())->initFromWhmcsParams();
        $this->acl()->graph();
        Helper\sl("sidebar")->getSidebar("managementProxmoxVps")->getChild("graph")->setActive(true);
        $view = Helper\view();
        $view->initCustomAssetFiles();
        $view->addElement(CpuGraph::class)
            ->addElement(MemoryGraph::class)
            ->addElement(NetworkGraph::class)
            ->addElement(DiskGraph::class);
        return $view;
    }

}
