<?php

namespace ModulesGarden\Servers\ProxmoxCloudVps\App\Http\Admin;

use MGProvision\Proxmox\v2\Api;
use ModulesGarden\ProxmoxAddon\App\Services\ApiService;
use ModulesGarden\ProxmoxAddon\App\Services\Cloud\ProductService;
use ModulesGarden\ProxmoxAddon\App\Services\Cloud\UserService;
use ModulesGarden\Servers\ProxmoxCloudVps\App\Helpers\AppParams;
use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\AccountResources\AccountResourcesContainer;
use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Admin\User\Pages\UserDataTable;
use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\IpAddress\Pages\IpAddressDataTable;
use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\VmCreate\Sections\AccountSummary;
use ModulesGarden\Servers\ProxmoxCloudVps\App\UI\Vms\Pages\VmsDataTable;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\Helper;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\Http\AbstractController;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\Traits\OutputBuffer;
use ModulesGarden\Servers\ProxmoxCloudVps\Core\UI\Traits\WhmcsParams;
use Symfony\Component\HttpFoundation\RedirectResponse;

/**
 * Example admin home page controler
 * @author Sławomir Miśkowicz <slawomir@modulesgarden.com>
 */
class Home extends AbstractController
{
    use WhmcsParams;
    use ProductService;
    use ApiService;
    use OutputBuffer;
    use UserService;
    public function index()
    {
        $view = Helper\viewIntegrationAddon();
        $view->initCustomAssetFiles();
        (new AppParams())->initFromWhmcsParams();
        //Resurces
        $view->addElement(AccountResourcesContainer::class);
        //VMs
        $view->addElement(VmsDataTable::class);
        //IPs
        $view->addElement(IpAddressDataTable::class);
        //User
        $view->addElement(UserDataTable::class);
        return $view;

    }

}
