Polish web device conflict copy
This commit is contained in:
@@ -27,6 +27,8 @@ import type {
|
||||
} from "@/lib/thread-execution-conflict";
|
||||
import {
|
||||
describeThreadConversationExecutionConflict,
|
||||
labelForProjectConflictAllowPolicy,
|
||||
labelForProjectConflictState,
|
||||
labelForThreadConversationExecutionConflictDecision,
|
||||
summarizeThreadConversationExecutionDecisionResult,
|
||||
} from "@/lib/thread-execution-conflict-ui";
|
||||
@@ -85,14 +87,15 @@ export function buildDeviceWorkspaceDetailCards(workspace: DeviceWorkspaceView)
|
||||
},
|
||||
conflicts: {
|
||||
title: "异常项目 / 文件夹冲突",
|
||||
headerHint: primaryPolicy ? "已接入,可直接调整" : "当前没有异常项目",
|
||||
scopeLabel: "仅作用于当前异常项目 / 文件夹",
|
||||
actions: ["禁止", "允许本次", "永久放行"],
|
||||
items: {
|
||||
device: `设备:${selectedDevice?.name ?? selectedDevice?.id ?? "未知设备"}`,
|
||||
folderKey: `文件夹:${primaryPolicy?.folderKey ?? "暂无"}`,
|
||||
projectId: `项目:${primaryPolicy?.projectId ?? "暂无"}`,
|
||||
allowPolicy: `当前策略:${primaryPolicy?.allowPolicy ?? "暂无"}`,
|
||||
conflictState: `冲突态:${primaryPolicy?.conflictState ?? "暂无"}`,
|
||||
allowPolicy: `当前策略:${labelForProjectConflictAllowPolicy(primaryPolicy?.allowPolicy ?? null)}`,
|
||||
conflictState: `冲突态:${labelForProjectConflictState(primaryPolicy?.conflictState ?? null)}`,
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -714,7 +717,7 @@ export function DeviceEditorCard({
|
||||
<div className="space-y-3 rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
|
||||
<div className="flex items-center justify-between gap-3">
|
||||
<div className="text-[16px] font-semibold text-[#111111]">{detailCards.conflicts.title}</div>
|
||||
<div className="text-[12px] text-[#8C8C8C]">动作后续接入</div>
|
||||
<div className="text-[12px] text-[#8C8C8C]">{detailCards.conflicts.headerHint}</div>
|
||||
</div>
|
||||
<div className="grid gap-2 text-[13px] leading-6 text-[#57606A]">
|
||||
<div className="rounded-2xl bg-[#F7F8FA] px-3 py-2">{detailCards.conflicts.items.device}</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type {
|
||||
ThreadConversationExecutionConflict,
|
||||
ThreadConversationExecutionConflictAction,
|
||||
ThreadConversationExecutionConflictState,
|
||||
} from "@/lib/thread-execution-conflict";
|
||||
|
||||
export function describeThreadConversationExecutionConflict(
|
||||
@@ -46,3 +47,32 @@ export function summarizeThreadConversationExecutionDecisionResult(
|
||||
return "已保持禁止,这次消息没有发出。";
|
||||
}
|
||||
}
|
||||
|
||||
export function labelForProjectConflictAllowPolicy(
|
||||
decision?: ThreadConversationExecutionConflictAction | null,
|
||||
) {
|
||||
switch (decision) {
|
||||
case "allow_once":
|
||||
return "允许本次";
|
||||
case "allow_always":
|
||||
return "永久放行";
|
||||
case "forbid":
|
||||
return "禁止";
|
||||
default:
|
||||
return "暂无";
|
||||
}
|
||||
}
|
||||
|
||||
export function labelForProjectConflictState(
|
||||
conflictState?: ThreadConversationExecutionConflictState | "none" | null,
|
||||
) {
|
||||
switch (conflictState) {
|
||||
case "warning":
|
||||
return "存在并行风险";
|
||||
case "blocked":
|
||||
return "已阻断";
|
||||
case "none":
|
||||
default:
|
||||
return "暂无";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user