mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
TacticalController: Add OutputFormat and tab creation handling
Mimics the behaviour of the ListController
This commit is contained in:
parent
79c12385ae
commit
44abd01ffc
@ -8,9 +8,19 @@ use Icinga\Module\Monitoring\Controller;
|
|||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
use Icinga\Web\Widget\Tabextension\DashboardAction;
|
||||||
use Icinga\Web\Widget\Tabextension\MenuAction;
|
use Icinga\Web\Widget\Tabextension\MenuAction;
|
||||||
|
use Icinga\Web\Widget\Tabextension\OutputFormat;
|
||||||
|
|
||||||
class TacticalController extends Controller
|
class TacticalController extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @see ActionController::init
|
||||||
|
*/
|
||||||
|
public function init()
|
||||||
|
{
|
||||||
|
parent::init();
|
||||||
|
$this->createTabs();
|
||||||
|
}
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$this->setAutorefreshInterval(15);
|
$this->setAutorefreshInterval(15);
|
||||||
@ -51,6 +61,7 @@ class TacticalController extends Controller
|
|||||||
);
|
);
|
||||||
$this->applyRestriction('monitoring/filter/objects', $stats);
|
$this->applyRestriction('monitoring/filter/objects', $stats);
|
||||||
|
|
||||||
|
$this->handleFormatRequest($stats);
|
||||||
$summary = $stats->fetchRow();
|
$summary = $stats->fetchRow();
|
||||||
|
|
||||||
$hostSummaryChart = new Donut();
|
$hostSummaryChart = new Donut();
|
||||||
@ -103,4 +114,15 @@ class TacticalController extends Controller
|
|||||||
->render();
|
->render();
|
||||||
$this->view->statusSummary = $summary;
|
$this->view->statusSummary = $summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all tabs for this controller
|
||||||
|
*
|
||||||
|
* @return Tabs
|
||||||
|
*/
|
||||||
|
private function createTabs()
|
||||||
|
{
|
||||||
|
$this->getTabs()->extend(new OutputFormat(['pdf']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user