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

This commit is contained in:
RhenCloud committed 2026-08-03 05:19:02 +08:00
1 parent 3a6a2cbbc5
commit dcbe93be91
14 files changed
+460 -42

No files matched your search

+15 -1
View File
@@ -29,5 +29,19 @@ export function useSendLogs() {
}
}
return { logs, loading, needLogin, error, load };
async function loadById(id: number): Promise<SendRecord | null> {
const res = await fetch(`/admin/api/logs/${id}`, {
headers: { accept: "application/json" },
credentials: "same-origin",
});
if (res.status === 401) {
needLogin.value = true;
return null;
}
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const data = (await res.json()) as { log?: SendRecord };
return data.log ?? null;
}
return { logs, loading, needLogin, error, load, loadById };
}