Monitoring\Hook: fix service actions
This commit is contained in:
parent
9885d74d24
commit
9f035dd61a
|
@ -4,6 +4,7 @@
|
|||
namespace Icinga\Module\Monitoring\Hook;
|
||||
|
||||
use Icinga\Module\Monitoring\Object\Host;
|
||||
use Icinga\Module\Monitoring\Object\MonitoredObject;
|
||||
|
||||
/**
|
||||
* Base class for host action hooks
|
||||
|
@ -43,4 +44,9 @@ abstract class HostActionsHook extends ObjectActionsHook
|
|||
* @return array An array containing a list of host action links
|
||||
*/
|
||||
abstract public function getActionsForHost(Host $host);
|
||||
|
||||
public function getActionsForObject(MonitoredObject $object)
|
||||
{
|
||||
return $this->getActionsForHost($object);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ abstract class ObjectActionsHook
|
|||
*/
|
||||
public function getNavigation(MonitoredObject $object)
|
||||
{
|
||||
$urls = $this->getActionsForHost($object);
|
||||
$urls = $this->getActionsForObject($object);
|
||||
if (is_array($urls)) {
|
||||
$navigation = new Navigation();
|
||||
foreach ($urls as $label => $url) {
|
||||
|
@ -42,4 +42,6 @@ abstract class ObjectActionsHook
|
|||
{
|
||||
return empty($actions) ? new Navigation() : Navigation::fromArray($actions);
|
||||
}
|
||||
|
||||
abstract function getActionsForObject(MonitoredObject $object);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
namespace Icinga\Module\Monitoring\Hook;
|
||||
|
||||
use Icinga\Module\Monitoring\Object\Service;
|
||||
use Icinga\Module\Monitoring\Object\MonitoredObject;
|
||||
|
||||
/**
|
||||
* Base class for host action hooks
|
||||
|
@ -43,4 +44,9 @@ abstract class ServiceActionsHook extends ObjectActionsHook
|
|||
* @return array An array containing a list of service action links
|
||||
*/
|
||||
abstract public function getActionsForService(Service $service);
|
||||
|
||||
public function getActionsForObject(MonitoredObject $object)
|
||||
{
|
||||
return $this->getActionsForService($object);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue