fix(ui): Integrate webhooks panel into status panel
Build and Push Docker Image / build (push) Successful in 27s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 59s
CI / Security audit (push) Successful in 1m21s
CI / Tests & coverage (push) Successful in 1m35s
Build and Push Docker Image / build (push) Successful in 27s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 59s
CI / Security audit (push) Successful in 1m21s
CI / Tests & coverage (push) Successful in 1m35s
The webhooks panel was appearing separately from the status panel. Now it's properly nested inside the status-panel div: - Moved webhooks-section inside status-panel in HTML - Updated CSS so nested webhooks looks like a subsection (no double borders) - Simplified JS toggle logic - webhooks shows/hides automatically with status panel - Admin users see webhooks inside status panel, collapsed by default
This commit is contained in:
+5
-5
@@ -772,20 +772,22 @@ async function toggleStatusPanel() {
|
|||||||
const panel = document.getElementById('status-panel');
|
const panel = document.getElementById('status-panel');
|
||||||
const webhooksSection = document.getElementById('webhooks-section');
|
const webhooksSection = document.getElementById('webhooks-section');
|
||||||
if (panel.style.display !== 'none') {
|
if (panel.style.display !== 'none') {
|
||||||
|
// Close both panels (webhooks is nested, but hide explicitly)
|
||||||
panel.style.display = 'none';
|
panel.style.display = 'none';
|
||||||
if (webhooksSection) webhooksSection.style.display = 'none';
|
|
||||||
if (statusRefreshHandle) { clearInterval(statusRefreshHandle); statusRefreshHandle = null; }
|
if (statusRefreshHandle) { clearInterval(statusRefreshHandle); statusRefreshHandle = null; }
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Open status panel (contains webhooks nested inside)
|
||||||
panel.style.display = 'block';
|
panel.style.display = 'block';
|
||||||
// Show webhooks section for admin users (collapsed by default)
|
// Show webhooks section for admin users (collapsed by default)
|
||||||
if (webhooksSection && isAdmin) {
|
if (webhooksSection && isAdmin) {
|
||||||
webhooksSection.style.display = '';
|
webhooksSection.style.display = 'block';
|
||||||
// Ensure webhooks section starts collapsed
|
|
||||||
webhookSectionExpanded = false;
|
webhookSectionExpanded = false;
|
||||||
document.getElementById('webhooks-content').style.display = 'none';
|
document.getElementById('webhooks-content').style.display = 'none';
|
||||||
document.getElementById('webhooks-toggle').classList.remove('expanded');
|
document.getElementById('webhooks-toggle').classList.remove('expanded');
|
||||||
await fetchWebhookStatus();
|
await fetchWebhookStatus();
|
||||||
|
} else if (webhooksSection) {
|
||||||
|
webhooksSection.style.display = 'none';
|
||||||
}
|
}
|
||||||
await refreshStatusPanel();
|
await refreshStatusPanel();
|
||||||
if (statusRefreshHandle) clearInterval(statusRefreshHandle);
|
if (statusRefreshHandle) clearInterval(statusRefreshHandle);
|
||||||
@@ -794,8 +796,6 @@ async function toggleStatusPanel() {
|
|||||||
|
|
||||||
function closeStatusPanel() {
|
function closeStatusPanel() {
|
||||||
document.getElementById('status-panel').style.display = 'none';
|
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; }
|
if (statusRefreshHandle) { clearInterval(statusRefreshHandle); statusRefreshHandle = null; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -68,9 +68,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="status-panel" class="status-panel" style="display: none;"></div>
|
<div id="status-panel" class="status-panel" style="display: none;">
|
||||||
|
<!-- Webhooks Configuration Panel (nested inside status) -->
|
||||||
<!-- Webhooks Configuration Panel (inline with status) -->
|
|
||||||
<div class="webhooks-section" id="webhooks-section" style="display: none;">
|
<div class="webhooks-section" id="webhooks-section" style="display: none;">
|
||||||
<div class="webhooks-header" id="webhooks-header">
|
<div class="webhooks-header" id="webhooks-header">
|
||||||
<h2>⚡ Webhooks Configuration</h2>
|
<h2>⚡ Webhooks Configuration</h2>
|
||||||
@@ -128,6 +127,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div id="error-message" class="error-message" style="display: none;"></div>
|
<div id="error-message" class="error-message" style="display: none;"></div>
|
||||||
|
|
||||||
|
|||||||
@@ -1528,6 +1528,16 @@ body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* When nested inside status-panel, remove outer styling and look like a subsection */
|
||||||
|
.status-panel > .webhooks-section {
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
box-shadow: none;
|
||||||
|
margin-bottom: 0;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
}
|
||||||
|
|
||||||
.webhooks-header {
|
.webhooks-header {
|
||||||
padding: 16px 20px;
|
padding: 16px 20px;
|
||||||
background: var(--surface-alt);
|
background: var(--surface-alt);
|
||||||
|
|||||||
Reference in New Issue
Block a user