Do not use StateBadge to construct affected children indicator

This commit is contained in:
raviks789 2024-10-15 12:47:49 +02:00
parent 2012b29e14
commit 98fc692c5f
No known key found for this signature in database
2 changed files with 9 additions and 5 deletions

View file

@ -10,10 +10,10 @@ use Icinga\Module\Icingadb\Util\PluginOutput;
use Icinga\Module\Icingadb\Widget\CheckAttempt;
use Icinga\Module\Icingadb\Widget\IconImage;
use Icinga\Module\Icingadb\Widget\PluginOutputContainer;
use ipl\Html\Attributes;
use ipl\Html\HtmlElement;
use ipl\Web\Common\BaseListItem;
use ipl\Web\Widget\EmptyState;
use ipl\Web\Widget\StateBadge;
use ipl\Web\Widget\TimeSince;
use ipl\Html\BaseHtmlElement;
use ipl\Html\Html;
@ -104,12 +104,15 @@ abstract class StateListItem extends BaseListItem
$icon = new Icon(Icons::UNREACHABLE);
$title->addHtml((new StateBadge([$icon, Text::create($total)], ''))
->addAttributes([
$title->addHtml(new HtmlElement(
'span',
Attributes::create([
'class' => 'affected-objects',
'title' => sprintf(t('Up to %s affected objects'), $total)
])
);
]),
$icon,
Text::create($total)
));
}
}

View file

@ -410,4 +410,5 @@ form[name="form_confirm_removal"] {
background-color: @state-critical;
color: @text-color-inverted;
padding: 0 0.25em;
.rounded-corners();
}