feat(ui): update ui style

This commit is contained in:
RhenCloud 2026-08-16 21:25:57 +08:00
parent ca6dfd3f64
commit 47d7c9105b
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
35 changed files with 1577 additions and 591 deletions

View file

@ -4,7 +4,7 @@ export interface MessageTracker {
delete(eventId: string, targetId: string): Promise<void>;
}
const MESSAGE_KEY_TTL_SECONDS = 604800;
const MESSAGE_KEY_TTL_SECONDS = 86400;
export function kvMessageTracker(kv: KVNamespace): MessageTracker {
const key = (eventId: string, targetId: string): string => `msg:${eventId}:${targetId}`;

View file

@ -147,12 +147,20 @@ export async function getSendLogByDelivery(
}
}
export async function getFailedSendLog(db: D1Database, limit = 20): Promise<SendRecord[]> {
export async function getFailedSendLog(
db: D1Database,
limit = 20,
groupId?: string,
): Promise<SendRecord[]> {
try {
const { results } = await db
.prepare(`SELECT ${COLUMNS} FROM send_logs WHERE ok = 0 ORDER BY ts DESC LIMIT ?`)
.bind(limit)
.all<LogRow>();
const stmt = groupId
? db
.prepare(
`SELECT ${COLUMNS} FROM send_logs WHERE ok = 0 AND group_id = ? ORDER BY ts DESC LIMIT ?`,
)
.bind(groupId, limit)
: db.prepare(`SELECT ${COLUMNS} FROM send_logs WHERE ok = 0 ORDER BY ts DESC LIMIT ?`).bind(limit);
const { results } = await stmt.all<LogRow>();
return results.map(toRecord);
} catch (err) {
log.warn({ err }, "Failed to load failed send log");