Toasts, logo icons, shared table toolbar with search, and a density toggle
Feedback: toasts confirm common actions, and a page's error or success message that appears out of view is also shown as a toast. Icons: the tab, app and home-screen icons are the house from the logo; a dev instance gets a coloured dot on its tab icon. Tables: Secrets, Admin Links, IP Addresses and Alerts share one toolbar (search, filters, row count, actions, Export CSV); twelve more tables get a multi-word search box; long tables keep their column headings in view on wide screens. Density: Compact / Normal / Roomy in the user menu, remembered per browser. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7d56ad18b7
commit
617dc1ea2f
56 files changed
+757
-158
No files matched your search
+18
-17
@@ -10,6 +10,9 @@ import { usePagination } from "../hooks/usePagination";
|
||||
import Pagination from "../components/Pagination";
|
||||
import { useSelection } from "../hooks/useSelection";
|
||||
import { confirmDialog } from "../utils/dialogs";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { toast } from "../utils/toast";
|
||||
import TableToolbar from "../components/TableToolbar";
|
||||
|
||||
const TYPE_LABELS: Record<SecretRecord["type"], string> = {
|
||||
api_token: "API Token",
|
||||
@@ -119,8 +122,10 @@ export default function Secrets({ user }: { user: CurrentUser }) {
|
||||
};
|
||||
if (editingId) {
|
||||
await api.secrets.update(editingId, payload);
|
||||
toast.success(`Saved ${form.name}.`);
|
||||
} else {
|
||||
await api.secrets.create(payload);
|
||||
toast.success(`Added ${form.name}.`);
|
||||
}
|
||||
cancelEdit();
|
||||
load();
|
||||
@@ -150,6 +155,7 @@ export default function Secrets({ user }: { user: CurrentUser }) {
|
||||
setError(null);
|
||||
try {
|
||||
await api.secrets.remove(s.id);
|
||||
toast.success(`Deleted ${s.name}.`);
|
||||
load();
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : String(err));
|
||||
@@ -199,7 +205,7 @@ export default function Secrets({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<h2 className="page-title mb-3">Secrets</h2>
|
||||
{error && <div className="alert alert-danger">{error}</div>}
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{canEdit && (
|
||||
<div className="card mb-3">
|
||||
@@ -324,18 +330,13 @@ export default function Secrets({ user }: { user: CurrentUser }) {
|
||||
)}
|
||||
|
||||
<div className="card">
|
||||
<div className="card-header">
|
||||
<div className="d-flex flex-wrap gap-2 align-items-center w-100">
|
||||
<input
|
||||
className="form-control"
|
||||
style={{ maxWidth: 260 }}
|
||||
placeholder="Search name or description…"
|
||||
value={search}
|
||||
onChange={(e) => setSearch(e.target.value)}
|
||||
/>
|
||||
<TableToolbar
|
||||
search={search}
|
||||
onSearch={setSearch}
|
||||
placeholder="Search name or description…"
|
||||
filters={
|
||||
<select
|
||||
className="form-select"
|
||||
style={{ maxWidth: 160 }}
|
||||
className="form-select form-select-sm w-auto"
|
||||
value={statusFilter}
|
||||
onChange={(e) => setStatusFilter(e.target.value as typeof statusFilter)}
|
||||
>
|
||||
@@ -345,11 +346,11 @@ export default function Secrets({ user }: { user: CurrentUser }) {
|
||||
<option value="expired">Expired</option>
|
||||
<option value="never">No expiry</option>
|
||||
</select>
|
||||
<button className="btn btn-outline-secondary ms-auto" onClick={exportCsv}>
|
||||
Export CSV
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
shown={filtered.length}
|
||||
total={secrets?.length}
|
||||
onExport={exportCsv}
|
||||
/>
|
||||
{canEdit && selection.count > 0 && (
|
||||
<div className="card-header bg-blue-lt d-flex align-items-center gap-2">
|
||||
<span>{selection.count} selected</span>
|
||||
|
||||
Reference in new issue
Block a user