Add saved filter views, a customisable dashboard, server comparison, row keyboard navigation and share links
- Table search, status, tag and sort live in the address; Save view pins one as a favourite. - Dashboard cards can be moved and hidden per user (users.dashboard_layout, migration 0022). - Compare two to four servers' load, memory or disk on one chart. - j/k move through table rows that open a detail panel. - Share links open a read-only wall without signing in, numbers only or with names (share_links, migration 0023); the wall is split into a shared view over two data sources. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
906220040e
commit
44e393f172
50 files changed
+6114
-258
No files matched your search
@@ -74,7 +74,7 @@ function typeBadgeStyle(colors: Record<string, string>, type: IntegrationType):
|
||||
|
||||
export default function Integrations({ user }: { user: CurrentUser }) {
|
||||
const isAdmin = user.role === "admin";
|
||||
const [searchParams] = useSearchParams();
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
|
||||
const [integrations, setIntegrations] = useState<IntegrationSummary[] | null>(null);
|
||||
const [adding, setAdding] = useState(false);
|
||||
@@ -137,7 +137,12 @@ export default function Integrations({ user }: { user: CurrentUser }) {
|
||||
}
|
||||
|
||||
const tableSearch = useTableSearch(integrations);
|
||||
const sortedIntegrations = tableSearch.filtered ? [...tableSearch.filtered].sort((a, b) => a.name.localeCompare(b.name)) : null;
|
||||
const statusParam = searchParams.get("status");
|
||||
const statusFilter = statusParam === "failing" || statusParam === "working" || statusParam === "disabled" ? statusParam : "";
|
||||
const matchesStatus = (i: IntegrationSummary) =>
|
||||
statusFilter === "" ||
|
||||
(statusFilter === "disabled" ? !i.enabled : statusFilter === "failing" ? i.enabled && i.health?.status === "failing" : i.enabled && i.health?.status === "ok");
|
||||
const sortedIntegrations = tableSearch.filtered ? [...tableSearch.filtered].filter(matchesStatus).sort((a, b) => a.name.localeCompare(b.name)) : null;
|
||||
|
||||
function exportCsv() {
|
||||
if (!sortedIntegrations) return;
|
||||
@@ -192,6 +197,29 @@ export default function Integrations({ user }: { user: CurrentUser }) {
|
||||
search={tableSearch.query}
|
||||
onSearch={tableSearch.setQuery}
|
||||
placeholder="Search integrations…"
|
||||
filters={
|
||||
<select
|
||||
className="form-select form-select-sm w-auto"
|
||||
aria-label="Show integrations that are"
|
||||
value={statusFilter}
|
||||
onChange={(e) =>
|
||||
setSearchParams(
|
||||
(prev) => {
|
||||
const next = new URLSearchParams(prev);
|
||||
if (e.target.value) next.set("status", e.target.value);
|
||||
else next.delete("status");
|
||||
return next;
|
||||
},
|
||||
{ replace: true },
|
||||
)
|
||||
}
|
||||
>
|
||||
<option value="">Any status</option>
|
||||
<option value="failing">Failing</option>
|
||||
<option value="working">Working</option>
|
||||
<option value="disabled">Disabled</option>
|
||||
</select>
|
||||
}
|
||||
shown={sortedIntegrations?.length}
|
||||
total={integrations?.length}
|
||||
onExport={exportCsv}
|
||||
@@ -262,8 +290,8 @@ export default function Integrations({ user }: { user: CurrentUser }) {
|
||||
<div className="col-12">
|
||||
<div className="card">
|
||||
<div className="card-body text-secondary text-center">
|
||||
{tableSearch.active ? "Nothing matches that search." : "No integrations configured yet."}
|
||||
{isAdmin && !tableSearch.active && (
|
||||
{tableSearch.active || statusFilter ? "Nothing matches that." : "No integrations configured yet."}
|
||||
{isAdmin && !tableSearch.active && !statusFilter && (
|
||||
<>
|
||||
{" "}
|
||||
<button className="btn btn-link p-0 align-baseline" onClick={() => setAdding(true)}>
|
||||
|
||||
Reference in new issue
Block a user