icingaweb2-module-businessp.../library/Businessprocess/HostNode.php

37 lines
964 B
PHP
Raw Normal View History

<?php
2014-11-30 09:56:58 -05:00
namespace Icinga\Module\Businessprocess;
class HostNode extends Node
{
protected $hostname;
public function __construct(BusinessProcess $bp, $object)
{
$this->name = $object->hostname . ';Hoststate';
$this->hostname = $object->hostname;
$this->bp = $bp;
$this->setState($object->state);
}
2014-11-30 05:30:59 -05:00
public function renderLink($view)
{
if ($this->bp->isSimulationMode()) {
2014-11-30 09:56:58 -05:00
return $view->qlink($this->getHostname(), 'businessprocess/host/simulate', array(
'node' => $this->name,
'processName' => $this->bp->getName()
2014-11-30 05:30:59 -05:00
));
} else {
return $view->qlink($this->getHostname(), 'monitoring/host/show', array(
'host' => $this->getHostname,
'processName' => $this->bp->getName()
2014-11-30 05:30:59 -05:00
));
}
}
public function getHostname()
{
return $this->hostname;
}
}