mirror of
https://github.com/Icinga/icingaweb2-module-graphite.git
synced 2026-02-13 15:53:52 -05:00
30 lines
994 B
PHP
30 lines
994 B
PHP
<?php
|
|
|
|
namespace Icinga\Module\Graphite\Controllers;
|
|
|
|
use Icinga\Module\Monitoring\Controller;
|
|
use Icinga\Module\Monitoring\DataView\DataView;
|
|
|
|
class ListController extends Controller
|
|
{
|
|
public function hostsAction()
|
|
{
|
|
$this->view->hosts = $hosts = $this->backend->select()->from('hoststatus', ['host_name', 'host_display_name']);
|
|
$this->applyRestriction('monitoring/filter/objects', $hosts);
|
|
$this->filterQuery($hosts);
|
|
$this->setupPaginationControl($hosts);
|
|
$this->setupLimitControl();
|
|
$this->setupSortControl(['host_display_name' => mt('monitoring', 'Hostname')], $hosts);
|
|
}
|
|
|
|
/**
|
|
* Apply filters on a DataView
|
|
*
|
|
* @param DataView $dataView The DataView to apply filters on
|
|
*/
|
|
protected function filterQuery(DataView $dataView)
|
|
{
|
|
$this->setupFilterControl($dataView, null, null, ['format', 'stateType', 'addColumns', 'problems']);
|
|
$this->handleFormatRequest($dataView);
|
|
}
|
|
}
|