Compare commits
2 commits
9f964b0c7d
...
0fbfda4b81
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fbfda4b81 | |||
| 033bc1c482 |
3 changed files with 12 additions and 7 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,8 +1,9 @@
|
||||||
|
|
||||||
### My Personal test file for Dev only ###
|
|
||||||
/.*/
|
/.*/
|
||||||
/*.bat
|
/*.bat
|
||||||
/*.ps1
|
/*.ps1
|
||||||
|
/*.sh
|
||||||
/*.md
|
/*.md
|
||||||
|
|
||||||
|
!/.gitlab
|
||||||
!README.md
|
!README.md
|
||||||
!CHANGELOG.md
|
!CHANGELOG.md
|
||||||
|
|
@ -70,9 +70,9 @@ Applies to: `mode=edit_ruleset` with host/service context.
|
||||||
---
|
---
|
||||||
|
|
||||||
### Ruleset Filter Toggle
|
### Ruleset Filter Toggle
|
||||||
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.
|
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.
|
||||||
|
|
||||||
Applies to: `mode=edit_ruleset` (when at least one highlighted row exists).
|
Applies to: `mode=edit_ruleset` (when at least one `✓ match` or ineffective row exists).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
// ==UserScript==
|
// ==UserScript==
|
||||||
// @name Checkmk SwissKnife
|
// @name Checkmk SwissKnife
|
||||||
// @namespace https://luigidacunto.com/
|
// @namespace https://luigidacunto.com/
|
||||||
// @version 2.16.0
|
// @version 2.16.1
|
||||||
// @checkmk 2.3.x - 2.4.x
|
// @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.
|
// @description Collection of UI improvements for Checkmk WATO. Each fix or enhancement is added here as an independent feature.
|
||||||
// @author Luigi D'Acunto
|
// @author Luigi D'Acunto
|
||||||
|
|
@ -729,9 +729,9 @@
|
||||||
|
|
||||||
function addRulesetFilterToggle(doc) {
|
function addRulesetFilterToggle(doc) {
|
||||||
if (doc.body.dataset.cmkFilterToggle === '1') return;
|
if (doc.body.dataset.cmkFilterToggle === '1') return;
|
||||||
doc.body.dataset.cmkFilterToggle = '1';
|
|
||||||
|
|
||||||
const RELEVANT_SEL = 'tr.cmk-sk-rule-match, tr.cmk-sk-rule-nomatch, tr.cmk-sk-ineffective';
|
// 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';
|
||||||
|
|
||||||
// No highlighted rows = no active search, toggle is useless
|
// No highlighted rows = no active search, toggle is useless
|
||||||
const relevantCount = doc.querySelectorAll(RELEVANT_SEL).length;
|
const relevantCount = doc.querySelectorAll(RELEVANT_SEL).length;
|
||||||
|
|
@ -750,6 +750,10 @@
|
||||||
|
|
||||||
if (!irrelevantRows && !irrelevantFolders) return;
|
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', `
|
injectStyles(doc, 'cmk-sk-filter-toggle-styles', `
|
||||||
#cmk-sk-filter-bar {
|
#cmk-sk-filter-bar {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue