Feat: add SLM live monitoring improvements #60

Merged
serversdown merged 13 commits from feat/slm-live-monitor into dev 2026-06-10 16:33:26 -04:00
Showing only changes of commit e27aef33ac - Show all commits
+5 -3
View File
@@ -528,7 +528,7 @@ async function saveSLMSettings(event) {
if (typeof checkFTPStatus === 'function') { if (typeof checkFTPStatus === 'function') {
checkFTPStatus(unitId); checkFTPStatus(unitId);
} }
if (typeof htmx !== 'undefined') { if (typeof htmx !== 'undefined' && document.getElementById('slm-list')) {
htmx.trigger('#slm-list', 'load'); htmx.trigger('#slm-list', 'load');
} }
}, 1500); }, 1500);
@@ -604,8 +604,10 @@ async function toggleSLMDeployed() {
successDiv.classList.remove('hidden'); successDiv.classList.remove('hidden');
setTimeout(() => successDiv.classList.add('hidden'), 3000); setTimeout(() => successDiv.classList.add('hidden'), 3000);
// Refresh any SLM list on the page // Refresh any SLM list on the page (only if one is actually present —
if (typeof htmx !== 'undefined') { // the detail/dashboard pages have no #slm-list, and htmx.trigger on a
// null target throws "can't access property dispatchEvent, e is null").
if (typeof htmx !== 'undefined' && document.getElementById('slm-list')) {
htmx.trigger('#slm-list', 'load'); htmx.trigger('#slm-list', 'load');
} }
} catch (error) { } catch (error) {