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:
Deploymentcenter Bot
2026-08-05 23:09:15 +02:00
parent 5dcfa3a6fe
commit e9dbe793e2
2 changed files with 35 additions and 13 deletions
+3
View File
@@ -1,6 +1,9 @@
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine On
# Route /assets/ requests to public/assets/
RewriteRule ^assets/(.*)$ public/assets/$1 [L,QSA]
# Module API routing # Module API routing
RewriteRule ^api/license/v1(?:/(.*))?$ public/api/license/v1/index.php [L,QSA] RewriteRule ^api/license/v1(?:/(.*))?$ public/api/license/v1/index.php [L,QSA]
RewriteRule ^api/watchdog/v1(?:/(.*))?$ public/api/watchdog/v1/index.php [L,QSA] RewriteRule ^api/watchdog/v1(?:/(.*))?$ public/api/watchdog/v1/index.php [L,QSA]
+32 -13
View File
@@ -981,6 +981,16 @@ $baseUrl = $protocol . '://' . $host;
<input type="url" name="url" id="monEditUrl" class="form-input" placeholder="https://..."> <input type="url" name="url" id="monEditUrl" class="form-input" placeholder="https://...">
</div> </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;"> <div class="form-group" style="margin-bottom:1rem;">
<label class="form-label">Übergeordneter Host / Hypervisor (Parent)</label> <label class="form-label">Übergeordneter Host / Hypervisor (Parent)</label>
<select name="parent_source" id="monEditParent" class="form-input"> <select name="parent_source" id="monEditParent" class="form-input">
@@ -1846,21 +1856,28 @@ $baseUrl = $protocol . '://' . $host;
document.getElementById('monEditIconSelected').value = iconVal; document.getElementById('monEditIconSelected').value = iconVal;
} }
// Rich Monitor Editing Modal Functions (Screenshot 1) // Rich Monitor Editing Modal Functions (Screenshot 1 - Null-safe)
function openEditMonitorModal(m) { function openEditMonitorModal(m) {
document.getElementById('monEditOldSource').value = m.source; const setVal = (id, val) => {
document.getElementById('monEditNewSource').value = m.source; const el = document.getElementById(id);
document.getElementById('monEditType').value = m.type || 'host'; if (el) el.value = val;
document.getElementById('monEditParent').value = m.parent_source || ''; };
document.getElementById('monEditGroup').value = m.group_key || 'Applications';
document.getElementById('monEditInterval').value = m.expected_interval_sec || 60; setVal('monEditOldSource', m.source || '');
document.getElementById('monEditNotes').value = m.notes || ''; setVal('monEditNewSource', m.source || '');
document.getElementById('monEditUrl').value = m.url || ''; setVal('monEditType', m.type || 'host');
document.getElementById('monEditMuted').checked = parseInt(m.is_muted) === 1; 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 // Highlight selected icon preset or auto
const iconVal = m.icon || ''; const iconVal = m.icon || '';
document.getElementById('monEditIconSelected').value = iconVal; setVal('monEditIconSelected', iconVal);
document.querySelectorAll('.icon-option-btn').forEach(b => { document.querySelectorAll('.icon-option-btn').forEach(b => {
b.classList.remove('selected'); b.classList.remove('selected');
if (b.getAttribute('data-icon') === iconVal) { 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() { function closeEditMonitorModal() {
document.getElementById('editMonitorModal').classList.remove('active'); const modal = document.getElementById('editMonitorModal');
if (modal) modal.classList.remove('active');
} }
function triggerDeleteMonitorFromModal() { function triggerDeleteMonitorFromModal() {