NodeController: apply simulations to business...

...impact rendering
This commit is contained in:
Thomas Gelf 2017-01-11 16:55:05 +01:00
parent 56ab13d2b0
commit 643261c9f7

View file

@ -4,6 +4,8 @@ namespace Icinga\Module\Businessprocess\Controllers;
use Icinga\Module\Businessprocess\Renderer\Breadcrumb;
use Icinga\Module\Businessprocess\Renderer\TileRenderer;
use Icinga\Module\Businessprocess\Simulation;
use Icinga\Module\Businessprocess\State\MonitoringState;
use Icinga\Module\Businessprocess\Web\Controller;
use Icinga\Module\Businessprocess\Web\Url;
@ -11,6 +13,7 @@ class NodeController extends Controller
{
public function impactAction()
{
$this->setAutorefreshInterval(10);
$content = $this->content();
$this->controls()->add(
$this->singleTab($this->translate('Node Impact'))
@ -26,11 +29,18 @@ class NodeController extends Controller
foreach ($config->getRootNodes() as $node) {
$node->getState();
}
foreach ($config->getRootNodes() as $node) {
$node->clearState();
}
if (! $config->hasNode($name)) {
continue;
}
MonitoringState::apply($config);
$simulation = new Simulation($config, $this->session());
$config->applySimulation($simulation);
foreach ($config->getNode($name)->getPaths() as $path) {
$node = array_pop($path);
$renderer = new TileRenderer($config, $config->getNode($node));