diff --git a/application/tables/IcingaServiceTable.php b/application/tables/IcingaServiceTable.php index c78a7306..25f75818 100644 --- a/application/tables/IcingaServiceTable.php +++ b/application/tables/IcingaServiceTable.php @@ -8,19 +8,26 @@ class IcingaServiceTable extends QuickTable { protected $searchColumns = array( 'service', + 'host' ); public function getColumns() { return array( - 'id' => 's.id', - 'service' => 's.object_name', + 'id' => 's.id', + 'host_id' => 's.host_id', + 'host' => 'h.object_name', + 'service' => 's.object_name', ); } protected function getActionUrl($row) { - return $this->url('director/service', array('name' => $row->service)); + $params = array('name' => $row->service); + if ($row->host !== null) { + $params['host'] = $row->host; + } + return $this->url('director/service', $params); } public function getTitles() @@ -28,6 +35,7 @@ class IcingaServiceTable extends QuickTable $view = $this->view(); return array( 'service' => $view->translate('Servicename'), + 'host' => $view->translate('Host'), ); } @@ -37,6 +45,10 @@ class IcingaServiceTable extends QuickTable $query = $db->select()->from( array('s' => 'icinga_service'), array() + )->joinLeft( + array('h' => 'icinga_host'), + 'h.id = s.host_id', + array() ); return $query;