feat(activity): 写失败时带 expID,并对外键(23503)现场诊断

- AppendActivity 失败日志补上 store.expID,直观看到写的是哪个 exploration
- 丢弃记录时若为外键违反(SQLSTATE 23503),调用新增的 ExplorationDiag 现场查库:
  exploration 是否存在 / 引用它的 task 数 / 当前 MAX(exploration.id),
  一行日志区分「父行真没了」vs「expID 拿错了」vs「外键未按 RESTRICT 建」
- 系统日志页时间戳补上年月日(原来只有时分秒)
This commit is contained in:
Autumn-27 committed 2026-08-11 08:44:55 -04:00
1 parent daee98b33a
commit ea833ad992
3 files changed
+44 -3

No files matched your search

+3 -1
View File
@@ -31,7 +31,9 @@ const levelDot: Record<LogLine["level"], string> = {
function fmtTime(ts: string) {
const d = new Date(ts);
return isNaN(d.getTime()) ? "" : d.toLocaleTimeString("zh-CN", { hour12: false });
if (isNaN(d.getTime())) return "";
const p = (n: number) => String(n).padStart(2, "0");
return `${d.getFullYear()}-${p(d.getMonth() + 1)}-${p(d.getDate())} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`;
}
export default function LogsPage() {