Removed custom query code from host action method, fix open problems
In the next sprint, the request contains all information needed to limit/filter/sort the resultset, so only an applyRequest should be enough refs #4179
This commit is contained in:
parent
dac9b7be4b
commit
597797c2ab
|
@ -22,7 +22,7 @@ class Monitoring_ListController extends ModuleActionController
|
||||||
public function hostsAction()
|
public function hostsAction()
|
||||||
{
|
{
|
||||||
Benchmark::measure("hostsAction::query()");
|
Benchmark::measure("hostsAction::query()");
|
||||||
$this->view->hosts = $this->backend->select()->from(
|
$this->view->hosts = $this->query(
|
||||||
'status',
|
'status',
|
||||||
array(
|
array(
|
||||||
'host_icon_image',
|
'host_icon_image',
|
||||||
|
@ -46,28 +46,6 @@ class Monitoring_ListController extends ModuleActionController
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($search = $this->_getParam('search')) {
|
|
||||||
$this->_setParam('search', null);
|
|
||||||
if (strpos($search, '=') === false) {
|
|
||||||
$this->_setParam('host_name', $search);
|
|
||||||
} else {
|
|
||||||
list($key, $val) = preg_split('~\s*=\s*~', $search, 2);
|
|
||||||
if ($this->view->hosts->isValidFilterColumn($key) || $key[0] === '_') {
|
|
||||||
$this->_setParam($key, $val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//$this->view->hosts->getQuery()->group('host_id');
|
|
||||||
if ($this->_getParam('dump') === 'sql') {
|
|
||||||
echo '<pre>' . htmlspecialchars(wordwrap($this->view->hosts->getQuery()->dump())) . '</pre>';
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->_getParam('view') === 'compact') {
|
|
||||||
$this->_helper->viewRenderer('hosts_compact');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function servicesAction()
|
public function servicesAction()
|
||||||
|
|
|
@ -47,7 +47,7 @@ $trimArea = $this->getHelper('Trim');
|
||||||
</td>
|
</td>
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||||
<?php if (!$host->host_handled): ?>
|
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||||
<i class="icon-warning-sign"></i>
|
<i class="icon-warning-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in New Issue