| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- /* * ********************************************************************
- * ProxmoxAddon product developed. (Aug 14, 2018)
- * *
- *
- * CREATED BY MODULESGARDEN -> http://modulesgarden.com
- * CONTACT -> contact@modulesgarden.com
- *
- *
- * This software is furnished under a license and may be used and copied
- * only in accordance with the terms of such license and with the
- * inclusion of the above copyright notice. This software or any other
- * copies thereof may not be provided or otherwise made available to any
- * other person. No title to and ownership of the software is hereby
- * transferred.
- *
- *
- * ******************************************************************** */
- namespace ModulesGarden\ProxmoxAddon\App\Http\Admin;
- use ModulesGarden\ProxmoxAddon\App\Services\RecoveryVmDumpService;
- use ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages\Subscription;
- use ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages\Summary;
- use ModulesGarden\ProxmoxAddon\Core\Helper;
- use ModulesGarden\ProxmoxAddon\Core\Http\AbstractController;
- use Symfony\Component\HttpFoundation\StreamedResponse;
- /**
- * Example admin home page controler
- */
- class Home extends AbstractController
- {
- /**
- * Example of static page
- * @return type
- */
- public function index()
- {
- return Helper\redirect('home', 'servers');
- }
- public function servers()
- {
- return Helper\view()->addElement(\ModulesGarden\ProxmoxAddon\App\UI\Servers\Pages\ServersDataTable::class);
- }
- public function vms()
- {
- return Helper\view()->addElement(\ModulesGarden\ProxmoxAddon\App\UI\Vms\Pages\VmsDataTable::class);
- }
- public function recoveryVms()
- {
- return Helper\view()->addElement(\ModulesGarden\ProxmoxAddon\App\UI\RecoveryVms\Pages\RecoveryVmsDataTable::class);
- }
- public function recoveryToFile()
- {
- $response = new StreamedResponse();
- $response->setStatusCode(200);
- $response->headers->set('Content-Type', 'application/x-pem-file; charset=utf-8');
- $response->setCallback(function ()
- {
- echo (new RecoveryVmDumpService())->generate();
- });
- $response->headers->set(
- 'Content-Disposition', 'attachment; filename="recover_vm_list_' . date("Y-m-d H:i:s") . '.txt"'
- );
- $response->send();
- }
- public function taskHistory()
- {
- return Helper\view()->addElement(\ModulesGarden\ProxmoxAddon\App\UI\TaskHistory\Pages\TaskHistoryDataTable::class);
- }
- public function serverDetail()
- {
- return Helper\view()->addElement(\ModulesGarden\ProxmoxAddon\App\UI\ServerDetail\Pages\ServerDetailContainer::class);
- }
- public function nodeDetail()
- {
- return Helper\view()->setCustomJsCode()
- ->addElement(Summary::class)
- ->addElement(Subscription::class)
- ->addElement(\ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages\CpuGraph::class)
- ->addElement(\ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages\ServerLoadGraph::class)
- ->addElement(\ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages\MemoryGraph::class)
- ->addElement(\ModulesGarden\ProxmoxAddon\App\UI\NodeDetail\Pages\NetworkGraph::class);
- }
- }
|