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

class Snapshot extends AbstractClientController
{
    use WhmcsParams;
    use ProductService;

    public function index()
    {
        (new AppParams())->initFromWhmcsParams();
        $this->acl()->snapshot();
        Helper\sl("sidebar")->getSidebar("managementProxmoxVps")->getChild("snapshot")->setActive(true);
        if($this->configuration()->isPermissionSnapshotJob()){
            return Helper\view()->addElement(SnapshotTab::class);
        }
        return Helper\view()->addElement(SnapshotDataTable::class);
    }

}
