Webhook 投递记录
所有项目的 webhook 投递历史。用于排查 "AI 没回应" 类问题 — 如果投递失败(红色状态码),daemon 根本没收到事件。
${summary}| 时间 | 项目 | 事件 | 目标 URL | 状态 | 耗时 | 详情 |
|---|
import { type DeliveryWithWebhookRow } from "../webhooks";
import { type UserRow } from "../store";
import { THEME_CSS, escapeHtml, escapeAttr, tabNavHTML } from "../render/layout";
function statusClass(status: number | null): string {
if (status === null) return "err";
if (status >= 200 && status < 300) return "ok";
if (status >= 400 && status < 500) return "warn";
return "err";
}
function deliveryRowHtml(d: DeliveryWithWebhookRow): string {
const status = d.response_status === null ? "—" : String(d.response_status);
const cls = statusClass(d.response_status);
const project = d.project_owner
? `${escapeHtml(d.project_owner + "/" + (d.project_name ?? ""))}`
: "(deleted)";
const url = d.webhook_url ? `${escapeHtml(d.webhook_url)}` : "(deleted)";
const err = d.error ? `
${escapeHtml(d.response_body)}${escapeHtml(d.payload)}所有项目的 webhook 投递历史。用于排查 "AI 没回应" 类问题 — 如果投递失败(红色状态码),daemon 根本没收到事件。
${summary}| 时间 | 项目 | 事件 | 目标 URL | 状态 | 耗时 | 详情 |
|---|