AdGuard Home, Grafana, Docker image age, foldable server page cards
New integration kinds adguard (status, statistics, filter lists and a real DNS question over UDP; alerts for DNS down/not running, protection left off, stale lists) and grafana (alert rules firing or failing, data-source health). Optional warning for running Docker images built more than N days ago (off by default). A server's overview cards can be folded and arranged, kept per user. Migrations 0075-0077; docs, metrics and tests included. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d9a2310bb
commit
551eb1597a
53 files changed
+27700
-33
No files matched your search
@@ -6,7 +6,9 @@ import { readableError } from "../utils/errors";
|
||||
|
||||
const count = (v: number | null) => (v === null ? "—" : v.toLocaleString());
|
||||
|
||||
function Host({ env }: { env: DockhandVulnerabilityEnvironment }) {
|
||||
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 (
|
||||
@@ -28,6 +30,13 @@ function Host({ env }: { env: DockhandVulnerabilityEnvironment }) {
|
||||
{unscanned !== null && unscanned > 0 ? ` — ${unscanned} not scanned yet` : ""}
|
||||
</span>
|
||||
</div>
|
||||
{env.images && env.images.oldest.length > 0 && (
|
||||
<div className="small text-secondary mt-1">
|
||||
Oldest running images: {env.images.oldest.slice(0, 3).map((i) => `${i.image} (${ageText(i.ageDays)})`).join(", ")}
|
||||
{imageAgeDays > 0 && env.images.over !== null ? (env.images.over > 0 ? ` — ${env.images.over} built more than ${imageAgeDays} days ago (an alert)` : ` — none older than ${imageAgeDays} days`) : ""}
|
||||
{env.images.undated > 0 ? ` · ${env.images.undated} with no build date` : ""}
|
||||
</div>
|
||||
)}
|
||||
{env.findings.length > 0 && (
|
||||
<>
|
||||
<button className="btn btn-link btn-sm p-0 mt-1" onClick={() => setOpen((o) => !o)}>
|
||||
@@ -128,7 +137,7 @@ export default function DockerVulnerabilities({ integrationId }: { integrationId
|
||||
{data.environments.length === 0 && !data.status && <div className="text-secondary">Not read yet — it is read a few minutes after Dockhand is added, then every quarter of an hour.</div>}
|
||||
{data.environments.length === 0 && data.status?.ok && <div className="text-secondary">Dockhand lists no Docker hosts.</div>}
|
||||
{data.environments.map((e) => (
|
||||
<Host key={e.environmentId} env={e} />
|
||||
<Host key={e.environmentId} env={e} imageAgeDays={data.imageAgeDays} />
|
||||
))}
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user