mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
show/activitylog: provide current object...
...might be helpful for new features
This commit is contained in:
parent
c6ecb14d7c
commit
0815763aa2
@ -13,8 +13,28 @@ class ShowController extends ActionController
|
|||||||
|
|
||||||
protected $oldObject;
|
protected $oldObject;
|
||||||
|
|
||||||
|
protected function objectKey($entry)
|
||||||
|
{
|
||||||
|
if ($entry->object_type === 'icinga_service') {
|
||||||
|
// TODO: this is not correct. Activity needs to get (multi) key support
|
||||||
|
return array('name' => $entry->object_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $entry->object_name;
|
||||||
|
}
|
||||||
|
|
||||||
protected function activityTabs($entry)
|
protected function activityTabs($entry)
|
||||||
{
|
{
|
||||||
|
$db = $this->db();
|
||||||
|
|
||||||
|
if (IcingaObject::existsByType($entry->object_type, $this->objectKey($entry), $db)) {
|
||||||
|
$this->view->currentObject = IcingaObject::loadByType(
|
||||||
|
$entry->object_type,
|
||||||
|
$entry->object_name,
|
||||||
|
$db
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$tabs = $this->getTabs();
|
$tabs = $this->getTabs();
|
||||||
if ($entry->action_name === 'modify') {
|
if ($entry->action_name === 'modify') {
|
||||||
$tabs->add('diff', array(
|
$tabs->add('diff', array(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user