feat(web): http request add process
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-03-13 17:27:52
|
* @Date: 2026-03-13 17:27:52
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-04-07 21:48:30
|
* @Last Modified time: 2026-04-24 18:14:25
|
||||||
*/
|
*/
|
||||||
import { type FC, useState, useRef, useEffect } from 'react'
|
import { type FC, useState, useRef, useEffect } from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
@@ -59,6 +59,7 @@ interface NodeData {
|
|||||||
node_type?: string;
|
node_type?: string;
|
||||||
input?: any;
|
input?: any;
|
||||||
output?: any;
|
output?: any;
|
||||||
|
process?: any;
|
||||||
elapsed_time?: string;
|
elapsed_time?: string;
|
||||||
error?: any;
|
error?: any;
|
||||||
state: Record<string, any>;
|
state: Record<string, any>;
|
||||||
@@ -485,7 +486,7 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateWorkflowNodeEndMessage = (data: NodeData) => {
|
const updateWorkflowNodeEndMessage = (data: NodeData) => {
|
||||||
const { node_id, input, output, error, elapsed_time, status } = data;
|
const { node_id, input, output, process, error, elapsed_time, status } = data;
|
||||||
setChatList(prev => {
|
setChatList(prev => {
|
||||||
const newList = [...prev]
|
const newList = [...prev]
|
||||||
const lastIndex = newList.length - 1
|
const lastIndex = newList.length - 1
|
||||||
@@ -498,6 +499,7 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
content: {
|
content: {
|
||||||
input,
|
input,
|
||||||
output,
|
output,
|
||||||
|
process,
|
||||||
error,
|
error,
|
||||||
},
|
},
|
||||||
status: status || 'completed',
|
status: status || 'completed',
|
||||||
@@ -514,7 +516,7 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const updateWorkflowCycleMessage = (data: NodeData) => {
|
const updateWorkflowCycleMessage = (data: NodeData) => {
|
||||||
const { node_id, cycle_id, cycle_idx, input, output, error, elapsed_time, status } = data;
|
const { node_id, cycle_id, cycle_idx, input, output, process, error, elapsed_time, status } = data;
|
||||||
const { nodes } = config as WorkflowConfig
|
const { nodes } = config as WorkflowConfig
|
||||||
const node = nodes.find(n => n.id === node_id);
|
const node = nodes.find(n => n.id === node_id);
|
||||||
const { name, type } = node || {}
|
const { name, type } = node || {}
|
||||||
@@ -538,6 +540,7 @@ const TestChat: FC<TestChatProps> = ({
|
|||||||
cycle_idx,
|
cycle_idx,
|
||||||
input,
|
input,
|
||||||
output,
|
output,
|
||||||
|
process,
|
||||||
error,
|
error,
|
||||||
},
|
},
|
||||||
status: status || 'completed',
|
status: status || 'completed',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-06 21:10:56
|
* @Date: 2026-02-06 21:10:56
|
||||||
* @Last Modified by: ZhaoYing
|
* @Last Modified by: ZhaoYing
|
||||||
* @Last Modified time: 2026-04-24 17:34:51
|
* @Last Modified time: 2026-04-24 18:13:22
|
||||||
*/
|
*/
|
||||||
/**
|
/**
|
||||||
* Workflow Chat Component
|
* Workflow Chat Component
|
||||||
@@ -185,7 +185,7 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
|
|||||||
*/
|
*/
|
||||||
const handleStreamMessage = (data: SSEMessage[]) => {
|
const handleStreamMessage = (data: SSEMessage[]) => {
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
const { content, conversation_id, node_id, cycle_id, cycle_idx, input, output, error, elapsed_time, status, citations } = item.data as {
|
const { content, conversation_id, node_id, cycle_id, cycle_idx, input, output, process, error, elapsed_time, status, citations } = item.data as {
|
||||||
content: string;
|
content: string;
|
||||||
conversation_id: string | null;
|
conversation_id: string | null;
|
||||||
cycle_id: string;
|
cycle_id: string;
|
||||||
@@ -193,6 +193,7 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
|
|||||||
node_id: string;
|
node_id: string;
|
||||||
node_name?: string;
|
node_name?: string;
|
||||||
node_type?: string;
|
node_type?: string;
|
||||||
|
process?: any;
|
||||||
input?: any;
|
input?: any;
|
||||||
output?: any;
|
output?: any;
|
||||||
elapsed_time?: string;
|
elapsed_time?: string;
|
||||||
@@ -277,6 +278,7 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
|
|||||||
content: {
|
content: {
|
||||||
input,
|
input,
|
||||||
output,
|
output,
|
||||||
|
process,
|
||||||
error,
|
error,
|
||||||
},
|
},
|
||||||
status: status || 'completed',
|
status: status || 'completed',
|
||||||
@@ -312,6 +314,7 @@ const Chat = forwardRef<ChatRef, { appId: string; graphRef: GraphRef; data: Work
|
|||||||
cycle_idx,
|
cycle_idx,
|
||||||
input,
|
input,
|
||||||
output,
|
output,
|
||||||
|
process,
|
||||||
error,
|
error,
|
||||||
},
|
},
|
||||||
status: status || 'completed',
|
status: status || 'completed',
|
||||||
|
|||||||
Reference in New Issue
Block a user