From 1baafc33d0c8a2b7628eb9955b35631c1df28f9e Mon Sep 17 00:00:00 2001 From: Fabian Salomon <4098510+fsalomon@users.noreply.github.com> Date: Mon, 27 Apr 2026 11:05:13 +0200 Subject: [PATCH] Use sr-only to hide state labels visually --- library/Icingadb/Util/PluginOutput.php | 14 ++++++------- public/css/common.less | 6 ------ .../Icingadb/Util/PluginOutputTest.php | 20 +++++++++---------- 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/library/Icingadb/Util/PluginOutput.php b/library/Icingadb/Util/PluginOutput.php index 782d1a41..d66e35f5 100644 --- a/library/Icingadb/Util/PluginOutput.php +++ b/library/Icingadb/Util/PluginOutput.php @@ -34,13 +34,13 @@ class PluginOutput extends HtmlString protected const TEXT_REPLACEMENTS = [ "\t", "\n", - '[OK]', - '[WARNING]', - '[CRITICAL]', - '[UNKNOWN]', - '[UP]', - '[DOWN]', - '[INFO]', + '[OK]', + '[WARNING]', + '[CRITICAL]', + '[UNKNOWN]', + '[UP]', + '[DOWN]', + '[INFO]', '@@@@@@' ]; diff --git a/public/css/common.less b/public/css/common.less index d8d9a483..1bb85b0d 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -13,12 +13,6 @@ .plugin-output { .monospace(); word-break: break-word; - - .state-ball { - color: transparent; - overflow: hidden; - white-space: nowrap; - } } div.show-more { diff --git a/test/php/library/Icingadb/Util/PluginOutputTest.php b/test/php/library/Icingadb/Util/PluginOutputTest.php index 9d7aeaf8..f8eac877 100644 --- a/test/php/library/Icingadb/Util/PluginOutputTest.php +++ b/test/php/library/Icingadb/Util/PluginOutputTest.php @@ -38,9 +38,9 @@ class PluginOutputTest extends TestCase INPUT; $expectedOutput = <<<'EXPECTED_OUTPUT' -[OK] Dummy state - \_ [OK] Fake "state" - \_ [WARNING] Fake state again +[OK] Dummy state + \_ [OK] Fake "state" + \_ [WARNING] Fake state again EXPECTED_OUTPUT; $this->checkOutput($expectedOutput, $input); @@ -55,7 +55,7 @@ EXPECTED_OUTPUT; INPUT; $expectedOutput = <<<'EXPECTED_OUTPUT' -[OK] Dummy +[OK] Dummy EXPECTED_OUTPUT; $this->checkOutput($expectedOutput, $input, 10); @@ -86,9 +86,9 @@ INPUT; $expectedOutput = <<<'EXPECTED_OUTPUT' Hello

World

, this "is" a test. -[OK] Dummy state - \_ [OK] Fake "state" - \_ [WARNING] Fake state again +[OK] Dummy state + \_ [OK] Fake "state" + \_ [WARNING] Fake state again text ends here EXPECTED_OUTPUT; @@ -106,7 +106,7 @@ INPUT; $expectedOutput = <<<'EXPECTED_OUTPUT' Hello

World

, this "is" a test. -[OK] Dummy state +[OK] Dummy state special chars: !@#$%^&*()_+{}|:"<>?`-=[]\;',​./ text ends here EXPECTED_OUTPUT; @@ -150,7 +150,7 @@ EXPECTED_OUTPUT; $input = sprintf('[%s] Test', $s); $expectedOutput = sprintf( - '[%s] Test', + '[%s] Test', $l, $s ); @@ -172,7 +172,7 @@ EXPECTED_OUTPUT; $input = sprintf('%s [%s] Test', $dummyHtml, $s); $expectedOutput = sprintf( - '%s [%s] Test', + '%s [%s] Test', $dummyHtml, $l, $s