Fix UNKNOWN state color in service name tint

The service name tint shown when hiding the State column used a
generic color palette instead of Checkmk's own state colors, showing
UNKNOWN as purple instead of orange. Now matches the native
.state_rounded_fill colors exactly.
This commit is contained in:
Luigi D'Acunto 2026-09-23 18:02:26 +02:00
parent 4e574565ee
commit 728d5cc8b5
3 changed files with 10 additions and 3 deletions

View file

@ -5,6 +5,11 @@ All notable changes to **Checkmk SwissKnife** are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.22.2] - 2026-09-23
### Fixed
- The service name tint applied when hiding the State column now uses Checkmk's actual state colors (green/yellow/red/orange for OK/WARN/CRIT/UNKNOWN) instead of a generic palette — UNKNOWN was showing as purple instead of the native orange.
## [2.22.1] - 2026-09-23
### Added

View file

@ -190,7 +190,7 @@ Applies to: any `view.py` page listing hosts (with or without sidebar).
### Column Visibility Toggle
Adds a **"Columns"** dropdown to the menu bar on any monitoring view table. Each entry hides/shows one native Checkmk column — State, Site alias, Host icons, Service icons, Age, Checked, Check command, Groups (service + host) — found by its header text, so it works on any view without being tied to one specific one. Only the columns actually present on the current view are listed, each with its own **ON/OFF** button so it's always clear at a glance what's currently shown, plus **"Show all"**/**"Hide all"** shortcuts at the top of the panel to reset everything in one click. Purely visual (CSS only, never touches form/checkbox state), and the choice is saved so it applies the same way to every monitoring view you open afterwards.
Hiding the **State** column also tints the service name itself with that row's state color (green OK, amber WARN, red CRIT, purple UNKNOWN), so problems stay identifiable at a glance without the column taking up space.
Hiding the **State** column also tints the service name itself with that row's state color (Checkmk's own colors: green OK, yellow WARN, red CRIT, orange UNKNOWN), so problems stay identifiable at a glance without the column taking up space.
Applies to: any `view.py` page with a data table (with or without sidebar).

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Checkmk SwissKnife
// @namespace https://luigidacunto.com/
// @version 2.22.1
// @version 2.22.2
// @checkmk 2.3.x - 2.4.x
// @description Collection of UI improvements for Checkmk WATO. Each fix or enhancement is added here as an independent feature.
// @author Luigi D'Acunto
@ -1134,7 +1134,9 @@
localStorage.setItem(COLUMN_VIS_STORAGE_KEY, JSON.stringify([...set]));
}
const STATE_COLORS = { '0': '#4caf50', '1': '#e5a500', '2': '#e55b5b', '3': '#a078c8' };
// Matches Checkmk's own state colors (.state_rounded_fill.state<N>), not an
// arbitrary palette, so the tint reads the same as the native badge would.
const STATE_COLORS = { '0': '#13d389', '1': '#ffd703', '2': '#c83232', '3': '#ff8400' };
// Whenever the State column is hidden (via the Columns dropdown, in any
// combination — no separate "Clean view" mode needed), the Service name is