// HomePage.jsx — full-page assembly of the CVE Dashboard Home view. // Rebuilt 1:1 from frontend/src/App.js (currentPage === 'home'). // // Layout: top stat row (4 metric cards) → 12-col grid below // • col-span-9 (left): Quick CVE Lookup → Search/Filter → CVE list // • col-span-3 (right): Calendar → Open Tickets → Archer → Ivanti const { COLORS: HC, StatCard, HomeCard, CardTitle, HomeButton, SeverityBadge, StatusBadge, HomeInput, HomeSelect, FieldLabel, ResultBanner, BigStat, MiniTicket, CVERow, VendorEntry, HomeIcon: HI, CalendarMini, ArchiveSummary, ScrollList, EmptyState, withAlpha: hAlpha, } = window.HOME; const { useState: useHomePageState } = React; /* ── Sample data — close to what App.js renders against ──────── */ const SAMPLE_CVES = [ { id: 'CVE-2025-1014', severity: 'Critical', description: 'Heap-based buffer overflow in the libnetfilter_queue user-space packet handler permits a remote attacker to execute arbitrary code via crafted ICMP traffic.', statuses: ['Open', 'In Progress'], vendors: [ { vendor: 'Red Hat', severity: 'Critical', status: 'Open', docCount: 4 }, { vendor: 'Ubuntu', severity: 'Critical', status: 'In Progress', docCount: 2 }, { vendor: 'SUSE', severity: 'High', status: 'Resolved', docCount: 3 }, ], tickets: [ { key: 'SEC-4821', summary: 'Patch netfilter on prod ingress fleet', status: 'In Progress' }, ], }, { id: 'CVE-2025-0944', severity: 'High', description: 'Authentication bypass in admin console allows unauthenticated access to telemetry exports.', statuses: ['Addressed'], vendors: [ { vendor: 'Cisco', severity: 'High', status: 'Addressed', docCount: 2 }, ], }, { id: 'CVE-2024-9912', severity: 'Medium', description: 'Improper cert validation in the JIRA Server REST client could lead to MITM under attacker-controlled DNS.', statuses: ['Resolved'], vendors: [ { vendor: 'Atlassian', severity: 'Medium', status: 'Resolved', docCount: 1 }, ], }, ]; const SAMPLE_OPEN_TICKETS = [ { key: 'SEC-4821', cveId: 'CVE-2025-1014', vendor: 'Red Hat', status: 'In Progress', summary: 'Patch netfilter ingress' }, { key: 'SEC-4794', cveId: 'CVE-2025-0944', vendor: 'Cisco', status: 'Open', summary: 'Roll admin-console hotfix' }, { key: 'SEC-4760', cveId: 'CVE-2024-9912', vendor: 'Atlassian', status: 'Open', summary: 'Validate cert chain' }, ]; const SAMPLE_ARCHER = [ { key: 'EXC-08291', cveId: 'CVE-2025-1014', vendor: 'SUSE', status: 'Pending Review' }, { key: 'EXC-08214', cveId: 'CVE-2024-9912', vendor: 'Adobe', status: 'Draft' }, ]; const SAMPLE_IVANTI = [ { id: 'WF-1042', name: 'Quarterly compliance scan', state: 'In Review', type: 'compliance audit', when: 'Apr 24' }, { id: 'WF-1038', name: 'Endpoint patch rollout — Linux fleet', state: 'In Progress', type: 'patch deploy', when: 'Apr 22' }, { id: 'WF-1034', name: 'Identity provider rotation', state: 'Approved', type: 'access change', when: 'Apr 21' }, ]; const ARCHIVE_SUMMARY = [ { label: 'In Review', count: 12, tone: 'amber' }, { label: 'In Progress', count: 8, tone: 'sky' }, { label: 'Approved', count: 17, tone: 'green' }, { label: 'Closed', count: 41, tone: 'neutral' }, ]; /* ── Page ────────────────────────────────────────────────────── */ function HomePage() { const [expanded, setExpanded] = useHomePageState(SAMPLE_CVES[0].id); const [scanResult, setScanResult] = useHomePageState({ tone: 'success', text: 'CVE-2025-1014 addressed (3 vendors)' }); const [search, setSearch] = useHomePageState(''); const [vendor, setVendor] = useHomePageState('All Vendors'); const [severity, setSeverity] = useHomePageState('All Severities'); return (
{/* ── Top: 4-up stats ── */}
{/* ── 12-col body ── */}
{/* LEFT (col-span-9) */}
{/* Quick CVE Lookup */} Quick CVE Lookup
setScanResult({ tone: 'success', text: 'CVE-2025-1014 addressed (3 vendors)' })}> Scan
{scanResult && (
{SAMPLE_CVES[0].vendors.map(v => (
{v.vendor}
Sev: {v.severity} Status: {v.status} Docs: {v.docCount}
))}
)}
{/* Search + Filter */}
Search CVEs setSearch(e.target.value)} placeholder="CVE ID or description…" />
Vendor setVendor(e.target.value)} options={['All Vendors', 'Red Hat', 'Cisco', 'Ubuntu', 'SUSE', 'Atlassian', 'Adobe']} />
Severity setSeverity(e.target.value)} options={['All Severities', 'Critical', 'High', 'Medium', 'Low']} />
{/* Results summary */}

