Skip to content

Commit

Permalink
Merge pull request #282 from Icinga/fix/handled-node-rendering
Browse files Browse the repository at this point in the history
Fix rendering of state-balls for critical-handled nodes
  • Loading branch information
lippserd authored May 27, 2020
2 parents 5037d8f + 49bc0dd commit 346ace7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
8 changes: 6 additions & 2 deletions library/Businessprocess/Renderer/TileRenderer/NodeTile.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,14 @@ public function render()
if (! $node instanceof ImportedNode || $node->getBpConfig()->hasNode($node->getName())) {
$link = $this->getMainNodeLink();
if ($renderer->isBreadcrumb()) {
$link->prepend((new StateBall(strtolower($node->getStateName())))->addAttributes([
$state = strtolower($node->getStateName());
if ($node->isHandled()) {
$state = $state . '-handled';
}
$link->prepend((new StateBall($state))->addAttributes([
'title' => sprintf(
'%s %s',
$node->getStateName(),
$state,
DateFormatter::timeSince($node->getLastStateChange())
)
]));
Expand Down
8 changes: 6 additions & 2 deletions library/Businessprocess/Renderer/TreeRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ public function getNodeIcons(Node $node, array $path = null)
} else {
$icons[] = $node->getIcon();
}
$icons[] = (new StateBall(strtolower($node->getStateName())))->addAttributes([
$state = strtolower($node->getStateName());
if ($node->isHandled()) {
$state = $state . '-handled';
}
$icons[] = (new StateBall($state))->addAttributes([
'title' => sprintf(
'%s %s',
$node->getStateName(),
$state,
DateFormatter::timeSince($node->getLastStateChange())
)
]);
Expand Down
8 changes: 8 additions & 0 deletions public/css/state-ball.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@
background-color: @gray-light;
}

&.state-critical-handled {
background-color: @color-critical-handled;
}

&.state-down-handled {
background-color: @color-critical-handled;
}

&.size-xs {
line-height: 0.75em;
height: 0.75em;
Expand Down

0 comments on commit 346ace7

Please sign in to comment.