mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
parent
9725d8f625
commit
8ce4cf49c0
@ -56,6 +56,7 @@ class InspectController extends ActionController
|
|||||||
public function typeAction()
|
public function typeAction()
|
||||||
{
|
{
|
||||||
$typeName = $this->params->get('name');
|
$typeName = $this->params->get('name');
|
||||||
|
$this->singleTab($this->translate('Inspect - object list'));
|
||||||
$this->view->title = sprintf(
|
$this->view->title = sprintf(
|
||||||
$this->translate('Object type "%s"'),
|
$this->translate('Object type "%s"'),
|
||||||
$typeName
|
$typeName
|
||||||
@ -75,6 +76,7 @@ class InspectController extends ActionController
|
|||||||
|
|
||||||
public function objectAction()
|
public function objectAction()
|
||||||
{
|
{
|
||||||
|
$this->singleTab($this->translate('Object Inspection'));
|
||||||
$this->view->object = $this->api()->getObject(
|
$this->view->object = $this->api()->getObject(
|
||||||
$this->params->get('name'),
|
$this->params->get('name'),
|
||||||
$this->params->get('plural')
|
$this->params->get('plural')
|
||||||
|
@ -24,30 +24,27 @@ class HostActions extends HostActionsHook
|
|||||||
|
|
||||||
protected function getThem(Host $host)
|
protected function getThem(Host $host)
|
||||||
{
|
{
|
||||||
|
$actions = array();
|
||||||
$db = $this->db();
|
$db = $this->db();
|
||||||
if (! $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;
|
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()
|
protected function db()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user