diff --git a/backend/app/static/css/styles.css b/backend/app/static/css/styles.css index b1c9f28..9850883 100644 --- a/backend/app/static/css/styles.css +++ b/backend/app/static/css/styles.css @@ -246,4 +246,15 @@ h1, h2, h3, h4, h5, h6 { .chart-container { height: 16rem; /* h-64 */ @apply w-full; +} + +/* Text status colors for compliance status */ +.text-success { + color: #16a34a; /* Green color for compliant status */ + font-weight: 500; +} + +.text-error { + color: #dc2626; /* Red color for non-compliant status */ + font-weight: 500; } \ No newline at end of file diff --git a/backend/app/static/js/dashboard.js b/backend/app/static/js/dashboard.js index 9eaf3f0..cc346d9 100644 --- a/backend/app/static/js/dashboard.js +++ b/backend/app/static/js/dashboard.js @@ -231,14 +231,23 @@ function renderRecentReports(reports, domains) { // Get domain name const domainName = domainMap.get(report.domain_id) || 'Unknown'; - row.innerHTML = ` - ${domainName} - ${formattedDate} - ${report.is_compliant ? - 'Compliant' : - 'Non-compliant' - } - `; + // Create domain cell with safe text content + const domainCell = document.createElement('td'); + domainCell.textContent = domainName; + row.appendChild(domainCell); + + // Create date cell with safe text content + const dateCell = document.createElement('td'); + dateCell.textContent = formattedDate; + row.appendChild(dateCell); + + // Create status cell with safe text content and CSS classes + const statusCell = document.createElement('td'); + const statusSpan = document.createElement('span'); + statusSpan.textContent = report.is_compliant ? 'Compliant' : 'Non-compliant'; + statusSpan.className = report.is_compliant ? 'text-success' : 'text-error'; + statusCell.appendChild(statusSpan); + row.appendChild(statusCell); tableBody.appendChild(row); }); diff --git a/backend/app/static/js/setup.js b/backend/app/static/js/setup.js index 1a3ed8a..2c641cb 100644 --- a/backend/app/static/js/setup.js +++ b/backend/app/static/js/setup.js @@ -184,9 +184,11 @@ function setupWizardEventListeners() { const cloudflareToken = document.getElementById('cloudflare-token').value; const cloudflareZone = document.getElementById('cloudflare-zone').value; + // Store only the flag that Cloudflare is enabled + // Credentials should be sent directly to backend, never stored client-side localStorage.setItem('setup_cloudflare_enabled', 'true'); - localStorage.setItem('setup_cloudflare_token', cloudflareToken); - localStorage.setItem('setup_cloudflare_zone', cloudflareZone); + // TODO: Send cloudflareToken and cloudflareZone to backend API instead of localStorage + // For now, these credentials are not persisted client-side for security } // Move to step 3