feat(web): workflow runtime add error info

This commit is contained in:
zhaoying
2026-03-02 18:14:36 +08:00
parent 37ddcb91ac
commit 6cebddf893
3 changed files with 17 additions and 9 deletions

View File

@@ -23,6 +23,7 @@ export interface ChatItem {
status?: string; status?: string;
subContent?: Record<string, any>[]; subContent?: Record<string, any>[];
files?: any[]; files?: any[];
error?: string;
} }
/** /**

View File

@@ -320,7 +320,8 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef }>(({ appId
newList[lastIndex] = { newList[lastIndex] = {
...newList[lastIndex], ...newList[lastIndex],
status, status,
content: newList[lastIndex].content === '' ? null : newList[lastIndex].content error,
content: newList[lastIndex].content === '' ? null : newList[lastIndex].content,
} }
} }
return newList return newList

View File

@@ -217,14 +217,20 @@ const Runtime: FC<{ item: ChatItem; index: number;}> = ({
children: ( children: (
detail detail
? ( ? (
<div className="rb:bg-[#FBFDFF] rb:rounded-md"> <div className="rb:bg-[#FBFDFF] rb:rounded-md">
<Button type="link" icon={<ArrowLeftOutlined />} onClick={() => setDetail(null)} className="rb:px-0! rb:text-[12px]!"> <Button type="link" icon={<ArrowLeftOutlined />} onClick={() => setDetail(null)} className="rb:px-0! rb:text-[12px]!">
{t('common.return')} {t('common.return')}
</Button> </Button>
{renderDetailChild(detail.subContent)} {renderDetailChild(detail.subContent)}
</div> </div>
) )
: renderChild(item.subContent) : <>
{item.error
? <div className={clsx("rb:bg-[#FBFDFF] rb:rounded-md rb:py-2 rb:px-3 ", getStatus('failed'))}>
<Markdown content={item.error} />
</div>
: renderChild(item.subContent)
}</>
) )
}]} }]}
/> />