Compare commits
No commits in common. "f97ea33ba863178f0b7023658d6c2eca2c0ba24e" and "9cf6d8af97d9d9bef6d57d2a1a5605cf1764e1a7" have entirely different histories.
f97ea33ba8
...
9cf6d8af97
1 changed files with 25 additions and 30 deletions
|
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name Checkmk SwissKnife
|
||||
// @namespace https://luigidacunto.com/
|
||||
// @version 2.9.9
|
||||
// @version 2.9.5
|
||||
// @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
|
||||
|
|
@ -827,39 +827,34 @@
|
|||
vertical-align: middle;
|
||||
}
|
||||
.cmk-sk-inv-btn, .cmk-sk-copy-btn, .cmk-sk-copy-short-btn {
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
width: 16px !important;
|
||||
height: 16px !important;
|
||||
border-radius: 3px !important;
|
||||
cursor: pointer !important;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
opacity: 0.8;
|
||||
flex-shrink: 0;
|
||||
padding: 0 !important;
|
||||
margin: 1px !important;
|
||||
box-sizing: border-box !important;
|
||||
padding: 0;
|
||||
text-decoration: none !important;
|
||||
font-size: 0 !important;
|
||||
line-height: 0 !important;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
.cmk-sk-inv-btn {
|
||||
background: rgba(229,165,0,0.08) !important;
|
||||
.cmk-sk-inv-btn, .cmk-sk-inv-btn:visited {
|
||||
background: rgba(229,165,0,0.08);
|
||||
color: #e5a500 !important;
|
||||
border: 1px solid #e5a500 !important;
|
||||
border: 1px solid #e5a500;
|
||||
}
|
||||
.cmk-sk-inv-btn:hover { opacity: 1 !important; background: rgba(229,165,0,0.18) !important; }
|
||||
.cmk-sk-inv-btn:hover { opacity: 1; background: rgba(229,165,0,0.18) !important; }
|
||||
.cmk-sk-copy-btn {
|
||||
background: rgba(90,180,214,0.08) !important;
|
||||
background: rgba(90,180,214,0.08);
|
||||
color: #5ab4d6 !important;
|
||||
border: 1px solid #5ab4d6 !important;
|
||||
border: 1px solid #5ab4d6;
|
||||
}
|
||||
.cmk-sk-copy-btn:hover { opacity: 1; background: rgba(90,180,214,0.18) !important; }
|
||||
.cmk-sk-copy-short-btn {
|
||||
background: rgba(160,120,200,0.08) !important;
|
||||
background: rgba(160,120,200,0.08);
|
||||
color: #a078c8 !important;
|
||||
border: 1px solid #a078c8 !important;
|
||||
border: 1px solid #a078c8;
|
||||
}
|
||||
.cmk-sk-copy-short-btn:hover { opacity: 1; background: rgba(160,120,200,0.18) !important; }
|
||||
.cmk-sk-copy-btn.copied, .cmk-sk-copy-short-btn.copied {
|
||||
|
|
@ -874,23 +869,23 @@
|
|||
const CLIP_SVG = '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>';
|
||||
|
||||
hostCells.forEach(td => {
|
||||
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; }
|
||||
}
|
||||
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');
|
||||
if (!hostname) return;
|
||||
const shortname = hostname.split('.')[0];
|
||||
|
||||
const group = doc.createElement('span');
|
||||
group.className = 'cmk-sk-btn-group';
|
||||
|
||||
const btn = doc.createElement('button');
|
||||
const btn = doc.createElement('a');
|
||||
btn.className = 'cmk-sk-inv-btn';
|
||||
btn.type = 'button';
|
||||
btn.href = `wato.py?host=${encodeURIComponent(hostname)}&mode=inventory`;
|
||||
btn.target = '_blank';
|
||||
btn.rel = 'noopener';
|
||||
btn.title = `Service Discovery: ${hostname}`;
|
||||
btn.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/><polyline points="6 9 9 12 14 7" stroke-width="2"/></svg>';
|
||||
btn.addEventListener('click', () => { window.open(`wato.py?host=${encodeURIComponent(hostname)}&mode=inventory`, '_blank', 'noopener'); });
|
||||
|
||||
const copyBtn = doc.createElement('button');
|
||||
copyBtn.className = 'cmk-sk-copy-btn';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue