Skip to content

Commit a9ec1b7

Browse files
committed
Use class ìpl\Web\Widget\StateBadge
1 parent 2313103 commit a9ec1b7

File tree

6 files changed

+25
-145
lines changed

6 files changed

+25
-145
lines changed

configuration.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,3 @@
5959
$this->provideJsFile('vendor/Sortable.js');
6060
$this->provideJsFile('behavior/sortable.js');
6161
$this->provideJsFile('vendor/jquery.fn.sortable.js');
62-
63-
$this->provideCssFile('state-badge.less');
64-
$this->provideCssFile('state-badges.less');

library/Businessprocess/Renderer/Renderer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
use Icinga\Module\Businessprocess\MonitoredNode;
1010
use Icinga\Module\Businessprocess\Node;
1111
use Icinga\Module\Businessprocess\Web\Url;
12-
use Icinga\Module\Businessprocess\Widget\StateBadge;
1312
use ipl\Html\BaseHtmlElement;
1413
use ipl\Html\Html;
1514
use ipl\Html\HtmlDocument;
15+
use ipl\Web\Widget\StateBadge;
1616

1717
abstract class Renderer extends HtmlDocument
1818
{
@@ -181,7 +181,7 @@ public function renderStateBadges($summary, $totalChildren)
181181
protected function createBadge($summary, $state)
182182
{
183183
if ($summary[$state] !== 0) {
184-
return Html::tag('li', new StateBadge($summary[$state], $state));
184+
return Html::tag('li', new StateBadge($summary[$state], strtolower($state)));
185185
}
186186

187187
return null;
@@ -191,11 +191,11 @@ protected function createBadgeGroup($summary, $state)
191191
{
192192
$content = [];
193193
if ($summary[$state] !== 0) {
194-
$content[] = Html::tag('li', new StateBadge($summary[$state], $state));
194+
$content[] = Html::tag('li', new StateBadge($summary[$state], strtolower($state)));
195195
}
196196

197197
if ($summary[$state . '-HANDLED'] !== 0) {
198-
$content[] = Html::tag('li', new StateBadge($summary[$state . '-HANDLED'], $state, true));
198+
$content[] = Html::tag('li', new StateBadge($summary[$state . '-HANDLED'], strtolower($state), true));
199199
}
200200

201201
if (empty($content)) {

library/Businessprocess/Widget/StateBadge.php

Lines changed: 0 additions & 47 deletions
This file was deleted.

public/css/module.less

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,14 @@ ul.bp {
366366
// State summary badges
367367
.state-badges {
368368
.state-badges();
369+
370+
&.state-badges li > ul > li:last-child {
371+
margin-left: 0;
372+
}
373+
374+
li > ul > li:first-child:not(:last-child) .state-badge {
375+
border-right: 0;
376+
}
369377
}
370378

371379
// Node children count
@@ -384,10 +392,20 @@ td > a > .state-badges {
384392
background-color: transparent;
385393
}
386394

387-
.state-badge.state-missing {
388-
background: @gray-semilight;
389-
color: @text-color-on-icinga-blue;
395+
.state-badge {
396+
font-size: .8em;
397+
border: 1px solid @body-bg-color;
398+
399+
&.state-missing {
400+
background: @gray-semilight;
401+
color: @text-color-on-icinga-blue;
402+
}
403+
404+
&.state-critical.handled, &.state-down.handled { background: @color-critical-handled; opacity: 1; }
405+
&.state-unknown.handled { background-color: @color-unknown-handled; opacity: 1; }
406+
&.state-warning.handled { background: @color-warning-handled; opacity: 1; }
390407
}
408+
391409
/** END Badges **/
392410

393411
/** BEGIN Tiles **/

public/css/state-badge.less

Lines changed: 0 additions & 60 deletions
This file was deleted.

public/css/state-badges.less

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)