Fix CSP violations and ignoreAvailable reference error
Build and Push Docker Image / build (push) Successful in 27s
Licence Check / Licence compatibility and copyright header verification (push) Failing after 40s
CI / Security audit (push) Successful in 54s
CI / Tests & coverage (push) Successful in 1m7s

- Add .hidden utility class to style.css for CSP compliance
- Replace all inline style='display: none' with class='hidden' in HTML
- Update all UI modules to use classList.add/remove instead of style.display
- Fix ignoreAvailable reference error in history.js (use state.ignoreAvailable)
- Rebuild client bundle with vite
This commit is contained in:
2026-05-21 00:33:57 +01:00
parent ddebe96056
commit f02c30efde
10 changed files with 163 additions and 90 deletions
+10 -10
View File
@@ -7,24 +7,24 @@ import { fetchWebhookStatus } from './webhooks.js';
export async function toggleStatusPanel() {
const panel = document.getElementById('status-panel');
const webhooksSection = document.getElementById('webhooks-section');
if (panel.style.display !== 'none') {
if (!panel.classList.contains('hidden')) {
// Close both panels (webhooks is a sibling, hide it too)
panel.style.display = 'none';
if (webhooksSection) webhooksSection.style.display = 'none';
panel.classList.add('hidden');
if (webhooksSection) webhooksSection.classList.add('hidden');
if (state.statusRefreshHandle) { clearInterval(state.statusRefreshHandle); state.statusRefreshHandle = null; }
return;
}
// Open status panel and webhooks section (siblings)
panel.style.display = 'block';
panel.classList.remove('hidden');
// Show webhooks section for admin users (collapsed by default)
if (webhooksSection && state.isAdmin) {
webhooksSection.style.display = 'block';
webhooksSection.classList.remove('hidden');
state.webhookSectionExpanded = false;
document.getElementById('webhooks-content').style.display = 'none';
document.getElementById('webhooks-content').classList.add('hidden');
document.getElementById('webhooks-toggle').classList.remove('expanded');
await fetchWebhookStatus();
} else if (webhooksSection) {
webhooksSection.style.display = 'none';
webhooksSection.classList.add('hidden');
}
refreshStatusPanel();
if (state.statusRefreshHandle) clearInterval(state.statusRefreshHandle);
@@ -32,9 +32,9 @@ export async function toggleStatusPanel() {
}
export function closeStatusPanel() {
document.getElementById('status-panel').style.display = 'none';
document.getElementById('status-panel').classList.add('hidden');
const webhooksSection = document.getElementById('webhooks-section');
if (webhooksSection) webhooksSection.style.display = 'none';
if (webhooksSection) webhooksSection.classList.add('hidden');
if (state.statusRefreshHandle) { clearInterval(state.statusRefreshHandle); state.statusRefreshHandle = null; }
}
@@ -42,7 +42,7 @@ export async function refreshStatusPanel() {
const panel = document.getElementById('status-panel');
const contentDiv = document.getElementById('status-content');
console.log('[Status] panel found:', !!panel, 'contentDiv found:', !!contentDiv, 'panel display:', panel?.style?.display);
if (!panel || panel.style.display === 'none') return;
if (!panel || panel.classList.contains('hidden')) return;
console.log('[Status] Refreshing status panel...');
try {
const result = await apiRefreshStatusPanel();