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

@ -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 };
}