inspect: show tabs, allow for all hosts

fixes #13073
This commit is contained in:
Thomas Gelf 2016-11-08 16:13:01 +01:00
parent 9725d8f625
commit 8ce4cf49c0
2 changed files with 19 additions and 20 deletions

View File

@ -56,6 +56,7 @@ class InspectController extends ActionController
public function typeAction()
{
$typeName = $this->params->get('name');
$this->singleTab($this->translate('Inspect - object list'));
$this->view->title = sprintf(
$this->translate('Object type "%s"'),
$typeName
@ -75,6 +76,7 @@ class InspectController extends ActionController
public function objectAction()
{
$this->singleTab($this->translate('Object Inspection'));
$this->view->object = $this->api()->getObject(
$this->params->get('name'),
$this->params->get('plural')

View File

@ -24,30 +24,27 @@ class HostActions extends HostActionsHook
protected function getThem(Host $host)
{
$actions = array();
$db = $this->db();
if (! $db) {
return array();
}
if (IcingaHost::exists($host->host_name, $db)) {
$actions = array(
'Modify' => Url::fromPath(
'director/host/edit',
array('name' => $host->host_name)
)
);
if (Util::hasPermission('director/inspect')) {
$actions['Inspect'] = Url::fromPath(
'director/inspect/object',
array('type' => 'host', 'plural' => 'hosts', 'name' => $host->host_name)
);
}
return $actions;
} else {
return array();
}
$hostname = $host->host_name;
if (Util::hasPermission('director/inspect')) {
$actions['Inspect'] = Url::fromPath(
'director/inspect/object',
array('type' => 'host', 'plural' => 'hosts', 'name' => $hostname)
);
}
if (IcingaHost::exists($hostname, $db)) {
$actions['Modify'] = Url::fromPath(
'director/host/edit',
array('name' => $hostname)
);
}
return $actions;
}
protected function db()