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

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

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