import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { api, type DockhandVulnerabilitiesResponse, type DockhandVulnerabilityEnvironment } from "../api/client"; import TimeAgo from "../components/TimeAgo"; import { readableError } from "../utils/errors"; const count = (v: number | null) => (v === null ? "—" : v.toLocaleString()); const ageText = (days: number) => (days >= 730 ? `${Math.floor(days / 365)} years` : days >= 60 ? `${Math.floor(days / 30)} months` : `${days} days`); function Host({ env, imageAgeDays }: { env: DockhandVulnerabilityEnvironment; imageAgeDays: number }) { const [open, setOpen] = useState(false); const unscanned = env.totalImages !== null && env.imagesScanned !== null ? env.totalImages - env.imagesScanned : null; return (
| CVE | Package | Installed | Fixed in | Image | Used by |
|---|---|---|---|---|---|
| {f.cve} | {f.package} | {f.installedVersion || "—"} | {f.fixedVersion ? {f.fixedVersion} : no fix yet} | {f.imageName} | {f.containers.length > 0 ? f.containers.join(", ") : "—"} |
From the scans Dockhand has already run on its images (it scans when it is told to — nothing is scanned from here). An image that was never scanned is not known to be clean.{" "} {data.alerts ? ( <> Critical findings are an alert — see Alerts;{" "} {data.highThreshold > 0 ? ( <> so is a host with {data.highThreshold} or more high ones (Settings → Notifications); medium and low are only shown here. > ) : ( <>high, medium and low are only shown here (high ones can be alerted from a number you choose under Settings → Notifications).> )} > ) : ( <> The alert for critical findings is switched off (Settings → Notifications). > )}
{data.status && !data.status.ok &&