fix(ui): Add status-content container to preserve webhooks panel
The webhooks panel was being destroyed when renderStatusPanel set panel.innerHTML. Added a dedicated #status-content div for status data, keeping webhooks section intact when status refreshes.
This commit is contained in:
+4
-2
@@ -920,9 +920,11 @@ function renderStatusPanel(data, panel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
html += `</tbody></table></div></div>`;
|
html += `</tbody></table></div></div>`;
|
||||||
panel.innerHTML = html;
|
// Render into status-content div, not the whole panel (preserves webhooks section)
|
||||||
|
const contentDiv = document.getElementById('status-content');
|
||||||
|
if (contentDiv) contentDiv.innerHTML = html;
|
||||||
// Wire close button — addEventListener avoids CSP inline handler restrictions
|
// Wire close button — addEventListener avoids CSP inline handler restrictions
|
||||||
const closeBtn = panel.querySelector('#status-close-btn');
|
const closeBtn = document.getElementById('status-close-btn');
|
||||||
if (closeBtn) closeBtn.addEventListener('click', closeStatusPanel);
|
if (closeBtn) closeBtn.addEventListener('click', closeStatusPanel);
|
||||||
// Set bar widths via JS DOM assignment — immune to CSP style-src restrictions
|
// Set bar widths via JS DOM assignment — immune to CSP style-src restrictions
|
||||||
panel.querySelectorAll('.timing-bar[data-w]').forEach(el => {
|
panel.querySelectorAll('.timing-bar[data-w]').forEach(el => {
|
||||||
|
|||||||
@@ -69,6 +69,8 @@
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="status-panel" class="status-panel" style="display: none;">
|
<div id="status-panel" class="status-panel" style="display: none;">
|
||||||
|
<!-- Status content gets rendered here -->
|
||||||
|
<div id="status-content"></div>
|
||||||
<!-- Webhooks Configuration Panel (nested inside status) -->
|
<!-- Webhooks Configuration Panel (nested inside 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">
|
||||||
|
|||||||
Reference in New Issue
Block a user