{SAMPLE_CVES.length} CVEs {SAMPLE_CVES.reduce((n, c) => n + c.vendors.length, 0)} vendor entries

Export 2 Docs
{/* CVE list */}
{SAMPLE_CVES.map(cve => ( s + v.docCount, 0)} statuses={cve.statuses} expanded={expanded === cve.id} onToggle={() => setExpanded(expanded === cve.id ? null : cve.id)} > {/* meta row */}
Published: 2025-03-12 {cve.vendors.length} affected vendor{cve.vendors.length !== 1 ? 's' : ''} {cve.vendors.length >= 2 && ( Delete All )}
{/* vendor sub-cards */} {cve.vendors.map((v, i) => ( {}} onEdit={() => {}} onDelete={() => {}} > {/* For the first vendor of the first CVE, demonstrate the doc + ticket inset */} {i === 0 && cve.id === SAMPLE_CVES[0].id && ( <> {cve.tickets && } )} ))}
))}
{/* RIGHT (col-span-3) */}
{/* Calendar */} Calendar {/* Open Tickets */} } >Open Tickets {SAMPLE_OPEN_TICKETS.map(t => ( {}} onDelete={() => {}} /> ))} {/* Archer Risk */} } >Archer Risk Tickets {SAMPLE_ARCHER.map(t => ( {}} onDelete={() => {}} /> ))} {/* Ivanti Workflows */} Sync} >Ivanti Workflows
Synced Apr 26 · 9:42 AM
{SAMPLE_IVANTI.map(wf => (
{wf.id} {wf.state}
{wf.name}
{wf.type} {wf.when}
))}
); } /* ── Insets used inside the first VendorEntry ────────────────── */ function DocInset() { return (
Documents (4)
{[ { name: 'rh-advisory-2025-1014.pdf', meta: 'advisory · 220 KB' }, { name: 'patch-notes-rhel9.pdf', meta: 'patch · 85 KB · approved by sec-eng' }, ].map(d => (
{d.name}
{d.meta}
View Del
))}
Upload Doc
); } function TicketInset({ tickets }) { return (
JIRA Tickets ({tickets.length})
Add Ticket
{tickets.map(t => (
e.preventDefault()} style={{ fontFamily: 'var(--font-mono)', fontSize: 12, fontWeight: 600, color: HC.sky, textDecoration: 'none' }}>{t.key} {t.summary} {t.status}
))}
); } window.HOME_PAGE = { HomePage };