mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 16:54:04 +02:00
monitoring/list: make use of new params
This brings our lists back to life and makes our filters work again.
This commit is contained in:
parent
58d4ddcb4c
commit
0ecd527e8c
@ -437,28 +437,19 @@ class Monitoring_ListController extends Controller
|
|||||||
|
|
||||||
protected function applyFilters($query)
|
protected function applyFilters($query)
|
||||||
{
|
{
|
||||||
$url = clone($this->url);
|
$params = clone $this->params;
|
||||||
$url->shift('_render');
|
|
||||||
$limit = $url->shift('limit');
|
$params->shift('_render');
|
||||||
$sort = $url->shift('sort');
|
$limit = $params->shift('limit');
|
||||||
$dir = $url->shift('dir');
|
$sort = $params->shift('sort');
|
||||||
$page = $url->shift('page');
|
$dir = $params->shift('dir');
|
||||||
$format = $url->shift('format');
|
$page = $params->shift('page');
|
||||||
$view = $url->shift('view');
|
$format = $params->shift('format');
|
||||||
$backend = $url->shift('backend');
|
$view = $params->shift('view');
|
||||||
|
$backend = $params->shift('backend');
|
||||||
// $filter = Filter::matchAll();
|
$modifyFilter = $params->shift('modifyFilter', false);
|
||||||
$filter = Filter::fromQueryString($url->getQueryString());
|
|
||||||
foreach ($url->getParams() as $k => $v) {
|
$filter = Filter::fromQueryString((string) $params);
|
||||||
// if (strpos($v, ',') !== false) {
|
|
||||||
// $v = preg_split('~,~', $v);
|
|
||||||
// }
|
|
||||||
// $filter->addFilter(Filter::fromQueryString($k . '=' . $v));
|
|
||||||
// $filter->addFilter(Filter::where($k, $v));
|
|
||||||
//$query->where($k, $v);
|
|
||||||
// $query->addFilter(Filter::fromQueryString($k . '=' . $v));
|
|
||||||
}
|
|
||||||
//var_dump($filter); exit;
|
|
||||||
$query->applyFilter($filter);
|
$query->applyFilter($filter);
|
||||||
if ($sort) {
|
if ($sort) {
|
||||||
$query->order($sort, $dir);
|
$query->order($sort, $dir);
|
||||||
@ -475,19 +466,19 @@ class Monitoring_ListController extends Controller
|
|||||||
*
|
*
|
||||||
* @return DataView
|
* @return DataView
|
||||||
*/
|
*/
|
||||||
protected function applyRestrictions(DataView $dataView)
|
protected function applyRestrictions($query)
|
||||||
{
|
{
|
||||||
foreach ($this->getRestrictions('monitoring/filter') as $restriction) {
|
foreach ($this->getRestrictions('monitoring/filter') as $restriction) {
|
||||||
// TODO(el): Apply restrictions
|
// TODO: $query->applyFilter(Filter::fromQueryString());
|
||||||
}
|
}
|
||||||
return $dataView;
|
return $query;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function extraColumns()
|
protected function extraColumns()
|
||||||
{
|
{
|
||||||
$columns = preg_split(
|
$columns = preg_split(
|
||||||
'~,~',
|
'~,~',
|
||||||
$this->_request->getParam('addcolumns', ''),
|
$this->params->shift('addcolumns', ''),
|
||||||
-1,
|
-1,
|
||||||
PREG_SPLIT_NO_EMPTY
|
PREG_SPLIT_NO_EMPTY
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user