diff --git a/user_script/checkmk_swissknife.user.js b/user_script/checkmk_swissknife.user.js index 9b6e9e8..04a4a4a 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.9.8 +// @version 2.9.9 // @description Raccolta di miglioramenti all'interfaccia di Checkmk WATO. Ogni fix o enhancement viene aggiunto qui come feature indipendente. // @author Luigi D'Acunto // @homepageURL https://git.luigidacunto.com/tools/checkmk-swissknife @@ -874,10 +874,11 @@ const CLIP_SVG = ''; hostCells.forEach(td => { - const link = td.querySelector('a[href*="view_name=hoststatus"]'); - if (!link) return; - const params = new URLSearchParams(link.getAttribute('href').split('?')[1] || ''); - const hostname = params.get('host'); + let hostname = null; + for (const a of td.querySelectorAll('a[href*="host="]')) { + const h = new URLSearchParams(a.getAttribute('href').split('?')[1] || '').get('host'); + if (h) { hostname = h; break; } + } if (!hostname) return; const shortname = hostname.split('.')[0];