Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 15 additions & 18 deletions static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -897,17 +897,14 @@ function initApp() {

resultsContent.innerHTML = metadataHtml + gradeHtml + summaryHtml;

if (results.length === 0) {
resultsContent.innerHTML += `
<div class="finding-card" style="border-left-color: var(--success)">
<div class="finding-header">
<span class="finding-title">No Issues Found</span>
</div>
<p>Great job! No issues found in the scanned infrastructure.</p>
</div>
`;
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);
Expand All @@ -925,31 +922,31 @@ function initApp() {
let html = '<div class="results-grid-layout">';

// Cost Column
if (costFindings.length > 0) {
if (showCost) {
html += `
<div class="results-column">
<h3 class="column-title cost">💰 Cost Optimization</h3>
${renderFindingsList(costFindings)}
${costFindings.length > 0 ? renderFindingsList(costFindings) : '<div class="empty-state">✅ No cost issues found.</div>'}
</div>
`;
}

// IaC Security Column
if (iacSecurityFindings.length > 0) {
if (showIaC) {
html += `
<div class="results-column">
<h3 class="column-title security">🔒 IaC Security</h3>
${renderFindingsList(iacSecurityFindings)}
${iacSecurityFindings.length > 0 ? renderFindingsList(iacSecurityFindings) : '<div class="empty-state">✅ No IaC security issues found.</div>'}
</div>
`;
}

// Container Security Column
if (containerFindings.length > 0) {
if (showContainers) {
html += `
<div class="results-column">
<h3 class="column-title security">🐳 Container Security</h3>
${renderContainerFindings(containerFindings)}
${containerFindings.length > 0 ? renderContainerFindings(containerFindings) : '<div class="empty-state">✅ No container vulnerabilities found.</div>'}
</div>
`;
}
Expand Down Expand Up @@ -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:';
Expand Down
11 changes: 11 additions & 0 deletions static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading