mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +00:00
feat(admin): add detailed send log viewer with extended fields
This commit is contained in:
14 files changed
+460
-42
No files matched your search
@@ -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 };
|
||||
}
|
||||
Reference in new issue
Block a user