refactor(webhooks): Integrate webhooks panel into status card
All checks were successful
Build and Push Docker Image / build (push) Successful in 41s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 59s
CI / Security audit (push) Successful in 1m20s
CI / Tests & coverage (push) Successful in 1m33s

- Moved webhooks-section to be inline with status-panel in HTML
- Updated toggleStatusPanel() to show/hide webhooks section for admin users
- Updated closeStatusPanel() to also hide webhooks section
- Removed webhooks visibility from showDashboard() - now tied to status panel
- Updated CSS to make webhooks section styling consistent with status panel:
  - Same border, border-radius, margin, box-shadow
  - Updated webhook-stats to use status-card styling (background, border)
- Webhooks metrics now display inline with status panel for admin users
This commit is contained in:
2026-05-19 21:20:34 +01:00
parent 3ef35a8c43
commit aeacadbe68
3 changed files with 69 additions and 58 deletions

View File

@@ -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; }
}