parent
9725d8f625
commit
8ce4cf49c0
|
@ -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')
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue