Accessibility pass, command palette actions, row detail panel, server activity, map, wall display and setup guide
Accessibility: skip link, labelled landmarks, visible focus, page-change announcements, sortable headings as real buttons, every label tied to its field, named row checkboxes, and text contrast raised to 4.5:1 in both themes. Command palette: also runs actions (silence/end maintenance, theme, density, wall display, sign out) and is a proper dialog; g-then-letter shortcuts, "/" and "?". Row detail panel for six tables. Server Activity card, with the health check now recording offline/back-online and disk events in the audit log. Map page of hosts, servers, DNS names and monitors. Full-screen wall display. A getting-started checklist on the admin dashboard. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f7f5e1cd41
commit
57fd4f8c52
36 files changed
+2790
-210
No files matched your search
@@ -0,0 +1,97 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { IconCircle, IconCircleCheck, IconX } from "@tabler/icons-react";
|
||||
|
||||
export interface SetupStep {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
to: string;
|
||||
/** What to call the button that goes there. */
|
||||
action: string;
|
||||
done: boolean;
|
||||
}
|
||||
|
||||
const DISMISSED_KEY = "hlm-setup-dismissed";
|
||||
export const SHOW_SETUP_EVENT = "show-setup-guide";
|
||||
|
||||
function wasDismissed(): boolean {
|
||||
try {
|
||||
return localStorage.getItem(DISMISSED_KEY) === "1";
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A checklist for a new installation, at the top of the dashboard: what to set up, which steps are already done (worked out from
|
||||
* what exists, never ticked by hand), and a way to put it away. It goes by itself once everything is done.
|
||||
*/
|
||||
export default function SetupGuide({ steps }: { steps: SetupStep[] }) {
|
||||
const [dismissed, setDismissed] = useState(wasDismissed);
|
||||
|
||||
// The command palette can bring it back.
|
||||
useEffect(() => {
|
||||
const show = () => {
|
||||
try {
|
||||
localStorage.removeItem(DISMISSED_KEY);
|
||||
} catch {
|
||||
// not remembered; it shows for this visit anyway
|
||||
}
|
||||
setDismissed(false);
|
||||
};
|
||||
window.addEventListener(SHOW_SETUP_EVENT, show);
|
||||
return () => window.removeEventListener(SHOW_SETUP_EVENT, show);
|
||||
}, []);
|
||||
|
||||
const done = steps.filter((s) => s.done).length;
|
||||
if (dismissed || steps.length === 0 || done === steps.length) return null;
|
||||
|
||||
const dismiss = () => {
|
||||
try {
|
||||
localStorage.setItem(DISMISSED_KEY, "1");
|
||||
} catch {
|
||||
// not remembered; it is gone for this visit anyway
|
||||
}
|
||||
setDismissed(true);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="card mb-3" role="region" aria-labelledby="setup-guide-title">
|
||||
<div className="card-header">
|
||||
<div>
|
||||
<h3 className="card-title" id="setup-guide-title">
|
||||
Getting started
|
||||
</h3>
|
||||
<div className="text-secondary small">
|
||||
{done} of {steps.length} done
|
||||
</div>
|
||||
</div>
|
||||
<div className="card-actions">
|
||||
<button type="button" className="btn btn-sm btn-ghost-secondary" onClick={dismiss} aria-label="Hide the getting started guide" title="Hide this guide (bring it back from the search box: Ctrl K)">
|
||||
<IconX size={16} />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="progress progress-sm rounded-0" role="progressbar" aria-label="Setup progress" aria-valuemin={0} aria-valuemax={steps.length} aria-valuenow={done}>
|
||||
<div className="progress-bar bg-green" style={{ width: `${(done / steps.length) * 100}%` }} />
|
||||
</div>
|
||||
<ul className="list-group list-group-flush">
|
||||
{steps.map((s) => (
|
||||
<li key={s.id} className="list-group-item d-flex align-items-center gap-3">
|
||||
{s.done ? <IconCircleCheck size={22} className="text-green flex-shrink-0" aria-label="Done" /> : <IconCircle size={22} className="text-secondary flex-shrink-0" aria-label="Not done yet" />}
|
||||
<div className="flex-fill" style={{ minWidth: 0 }}>
|
||||
<div className={s.done ? "text-secondary" : "fw-medium"}>{s.title}</div>
|
||||
{!s.done && <div className="text-secondary small">{s.description}</div>}
|
||||
</div>
|
||||
{!s.done && (
|
||||
<Link to={s.to} className="btn btn-sm btn-primary flex-shrink-0">
|
||||
{s.action}
|
||||
</Link>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user