Compare commits

..

No commits in common. "0fbfda4b815d4726350d383f57e12bca38af1ee5" and "9f964b0c7d9afa301cb835b2746082827f98ed30" have entirely different histories.

3 changed files with 7 additions and 12 deletions

5
.gitignore vendored
View file

@ -1,9 +1,8 @@
### My Personal test file for Dev only ###
/.*/
/*.bat
/*.ps1
/*.sh
/*.md
!/.gitlab
!README.md
!CHANGELOG.md

View file

@ -70,9 +70,9 @@ Applies to: `mode=edit_ruleset` with host/service context.
---
### Ruleset Filter Toggle
After match/ineffective highlighting runs, a **"Relevant only"** button appears above the rule list. Clicking it hides all `✗ no match` rows, non-highlighted rows and empty folders, leaving only the matching (or ineffective) rules for the current context.
After match/ineffective highlighting runs, a **"Relevant only"** button appears above the rule list. Clicking it hides all non-highlighted rows and empty folders, leaving only the rules that matter for the current context.
Applies to: `mode=edit_ruleset` (when at least one `✓ match` or ineffective row exists).
Applies to: `mode=edit_ruleset` (when at least one highlighted row exists).
---

View file

@ -1,7 +1,7 @@
// ==UserScript==
// @name Checkmk SwissKnife
// @namespace https://luigidacunto.com/
// @version 2.16.1
// @version 2.16.0
// @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
@ -729,9 +729,9 @@
function addRulesetFilterToggle(doc) {
if (doc.body.dataset.cmkFilterToggle === '1') return;
doc.body.dataset.cmkFilterToggle = '1';
// Le righe "no match" NON sono rilevanti: il filtro serve proprio a nasconderle
const RELEVANT_SEL = 'tr.cmk-sk-rule-match, tr.cmk-sk-ineffective';
const RELEVANT_SEL = 'tr.cmk-sk-rule-match, tr.cmk-sk-rule-nomatch, tr.cmk-sk-ineffective';
// No highlighted rows = no active search, toggle is useless
const relevantCount = doc.querySelectorAll(RELEVANT_SEL).length;
@ -750,10 +750,6 @@
if (!irrelevantRows && !irrelevantFolders) return;
// Guard settato solo qui: se la tabella non era ancora renderizzata
// il prossimo tentativo deve poter riprovare
doc.body.dataset.cmkFilterToggle = '1';
injectStyles(doc, 'cmk-sk-filter-toggle-styles', `
#cmk-sk-filter-bar {
display: flex;