Changesets · Branches · Tags · Compare
| Changeset | 6c745dac59c4300fca2ded5bd2f8b1be2000853027f1410d51766bfed4f780de |
|---|---|
| Author | WaylandYang <145302500+WaylandYang@users.noreply.github.com> · 2026-09-03 05:47 +08:00 |
| Committer | GitHub <noreply@github.com> · 2026-09-03 05:47 +08:00 |
| Parents | daaf32c13c87 |
6 files changed
modified crates/utopia-core/src/models.rs +3 −0
| @@ -194,6 +194,9 @@ | ||
| 194 | 194 | pub target_kind: String, |
| 195 | 195 | pub target_id: Option<Uuid>, |
| 196 | 196 | pub detail: serde_json::Value, |
| 197 | + /// NULL = 引擎自动(裁决器合并、一致性检查、推理物化……)。界面靠它把 | |
| 198 | + /// 「没有人」和「人已被移除」分开:后者 actor_id 还在,只是查不到显示名 | |
| 199 | + pub actor_id: Option<Uuid>, | |
| 197 | 200 | pub actor_name: Option<String>, |
| 198 | 201 | pub created_at: DateTime<Utc>, |
| 199 | 202 | } |
modified crates/utopia-store/src/audit.rs +2 −2
| @@ -101,7 +101,7 @@ | ||
| 101 | 101 | OR e.action LIKE 'conflict.%' OR e.action LIKE 'merge.%')"; |
| 102 | 102 | let rows: Vec<AuditEventView> = sqlx::query_as(&format!( |
| 103 | 103 | "SELECT e.id, e.action, e.target_kind, e.target_id, e.detail, |
| 104 | - u.display_name AS actor_name, e.created_at | |
| 104 | + e.actor_id, u.display_name AS actor_name, e.created_at | |
| 105 | 105 | FROM audit_events e LEFT JOIN users u ON u.id = e.actor_id |
| 106 | 106 | WHERE {COND} ORDER BY e.created_at DESC LIMIT $2 OFFSET $3" |
| 107 | 107 | )) |
| @@ -152,7 +152,7 @@ | ||
| 152 | 152 | |
| 153 | 153 | let rows: Vec<AuditEventView> = sqlx::query_as(&format!( |
| 154 | 154 | "SELECT e.id, e.action, e.target_kind, e.target_id, e.detail, |
| 155 | - u.display_name AS actor_name, e.created_at | |
| 155 | + e.actor_id, u.display_name AS actor_name, e.created_at | |
| 156 | 156 | FROM audit_events e LEFT JOIN users u ON u.id = e.actor_id |
| 157 | 157 | {WHERE} |
| 158 | 158 | ORDER BY e.created_at DESC LIMIT $6 OFFSET $7" |
modified web/src/api.ts +2 −0
| @@ -132,6 +132,8 @@ | ||
| 132 | 132 | target_kind: string; |
| 133 | 133 | target_id: string | null; |
| 134 | 134 | detail: Record<string, unknown>; |
| 135 | + /** null = 引擎自动(裁决器、一致性检查、推理);有 id 没名字 = 账号已移除 */ | |
| 136 | + actor_id: string | null; | |
| 135 | 137 | actor_name: string | null; |
| 136 | 138 | created_at: string; |
| 137 | 139 | } |
modified web/src/i18n/en.ts +3 −0
| @@ -1448,6 +1448,9 @@ | ||
| 1448 | 1448 | auditTotal: (n: number) => `${n} events`, |
| 1449 | 1449 | activityEmpty: "Nothing recorded yet.", |
| 1450 | 1450 | deletedUser: "a removed user", |
| 1451 | + // actor_id 为空的两种引擎动作:审阅队列里的自动裁决,和其余后台工作 | |
| 1452 | + adjudicator: "AI adjudicator", | |
| 1453 | + engine: "the engine", | |
| 1451 | 1454 | auditActions: { |
| 1452 | 1455 | "entity_type.created": "created entity type", |
| 1453 | 1456 | "entity_type.updated": "updated entity type", |
modified web/src/i18n/zh.ts +2 −0
| @@ -1306,6 +1306,8 @@ | ||
| 1306 | 1306 | auditTotal: (n: number) => `共 ${n} 条`, |
| 1307 | 1307 | activityEmpty: "还没有记录。", |
| 1308 | 1308 | deletedUser: "一位已移除的用户", |
| 1309 | + adjudicator: "AI 裁决器", | |
| 1310 | + engine: "引擎", | |
| 1309 | 1311 | auditActions: { |
| 1310 | 1312 | "entity_type.created": "创建了实体类型", |
| 1311 | 1313 | "entity_type.updated": "更新了实体类型", |
modified web/src/pages/KbSettings.tsx +6 −1
| @@ -492,7 +492,12 @@ | ||
| 492 | 492 | </span> |
| 493 | 493 | <span className="min-w-0 truncate"> |
| 494 | 494 | <span className="text-neutral-200"> |
| 495 | - {e.actor_name ?? S.kbset.deletedUser} | |
| 495 | + {e.actor_name ?? | |
| 496 | + (e.actor_id | |
| 497 | + ? S.kbset.deletedUser | |
| 498 | + : e.action.startsWith("review.") | |
| 499 | + ? S.kbset.adjudicator | |
| 500 | + : S.kbset.engine)} | |
| 496 | 501 | </span>{" "} |
| 497 | 502 | <span className="text-neutral-500"> |
| 498 | 503 | {S.kbset.auditActions[e.action] ?? e.action} |