From 512b6e4b1481f574e6ee264cbbed642687a12783 Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 23 Apr 2025 15:05:46 +0800 Subject: [PATCH] feat: last run no data --- .../_base/components/workflow-panel/index.tsx | 8 ++--- .../{last-run.tsx => last-run/index.tsx} | 8 ++++- .../workflow-panel/last-run/no-data.tsx | 30 +++++++++++++++++++ 3 files changed, 41 insertions(+), 5 deletions(-) rename web/app/components/workflow/nodes/_base/components/workflow-panel/{last-run.tsx => last-run/index.tsx} (88%) create mode 100644 web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/no-data.tsx diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx b/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx index 42d00c7606..c982f0ca15 100644 --- a/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx +++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/index.tsx @@ -167,7 +167,7 @@ const BasePanel: FC = ({ setSingleRunParams(childPanelRef.current?.singleRunParams) }, [doSetRunInputData]) - const [tabType, setTabType] = useState(TabType.settings) + const [tabType, setTabType] = useState(TabType.lastRun) const handleRun = async (data: Record) => { setTabType(TabType.lastRun) callRunApi(data) @@ -177,7 +177,7 @@ const BasePanel: FC = ({ return (
= ({
-
+
= ({ setRunResult(getLastRunNodeInfo(nodeId)) // eslint-disable-next-line react-hooks/exhaustive-deps }, [runningStatus]) + + const handleSingleRun = () => { + console.log('run') + } + if (isRunning) return if (!runResult) { return ( -
no data
+ ) } return ( diff --git a/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/no-data.tsx b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/no-data.tsx new file mode 100644 index 0000000000..734d894811 --- /dev/null +++ b/web/app/components/workflow/nodes/_base/components/workflow-panel/last-run/no-data.tsx @@ -0,0 +1,30 @@ +'use client' +import type { FC } from 'react' +import React from 'react' +import { ClockPlay } from '@/app/components/base/icons/src/vender/line/time' +import Button from '@/app/components/base/button' +import { RiPlayLine } from '@remixicon/react' + +type Props = { + onSingleRun: () => void +} + +const NoData: FC = ({ + onSingleRun, +}) => { + return ( +
+ +
The results of the last run will be displayed here
+ +
+ ) +} +export default React.memo(NoData)