feat(workflow): enhance AI agent workflow state management and response handling

This commit is contained in:
mlogclub
2026-06-24 17:56:23 +08:00
parent 0b5a24975c
commit a628d103f9
9 changed files with 172 additions and 5 deletions
+34
View File
@@ -62,6 +62,10 @@ function getNextStatus(item: AIAgent) {
return item.status === Status.Ok ? Status.Disabled : Status.Ok;
}
function isWorkflowPublished(item: AIAgent) {
return Boolean(item.workflowPublished ?? item.workflowVersionId > 0);
}
export default function DashboardAIAgentsPage() {
const t = useI18n();
const statusOptions = useMemo(() => getStatusOptions(t), [t]);
@@ -116,6 +120,36 @@ export default function DashboardAIAgentsPage() {
label: t("aiAgent.columnServiceMode"),
render: (item) => getServiceModeLabel(item.serviceMode, t),
},
{
key: "workflow",
label: "流程状态",
render: (item) => {
const published = isWorkflowPublished(item);
return (
<div className="space-y-1">
<div className="flex flex-wrap items-center gap-1.5">
<Badge variant={published ? "default" : "outline"}>
{item.workflowStateText || (published ? "已发布" : "未发布")}
</Badge>
{published ? (
<span className="font-mono text-xs text-muted-foreground">
#{item.workflowVersionId}
</span>
) : null}
</div>
{!published ? (
<div className="text-xs text-muted-foreground">
AI
</div>
) : (
<div className="text-xs text-muted-foreground">
#{item.workflowVersionId}
</div>
)}
</div>
);
},
},
{
key: "knowledge",
label: t("aiAgent.columnKnowledge"),