Use the correct state-balls for critical/down-handled nodes in TreeRenderer::render()

Use the state-balls that are added for critical/down-handled nodes in TreeRenderer::render(), in case the nodes are critical/down and handled.
This commit is contained in:
Ravi Kumar Kempapura Srinivasa 2020-05-25 12:18:59 +02:00 committed by Eric Lippmann
parent b3686906a5
commit 49bc0dd363

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())
)
]);