feat(web): 审计表体内滚动、时间范围筛选与分页档位

This commit is contained in:
2026-10-08 23:27:42 +08:00
parent 66a9a93914
commit 4d31c20d35
6 changed files with 118 additions and 50 deletions
+4
View File
@@ -323,10 +323,14 @@ export function createRepos(db: Db) {
},
async listPage(params: {
domain?: string;
from?: Date;
to?: Date;
page: number;
page_size: number;
}): Promise<{ rows: AuditLogRow[]; total: number }> {
const conds = params.domain ? [eq(auditLogs.domain, params.domain)] : [];
if (params.from) conds.push(gte(auditLogs.created_at, params.from));
if (params.to) conds.push(lt(auditLogs.created_at, params.to));
const totalRows = await db
.select({ n: count() })
.from(auditLogs)