fix: running status

This commit is contained in:
StyleZhang 2024-03-21 15:03:49 +08:00
parent 8bdaab96b1
commit 267d9568c6
7 changed files with 82 additions and 13 deletions

View File

@ -0,0 +1,5 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Icon">
<path id="Vector" d="M29.2673 17.3332C29.3109 16.8946 29.3332 16.4498 29.3332 15.9998C29.3332 8.63604 23.3636 2.6665 15.9998 2.6665C8.63604 2.6665 2.6665 8.63604 2.6665 15.9998C2.6665 23.3636 8.63604 29.3332 15.9998 29.3332C16.2234 29.3332 16.4457 29.3277 16.6665 29.3168C16.8902 29.3058 17.1125 29.2892 17.3332 29.2673M15.9998 7.99984V15.9998L10.8458 18.5102M23.7065 19.9464L28.8621 23.8131C29.2481 24.1026 29.441 24.2473 29.5101 24.4248C29.5705 24.5802 29.5705 24.7527 29.5101 24.9081C29.441 25.0855 29.2481 25.2303 28.8621 25.5198L23.7065 29.3864C23.1572 29.7984 22.8825 30.0044 22.6526 29.9996C22.4526 29.9955 22.265 29.9017 22.1416 29.7441C21.9998 29.5631 21.9998 29.2197 21.9998 28.5331V20.7998C21.9998 20.1131 21.9998 19.7698 22.1416 19.5888C22.265 19.4312 22.4526 19.3374 22.6526 19.3333C22.8825 19.3285 23.1572 19.5345 23.7065 19.9464Z" stroke="#D0D5DD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,39 @@
{
"icon": {
"type": "element",
"isRootNode": true,
"name": "svg",
"attributes": {
"width": "32",
"height": "32",
"viewBox": "0 0 32 32",
"fill": "none",
"xmlns": "http://www.w3.org/2000/svg"
},
"children": [
{
"type": "element",
"name": "g",
"attributes": {
"id": "Icon"
},
"children": [
{
"type": "element",
"name": "path",
"attributes": {
"id": "Vector",
"d": "M29.2673 17.3332C29.3109 16.8946 29.3332 16.4498 29.3332 15.9998C29.3332 8.63604 23.3636 2.6665 15.9998 2.6665C8.63604 2.6665 2.6665 8.63604 2.6665 15.9998C2.6665 23.3636 8.63604 29.3332 15.9998 29.3332C16.2234 29.3332 16.4457 29.3277 16.6665 29.3168C16.8902 29.3058 17.1125 29.2892 17.3332 29.2673M15.9998 7.99984V15.9998L10.8458 18.5102M23.7065 19.9464L28.8621 23.8131C29.2481 24.1026 29.441 24.2473 29.5101 24.4248C29.5705 24.5802 29.5705 24.7527 29.5101 24.9081C29.441 25.0855 29.2481 25.2303 28.8621 25.5198L23.7065 29.3864C23.1572 29.7984 22.8825 30.0044 22.6526 29.9996C22.4526 29.9955 22.265 29.9017 22.1416 29.7441C21.9998 29.5631 21.9998 29.2197 21.9998 28.5331V20.7998C21.9998 20.1131 21.9998 19.7698 22.1416 19.5888C22.265 19.4312 22.4526 19.3374 22.6526 19.3333C22.8825 19.3285 23.1572 19.5345 23.7065 19.9464Z",
"stroke": "currentColor",
"stroke-width": "2",
"stroke-linecap": "round",
"stroke-linejoin": "round"
},
"children": []
}
]
}
]
},
"name": "ClockPlaySlim"
}

View File

@ -0,0 +1,16 @@
// GENERATE BY script
// DON NOT EDIT IT MANUALLY
import * as React from 'react'
import data from './ClockPlaySlim.json'
import IconBase from '@/app/components/base/icons/IconBase'
import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase'
const Icon = React.forwardRef<React.MutableRefObject<SVGElement>, Omit<IconBaseProps, 'data'>>((
props,
ref,
) => <IconBase {...props} ref={ref} data={data as IconData} />)
Icon.displayName = 'ClockPlaySlim'
export default Icon

View File

@ -1,3 +1,4 @@
export { default as ClockFastForward } from './ClockFastForward'
export { default as ClockPlaySlim } from './ClockPlaySlim'
export { default as ClockPlay } from './ClockPlay'
export { default as ClockRefresh } from './ClockRefresh'

View File

@ -130,6 +130,7 @@ export const useWorkflowRun = () => {
params: any,
callback?: IOtherOptions,
) => {
handleLoadBackupDraft()
const {
onWorkflowStarted,
onWorkflowFinished,
@ -138,15 +139,6 @@ export const useWorkflowRun = () => {
...restCallback
} = callback || {}
workflowStore.setState({ historyWorkflowData: undefined })
const { backupDraft } = workflowStore.getState()
const {
setNodes,
setEdges,
} = store.getState()
const {
nodes,
edges,
} = backupDraft!
const appDetail = useAppStore.getState().appDetail
const workflowContainer = document.getElementById('workflow-container')
@ -174,6 +166,10 @@ export const useWorkflowRun = () => {
workflowRunningData,
setWorkflowRunningData,
} = workflowStore.getState()
const {
getNodes,
setNodes,
} = store.getState()
setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
draft.task_id = task_id
draft.result = {
@ -183,7 +179,7 @@ export const useWorkflowRun = () => {
}
}))
const newNodes = produce(nodes, (draft) => {
const newNodes = produce(getNodes(), (draft) => {
draft.forEach((node) => {
node.data._runningStatus = NodeRunningStatus.Waiting
})
@ -216,6 +212,13 @@ export const useWorkflowRun = () => {
workflowRunningData,
setWorkflowRunningData,
} = workflowStore.getState()
const {
getNodes,
setNodes,
edges,
setEdges,
} = store.getState()
const nodes = getNodes()
setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
draft.tracing!.push({
...data,
@ -257,6 +260,11 @@ export const useWorkflowRun = () => {
workflowRunningData,
setWorkflowRunningData,
} = workflowStore.getState()
const {
getNodes,
setNodes,
} = store.getState()
const nodes = getNodes()
setWorkflowRunningData(produce(workflowRunningData!, (draft) => {
const currentIndex = draft.tracing!.findIndex(trace => trace.node_id === data.node_id)

View File

@ -17,7 +17,7 @@ import {
import { useStore as useAppStore } from '@/app/components/app/store'
import { fetcChatRunHistory, fetchWorkflowRunHistory } from '@/service/workflow'
import Loading from '@/app/components/base/loading'
import { ClockPlay } from '@/app/components/base/icons/src/vender/line/time'
import { ClockPlaySlim } from '@/app/components/base/icons/src/vender/line/time'
const RunHistory = () => {
const { t } = useTranslation()
@ -67,7 +67,7 @@ const RunHistory = () => {
<div className='flex justify-center items-center h-full'>
<div>
<div className='flex justify-center mb-2'>
<ClockPlay className='w-8 h-8 text-gray-300' />
<ClockPlaySlim className='w-8 h-8 text-gray-300' />
</div>
<div className='text-center text-[13px] text-gray-400'>
{t('workflow.common.notRunning')}

View File

@ -68,7 +68,7 @@ const translation = {
'question-classifier': 'Question Classifier',
'if-else': 'IF/ELSE',
'code': 'Code',
'template-transform': 'Templating Transform',
'template-transform': 'Template',
'http-request': 'HTTP Request',
'variable-assigner': 'Variable Assigner',
},