feat(admin): add detailed send log viewer with extended fields

This commit is contained in:
RhenCloud 2026-08-03 04:13:04 +08:00
parent 3a6a2cbbc5
commit dcbe93be91
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
14 changed files with 460 additions and 42 deletions

View file

@ -3,21 +3,35 @@ import { recordSend, getSendLog } from "../lib/send-log";
function createMockDB(): D1Database {
const rows: Array<Record<string, unknown>> = [];
const insertCols = [
"ts",
"route_id",
"event",
"repo",
"target",
"ok",
"error",
"status",
"message_id",
"delivery_id",
"platform",
"actor",
"action",
"duration_ms",
"error_code",
"attempts",
"detail",
];
return {
prepare: (sql: string) => ({
bind: (..._args: unknown[]) => ({
run: async (): Promise<{ success: boolean }> => {
if (sql.startsWith("INSERT")) {
const args = _args as unknown[];
rows.push({
ts: args[0],
route_id: args[1],
event: args[2],
repo: args[3],
target: args[4],
ok: args[5],
error: args[6],
const row: Record<string, unknown> = {};
insertCols.forEach((col, i) => {
row[col] = _args[i];
});
rows.push(row);
}
return { success: true };
},