diff --git a/static/app.js b/static/app.js index 4d3f325..e3d6771 100644 --- a/static/app.js +++ b/static/app.js @@ -897,17 +897,14 @@ function initApp() { resultsContent.innerHTML = metadataHtml + gradeHtml + summaryHtml; - if (results.length === 0) { - resultsContent.innerHTML += ` -
-
- No Issues Found -
-

Great job! No issues found in the scanned infrastructure.

-
- `; - return; - } + // Determine which sections to show based on scanner_used + const scannerUsed = (summary && summary.scanner_used) ? summary.scanner_used : 'comprehensive'; + const isComprehensive = scannerUsed === 'comprehensive' || scannerUsed === 'both' || scannerUsed === 'all'; + const usedScanners = scannerUsed.split(',').map(s => s.trim()); + + const showCost = isComprehensive || usedScanners.includes('regex'); + const showIaC = isComprehensive || usedScanners.includes('checkov'); + const showContainers = isComprehensive || usedScanners.includes('containers'); // Group results by rule_id const groupedResults = groupByRule(results); @@ -925,31 +922,31 @@ function initApp() { let html = '
'; // Cost Column - if (costFindings.length > 0) { + if (showCost) { html += `

💰 Cost Optimization

- ${renderFindingsList(costFindings)} + ${costFindings.length > 0 ? renderFindingsList(costFindings) : '
✅ No cost issues found.
'}
`; } // IaC Security Column - if (iacSecurityFindings.length > 0) { + if (showIaC) { html += `

🔒 IaC Security

- ${renderFindingsList(iacSecurityFindings)} + ${iacSecurityFindings.length > 0 ? renderFindingsList(iacSecurityFindings) : '
✅ No IaC security issues found.
'}
`; } // Container Security Column - if (containerFindings.length > 0) { + if (showContainers) { html += `

🐳 Container Security

- ${renderContainerFindings(containerFindings)} + ${containerFindings.length > 0 ? renderContainerFindings(containerFindings) : '
✅ No container vulnerabilities found.
'}
`; } @@ -1317,7 +1314,7 @@ function initApp() { }; const renderGradeCard = (title, grade, icon) => { - if (!grade || grade.violations === 0) return ''; + if (!grade) return ''; // Context-aware label for violations let violationsLabel = 'Violations:'; diff --git a/static/style.css b/static/style.css index 28a921e..09c0c9c 100644 --- a/static/style.css +++ b/static/style.css @@ -704,6 +704,17 @@ input:checked+.slider:before { border-bottom-color: #3b82f6; } +.empty-state { + padding: 2rem; + text-align: center; + color: var(--text-muted); + font-size: 0.95rem; + background: rgba(255, 255, 255, 0.02); + border-radius: 0.5rem; + border: 1px dashed var(--border); + margin-top: 1rem; +} + @media (max-width: 1100px) { .results-grid-layout { grid-template-columns: 1fr;