diff --git a/public/app.js b/public/app.js index 2aaa750..0b19aed 100644 --- a/public/app.js +++ b/public/app.js @@ -302,9 +302,7 @@ function showDashboard() { sp.style.display = 'none'; sp.innerHTML = ''; document.getElementById('admin-controls').style.display = isAdmin ? 'flex' : 'none'; - // Show webhooks section for admin users - const webhooksSection = document.getElementById('webhooks-section'); - if (webhooksSection) webhooksSection.style.display = isAdmin ? '' : 'none'; + // Note: webhooks-section visibility is controlled by toggleStatusPanel() // Initialise days input from saved value const daysInput = document.getElementById('history-days'); if (daysInput) daysInput.value = historyDays; @@ -772,12 +770,19 @@ const STATUS_REFRESH_MS = 5000; async function toggleStatusPanel() { const panel = document.getElementById('status-panel'); + const webhooksSection = document.getElementById('webhooks-section'); if (panel.style.display !== 'none') { panel.style.display = 'none'; + if (webhooksSection) webhooksSection.style.display = 'none'; if (statusRefreshHandle) { clearInterval(statusRefreshHandle); statusRefreshHandle = null; } return; } panel.style.display = 'block'; + // Show webhooks section for admin users + if (webhooksSection && isAdmin) { + webhooksSection.style.display = ''; + await fetchWebhookStatus(); + } await refreshStatusPanel(); if (statusRefreshHandle) clearInterval(statusRefreshHandle); statusRefreshHandle = setInterval(refreshStatusPanel, STATUS_REFRESH_MS); @@ -785,6 +790,8 @@ async function toggleStatusPanel() { function closeStatusPanel() { document.getElementById('status-panel').style.display = 'none'; + const webhooksSection = document.getElementById('webhooks-section'); + if (webhooksSection) webhooksSection.style.display = 'none'; if (statusRefreshHandle) { clearInterval(statusRefreshHandle); statusRefreshHandle = null; } } diff --git a/public/index.html b/public/index.html index 6c86399..93c89ff 100644 --- a/public/index.html +++ b/public/index.html @@ -70,51 +70,7 @@
- - - - -