update #6

Merged
iv3jdv merged 1 commits from develop into main 2026-10-17 18:36:47 +02:00
2 changed files with 13 additions and 2 deletions
Showing only changes of commit 3f59b905c7 - Show all commits
+1
View File
@@ -402,6 +402,7 @@ def on_message(client, userdata, msg):
"disk": round(data.get("disk_usage_percent", 0), 1), "disk": round(data.get("disk_usage_percent", 0), 1),
"processes": data.get("processes", {}), "processes": data.get("processes", {}),
"files": data.get("files", data.get("config_files", [])), "files": data.get("files", data.get("config_files", [])),
"file_names": data.get("file_names", []),
"profiles": data.get("profiles", {"A": "PROFILE A", "B": "PROFILE B"}), "profiles": data.get("profiles", {"A": "PROFILE A", "B": "PROFILE B"}),
"interval": data.get("update_interval") "interval": data.get("update_interval")
} }
+12 -2
View File
@@ -1178,10 +1178,20 @@
} }
// --- SERVICES & CONFIGS --- // --- SERVICES & CONFIGS ---
// Etichetta del file: nome in maiuscolo + estensione reale (es. DSTARGATEWAY.cfg); .ini solo come ripiego per agent vecchi
function fileLabel(stem, names) {
const key = String(stem).toLowerCase();
const full = (names || []).find(n => String(n).replace(/\.[^.]*$/, '').toLowerCase() === key);
if (full) {
const m = String(full).match(/^(.*?)(\.[^.]*)?$/);
return String(m[1]).toUpperCase() + (m[2] || '');
}
return String(stem).toUpperCase() + '.ini';
}
function openConfigsModal(clientId) { function openConfigsModal(clientId) {
const data = globalHealthData[clientId.toLowerCase()]; const listDiv = document.getElementById('configs-list'); let listaFile = data ? (data.config_files || data.files || []) : []; const data = globalHealthData[clientId.toLowerCase()]; const listDiv = document.getElementById('configs-list'); let listaFile = data ? (data.config_files || data.files || []) : []; const fileNames = (data && data.file_names) || [];
if (listaFile.length === 0) listDiv.innerHTML = `<div style="text-align:center; padding:20px;"><p style="color:var(--text-muted); margin-bottom:15px;">${t('waitData')}</p><button onclick="sendGlobalUpdate(); closeConfigsModal();" class="btn-cmd" style="background:var(--accent);">${t('forceUpdate')}</button></div>`; if (listaFile.length === 0) listDiv.innerHTML = `<div style="text-align:center; padding:20px;"><p style="color:var(--text-muted); margin-bottom:15px;">${t('waitData')}</p><button onclick="sendGlobalUpdate(); closeConfigsModal();" class="btn-cmd" style="background:var(--accent);">${t('forceUpdate')}</button></div>`;
else listDiv.innerHTML = listaFile.map(f => `<div style="display:flex; justify-content:space-between; align-items:center; padding:12px; background:rgba(128,128,128,0.1); border-radius:12px; border:1px solid var(--border-color); margin-bottom:8px;"><span style="font-family:'JetBrains Mono',monospace; font-weight:bold;">${esc(String(f).toUpperCase())}.ini</span><button onclick="closeConfigsModal(); openEditorModal(${q(clientId)}, ${q(f)})" class="btn-cmd" style="background:#8e44ad; max-width:120px;">${t('btnEdit')}</button></div>`).join(''); else listDiv.innerHTML = listaFile.map(f => `<div style="display:flex; justify-content:space-between; align-items:center; padding:12px; background:rgba(128,128,128,0.1); border-radius:12px; border:1px solid var(--border-color); margin-bottom:8px;"><span style="font-family:'JetBrains Mono',monospace; font-weight:bold;">${esc(fileLabel(f, fileNames))}</span><button onclick="closeConfigsModal(); openEditorModal(${q(clientId)}, ${q(f)})" class="btn-cmd" style="background:#8e44ad; max-width:120px;">${t('btnEdit')}</button></div>`).join('');
document.getElementById('configs-modal').style.display = 'flex'; document.getElementById('configs-modal').style.display = 'flex';
} }
function closeConfigsModal() { document.getElementById('configs-modal').style.display = 'none'; } function closeConfigsModal() { document.getElementById('configs-modal').style.display = 'none'; }