mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-01 03:09:35 -05:00
Host/ServiceNode: introduce common base class
This commit is contained in:
parent
0b6cf208f0
commit
0251bc5edb
3 changed files with 27 additions and 3 deletions
|
|
@ -4,7 +4,7 @@ namespace Icinga\Module\Businessprocess;
|
|||
|
||||
use Icinga\Web\Url;
|
||||
|
||||
class HostNode extends Node
|
||||
class HostNode extends MonitoredNode
|
||||
{
|
||||
protected static $sortStateToStateMap = array(
|
||||
4 => self::ICINGA_DOWN,
|
||||
|
|
|
|||
24
library/Businessprocess/MonitoredNode.php
Normal file
24
library/Businessprocess/MonitoredNode.php
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
namespace Icinga\Module\Businessprocess;
|
||||
|
||||
use Icinga\Module\Businessprocess\Web\Component\Container;
|
||||
use Icinga\Module\Businessprocess\Web\Component\Link;
|
||||
|
||||
abstract class MonitoredNode extends Node
|
||||
{
|
||||
protected function prepareActions(Container $actions)
|
||||
{
|
||||
$actions->add(
|
||||
$url = Link::create(
|
||||
$actions->view()->translate('Simulate a specific state'),
|
||||
'businessprocess/process/show?addSimulation&unlocked',
|
||||
array(
|
||||
'config' => $this->bp->getName(),
|
||||
'simulationNode' => $this->name
|
||||
),
|
||||
array('class' => 'icon-magic')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ namespace Icinga\Module\Businessprocess;
|
|||
|
||||
use Icinga\Web\Url;
|
||||
|
||||
class ServiceNode extends Node
|
||||
class ServiceNode extends MonitoredNode
|
||||
{
|
||||
protected $hostname;
|
||||
|
||||
|
|
@ -42,7 +42,7 @@ class ServiceNode extends Node
|
|||
|
||||
return $link;
|
||||
}
|
||||
|
||||
|
||||
protected function getActionIcons($view)
|
||||
{
|
||||
$icons = array();
|
||||
|
|
|
|||
Loading…
Reference in a new issue