feat(web): W3-1 login, session shell, home dashboard, settings, engine panel and audit pages
- /login: setup/login/TOTP states driven by server error codes, fixed-height error slot - console layout: GET /auth/session gate, redirect to /login, account popover (change password, logout) - home: six dashboard sections with SSE-driven refresh, automation switch and read-only reconcile toggle - settings tabs: downloaders, media servers, library roots, path mappings, site credentials, API keys (one-time plaintext), Pi upstream, cache/organize/retention/budget, automation - engine: runs list (status/name filters, cursor paging, stats tiles), run detail (step timeline, json payloads, signals, cancel) - audit: filterable list with detail sheet - vite: allow repo root in server.fs so deno-installed deps under node_modules/.deno load in dev Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
ef73abe3df
commit
0dec0854df
21 files changed
+3905
-57
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { useInfiniteQuery } from "@tanstack/react-query";
|
||||
import type { AuditEvent, CursorPage } from "@umt/contracts";
|
||||
import { apiData } from "~/lib/api.ts";
|
||||
import { qk } from "~/lib/query-keys.ts";
|
||||
|
||||
export type AuditFilters = {
|
||||
actorType?: string;
|
||||
action?: string;
|
||||
targetType?: string;
|
||||
targetId?: string;
|
||||
};
|
||||
|
||||
/** 审计事件(新→旧),游标"加载更多" */
|
||||
export function useAuditEvents(filters: AuditFilters) {
|
||||
return useInfiniteQuery({
|
||||
queryKey: qk.list("audit", filters),
|
||||
initialPageParam: undefined as string | undefined,
|
||||
queryFn: ({ pageParam, signal }) =>
|
||||
apiData<CursorPage<AuditEvent>>("/audit-events", {
|
||||
params: { ...filters, cursor: pageParam, limit: 50 },
|
||||
signal,
|
||||
}),
|
||||
getNextPageParam: (last) => last.nextCursor ?? undefined,
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user