Merge pull request #282 from Icinga/fix/handled-node-rendering

Fix rendering of state-balls for critical-handled nodes
This commit is contained in:
Eric Lippmann 2020-05-27 08:25:47 +02:00 committed by GitHub
commit 346ace79d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View file

@ -88,10 +88,14 @@ class NodeTile extends BaseHtmlElement
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())
)
]));

View file

@ -116,10 +116,14 @@ class TreeRenderer extends Renderer
} 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())
)
]);

View file

@ -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;