refactor(web): unify form controls, one notification rule, dedupe i18n copy (#54)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yaowei Zheng
2026-07-24 18:43:18 +08:00
committed by GitHub
parent c7465625a4
commit 3f868ac385
50 changed files with 2391 additions and 1190 deletions
+16 -7
View File
@@ -42,6 +42,7 @@ import type {
ScheduleItem,
SchedulesResponse,
ScheduleUpsertRequest,
SessionCategory,
SessionCreateRequest,
SessionCreateResponse,
SessionPatchRequest,
@@ -185,17 +186,25 @@ export const getAgentTraces = (projectId: string, agentId: string) =>
// Session ---------------------------------------------------------------------
/** Optional paging (both absent = full list): the store requests `limit+1` per page to detect "has more". */
/**
* Optional paging (absent = full unfiltered list): the store requests `limit+1` per page to
* detect "has more". `category` filters server-side (paging applies within the category);
* `withCounts` asks for per-category totals over the whole list alongside the page.
*/
export const listSessions = (
projectId: string,
agentId: string,
paging?: { offset: number; limit: number },
) =>
apiFetch<SessionsResponse>(
`/api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}/sessions${
paging ? `?limit=${paging.limit}&offset=${paging.offset}` : ""
}`,
opts?: { offset: number; limit: number; category?: SessionCategory; withCounts?: boolean },
) => {
const qs = opts
? `?limit=${opts.limit}&offset=${opts.offset}` +
(opts.category ? `&category=${opts.category}` : "") +
(opts.withCounts ? "&counts=1" : "")
: "";
return apiFetch<SessionsResponse>(
`/api/projects/${encodeURIComponent(projectId)}/agents/${encodeURIComponent(agentId)}/sessions${qs}`,
);
};
/** Server directory browsing: `path` is an absolute path; empty means start from the server's home directory. */
export const listDirs = (projectId: string, path = "") =>