mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-24 08:39:34 -05:00
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace Icinga\Module\Businessprocess;
|
|
|
|
class ServiceNode extends Node
|
|
{
|
|
protected $hostname;
|
|
protected $service;
|
|
|
|
public function __construct(BusinessProcess $bp, $object)
|
|
{
|
|
$this->name = $object->hostname . ';' . $object->service;
|
|
$this->hostname = $object->hostname;
|
|
$this->service = $object->service;
|
|
$this->bp = $bp;
|
|
$this->setState($object->state);
|
|
}
|
|
|
|
public function renderLink($view)
|
|
{
|
|
if ($this->bp->isSimulationMode()) {
|
|
return $view->qlink($this->getAlias(), 'businessprocess/node/simulate', array(
|
|
'node' => $this->name
|
|
));
|
|
} else {
|
|
return $view->qlink($this->getAlias(), 'monitoring/show/service', array(
|
|
'host' => $this->getHostname(),
|
|
'service' => $this->getServiceDescription()
|
|
));
|
|
}
|
|
}
|
|
|
|
public function getHostname()
|
|
{
|
|
return $this->hostname;
|
|
}
|
|
|
|
public function getServiceDescription()
|
|
{
|
|
return $this->service;
|
|
}
|
|
|
|
public function getAlias()
|
|
{
|
|
return $this->hostname . ': ' . $this->service;
|
|
}
|
|
}
|