Fix edit monitor modal JS error by restoring monEditType and adding null-safe setVal, and fix SVG icons 404 with root .htaccess rewrite rule for /assets/
This commit is contained in:
+32
-13
@@ -981,6 +981,16 @@ $baseUrl = $protocol . '://' . $host;
|
||||
<input type="url" name="url" id="monEditUrl" class="form-input" placeholder="https://...">
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom:1rem;">
|
||||
<label class="form-label">Typ</label>
|
||||
<select name="type" id="monEditType" class="form-input">
|
||||
<option value="host">Host / Server (Windows / Linux)</option>
|
||||
<option value="heartbeat">Dienst / Worker (Heartbeat)</option>
|
||||
<option value="hypervisor_node">Hypervisor Node (Proxmox)</option>
|
||||
<option value="guest">Guest VM / Container</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom:1rem;">
|
||||
<label class="form-label">Übergeordneter Host / Hypervisor (Parent)</label>
|
||||
<select name="parent_source" id="monEditParent" class="form-input">
|
||||
@@ -1846,21 +1856,28 @@ $baseUrl = $protocol . '://' . $host;
|
||||
document.getElementById('monEditIconSelected').value = iconVal;
|
||||
}
|
||||
|
||||
// Rich Monitor Editing Modal Functions (Screenshot 1)
|
||||
// Rich Monitor Editing Modal Functions (Screenshot 1 - Null-safe)
|
||||
function openEditMonitorModal(m) {
|
||||
document.getElementById('monEditOldSource').value = m.source;
|
||||
document.getElementById('monEditNewSource').value = m.source;
|
||||
document.getElementById('monEditType').value = m.type || 'host';
|
||||
document.getElementById('monEditParent').value = m.parent_source || '';
|
||||
document.getElementById('monEditGroup').value = m.group_key || 'Applications';
|
||||
document.getElementById('monEditInterval').value = m.expected_interval_sec || 60;
|
||||
document.getElementById('monEditNotes').value = m.notes || '';
|
||||
document.getElementById('monEditUrl').value = m.url || '';
|
||||
document.getElementById('monEditMuted').checked = parseInt(m.is_muted) === 1;
|
||||
const setVal = (id, val) => {
|
||||
const el = document.getElementById(id);
|
||||
if (el) el.value = val;
|
||||
};
|
||||
|
||||
setVal('monEditOldSource', m.source || '');
|
||||
setVal('monEditNewSource', m.source || '');
|
||||
setVal('monEditType', m.type || 'host');
|
||||
setVal('monEditParent', m.parent_source || '');
|
||||
setVal('monEditGroup', m.group_key || 'Applications');
|
||||
setVal('monEditInterval', m.expected_interval_sec || 60);
|
||||
setVal('monEditNotes', m.notes || '');
|
||||
setVal('monEditUrl', m.url || '');
|
||||
|
||||
const mutedEl = document.getElementById('monEditMuted');
|
||||
if (mutedEl) mutedEl.checked = parseInt(m.is_muted) === 1;
|
||||
|
||||
// Highlight selected icon preset or auto
|
||||
const iconVal = m.icon || '';
|
||||
document.getElementById('monEditIconSelected').value = iconVal;
|
||||
setVal('monEditIconSelected', iconVal);
|
||||
document.querySelectorAll('.icon-option-btn').forEach(b => {
|
||||
b.classList.remove('selected');
|
||||
if (b.getAttribute('data-icon') === iconVal) {
|
||||
@@ -1868,11 +1885,13 @@ $baseUrl = $protocol . '://' . $host;
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById('editMonitorModal').classList.add('active');
|
||||
const modal = document.getElementById('editMonitorModal');
|
||||
if (modal) modal.classList.add('active');
|
||||
}
|
||||
|
||||
function closeEditMonitorModal() {
|
||||
document.getElementById('editMonitorModal').classList.remove('active');
|
||||
const modal = document.getElementById('editMonitorModal');
|
||||
if (modal) modal.classList.remove('active');
|
||||
}
|
||||
|
||||
function triggerDeleteMonitorFromModal() {
|
||||
|
||||
Reference in New Issue
Block a user