mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-09 06:42:52 -05:00
Breadcrumb: Show a node's state
This commit is contained in:
parent
f93a480107
commit
670a29e5f7
2 changed files with 27 additions and 4 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Icinga\Module\Businessprocess\Renderer\TileRenderer;
|
||||
|
||||
use Icinga\Date\DateFormatter;
|
||||
use Icinga\Module\Businessprocess\BpNode;
|
||||
use Icinga\Module\Businessprocess\HostNode;
|
||||
use Icinga\Module\Businessprocess\ImportedNode;
|
||||
|
|
@ -9,6 +10,7 @@ use Icinga\Module\Businessprocess\MonitoredNode;
|
|||
use Icinga\Module\Businessprocess\Node;
|
||||
use Icinga\Module\Businessprocess\Renderer\Renderer;
|
||||
use Icinga\Module\Businessprocess\ServiceNode;
|
||||
use Icinga\Module\Businessprocess\Web\Component\StateBall;
|
||||
use Icinga\Web\Url;
|
||||
use ipl\Html\BaseHtmlElement;
|
||||
use ipl\Html\Html;
|
||||
|
|
@ -86,6 +88,16 @@ class NodeTile extends BaseHtmlElement
|
|||
}
|
||||
|
||||
$link = $this->getMainNodeLink();
|
||||
if ($renderer->isBreadcrumb()) {
|
||||
$link->prepend((new StateBall(strtolower($node->getStateName())))->addAttributes([
|
||||
'title' => sprintf(
|
||||
'%s %s',
|
||||
$node->getStateName(),
|
||||
DateFormatter::timeSince($node->getLastStateChange())
|
||||
)
|
||||
]));
|
||||
}
|
||||
|
||||
$this->add($link);
|
||||
|
||||
if ($node instanceof BpNode && !$renderer->isBreadcrumb()) {
|
||||
|
|
|
|||
|
|
@ -262,12 +262,12 @@ ul.bp {
|
|||
|
||||
li.process > div > .state-ball,
|
||||
li:not(.process) > .state-ball {
|
||||
border: .2em solid white;
|
||||
border: .15em solid white;
|
||||
|
||||
&.size-s {
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
line-height: 1.2em;
|
||||
width: 1.15em;
|
||||
height: 1.15em;
|
||||
line-height: 1.15em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -594,6 +594,17 @@ td > a > .badges {
|
|||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
> .state-ball {
|
||||
margin-right: .5em;
|
||||
border: .15em solid white;
|
||||
|
||||
&.size-s {
|
||||
width: 1.15em;
|
||||
height: 1.15em;
|
||||
line-height: 1.15em;
|
||||
}
|
||||
}
|
||||
}
|
||||
.breadcrumb li {
|
||||
border: 1px solid @gray-lighter;
|
||||
|
|
|
|||
Loading…
Reference in a new issue