feat(web): workflow runtime add error info
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
|
}</>
|
||||||
)
|
)
|
||||||
}]}
|
}]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user