From 668985aff59c92c2dc94f49cb31cab2fb0cd22f9 Mon Sep 17 00:00:00 2001 From: Luigi D'Acunto Date: Wed, 1 Jul 2026 19:12:59 +0200 Subject: [PATCH] v2.15.2 - Fix: menu WATO assente su view.py senza sidebar quando non ci sono pending changes hasWatoAccess ora cerca qualsiasi link wato.py nel documento, non solo mode=changelog. I link mode=inventory iniettati dalla colonna Extra garantiscono la detection anche con pending changes vuoti. README: aggiunta tabella panoramica feature con nomi, descrizioni e funzioni. --- README.md | 15 +++++++++++++++ user_script/checkmk_swissknife.user.js | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b7dcd22..e244950 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,21 @@ A [Tampermonkey](https://www.tampermonkey.net/) userscript that enhances the Che ## Features +| Feature | Description | Code function | +|---------|-------------|---------------| +| **Folder Path Search** | Replaces the folder dropdown with a searchable overlay — type any path segment to filter instantly | `initSelect2Enhanced` | +| **Accordion Badge Counts** | Shows inline counters in each accordion header: enabled checkboxes (orange), inherited values (blue), differing values vs folder default (red) | `initAccordionCheckedCounts` | +| **Ineffective Rule Highlight** | Replaces the hard-to-spot hyphen icon on ineffective rules with a visible ⚠ badge and amber row border | `highlightIneffectiveRules` | +| **Rule Match Status** | Colors each rule row green (match) or dimmed (no match) when a ruleset is opened with host/service context | `highlightRuleMatchStatus` | +| **Relevant Only Filter** | Adds a "Relevant only" toggle above the rule list to hide all non-matching and non-highlighted rows | `addRulesetFilterToggle` | +| **Extra Column — Host Actions** | Inserts an Extra column in monitoring tables with per-host buttons: Service Discovery, copy FQDN, copy short hostname, copy IP | `addInventoryButtons` | +| **Monitor Button in WATO Folder** | Adds a green eye icon next to each active host in WATO folder listings to open its monitoring view in a new tab | `addWatoFolderMonitorButtons` | +| **Configure in WATO Menu** | Adds a host-selector dropdown and Open button to the monitoring view menu bar for bulk-opening hosts in WATO | `addViewWatoMenu` | +| **Auto-check Foreign Changes** | Automatically ticks the "Activate foreign changes" checkbox on the pending changes page | `tryAutoCheckForeignActivation` | +| **Collapse All / Expand All** | Adds two buttons to the menu bar to collapse or expand all accordion sections at once | `addAccordionToggleButtons` | + +--- + ### Folder Path Search Replaces the default WATO folder dropdown with a searchable overlay. Type any segment of the folder path to filter — separators `>`, `›`, and `/` are treated as equivalent. diff --git a/user_script/checkmk_swissknife.user.js b/user_script/checkmk_swissknife.user.js index 16a5f32..770334b 100644 --- a/user_script/checkmk_swissknife.user.js +++ b/user_script/checkmk_swissknife.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name Checkmk SwissKnife // @namespace https://luigidacunto.com/ -// @version 2.15.1 +// @version 2.15.2 // @checkmk 2.3.x // @description Collection of UI improvements for Checkmk WATO. Each fix or enhancement is added here as an independent feature. // @author Luigi D'Acunto @@ -1052,11 +1052,11 @@ const WATO_PAGE_SIZE = 50; // True if the current user has WATO access (admin/configuration role). - // With sidebar: the outer document has a wato.py link in the Setup navigation. - // Without sidebar: the "pending changes" shortcut only appears for WATO admins. + // With sidebar: outer document has wato.py links in Setup nav. + // Without sidebar: any wato.py link in the page suffices (incl. injected Extra column buttons). function hasWatoAccess(doc) { if (document !== doc && document.querySelector('a[href*="wato.py"]')) return true; - if (doc.querySelector('a[href*="wato.py"][href*="mode=changelog"]')) return true; + if (doc.querySelector('a[href*="wato.py"]')) return true; return false; }