From 84e2071a32873d9edc27c97978d0619b7f865e13 Mon Sep 17 00:00:00 2001 From: StyleZhang Date: Mon, 11 Mar 2024 18:10:35 +0800 Subject: [PATCH] run --- web/app/components/workflow/header/index.tsx | 14 +- .../workflow/header/run-and-history.tsx | 127 ++++++++++++------ web/app/components/workflow/hooks.ts | 97 ++++++++++++- web/app/components/workflow/index.tsx | 13 +- .../components/workflow/nodes/_base/node.tsx | 22 +-- .../components/workflow/operator/index.tsx | 2 +- web/app/components/workflow/panel/index.tsx | 15 ++- .../workflow/panel/inputs-panel.tsx | 8 +- web/app/components/workflow/panel/record.tsx | 6 +- web/app/components/workflow/store.ts | 16 ++- web/app/components/workflow/utils.ts | 29 +++- web/service/base.ts | 24 +++- 12 files changed, 280 insertions(+), 93 deletions(-) diff --git a/web/app/components/workflow/header/index.tsx b/web/app/components/workflow/header/index.tsx index f5cc8d889d..e1f4a73d30 100644 --- a/web/app/components/workflow/header/index.tsx +++ b/web/app/components/workflow/header/index.tsx @@ -14,15 +14,13 @@ import { Grid01 } from '@/app/components/base/icons/src/vender/line/layout' import Button from '@/app/components/base/button' import { ArrowNarrowLeft } from '@/app/components/base/icons/src/vender/line/arrows' import { useStore as useAppStore } from '@/app/components/app/store' -import { Mode } from '@/app/components/workflow/types' const Header: FC = () => { const { t } = useTranslation() const appDetail = useAppStore(s => s.appDetail) const appSidebarExpand = useAppStore(s => s.appSidebarExpand) const isChatMode = useIsChatMode() - const mode = useStore(state => state.mode) - const runTaskId = useStore(state => state.runTaskId) + const runningStatus = useStore(s => s.runningStatus) const handleShowFeatures = useCallback(() => { useStore.setState({ showFeaturesPanel: true }) @@ -37,26 +35,26 @@ const Header: FC = () => { >
{ - appSidebarExpand && ( + appSidebarExpand === 'collapse' && (
{appDetail?.name}
) } { - mode === Mode.Editing && !runTaskId && + !runningStatus && } { - (mode === Mode.Running || runTaskId) && + runningStatus && }
{ - (mode === Mode.Running || runTaskId) && ( + runningStatus && (