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:
Jannis Moßhammer 2013-07-19 18:04:13 +02:00
parent dac9b7be4b
commit 597797c2ab
2 changed files with 2 additions and 24 deletions

View File

@ -22,7 +22,7 @@ class Monitoring_ListController extends ModuleActionController
public function hostsAction()
{
Benchmark::measure("hostsAction::query()");
$this->view->hosts = $this->backend->select()->from(
$this->view->hosts = $this->query(
'status',
array(
'host_icon_image',
@ -45,28 +45,6 @@ class Monitoring_ListController extends ModuleActionController
'host_last_comment'
)
);
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');
}
}

View File

@ -47,7 +47,7 @@ $trimArea = $this->getHelper('Trim');
</td>
<td class="icons indicator">
<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' ?>">
<i class="icon-warning-sign"></i>
</a>