diff --git a/web/app/components/app/workflow-log/list.tsx b/web/app/components/app/workflow-log/list.tsx index b01c049d53..229e13d255 100644 --- a/web/app/components/app/workflow-log/list.tsx +++ b/web/app/components/app/workflow-log/list.tsx @@ -55,6 +55,14 @@ const WorkflowAppLogList: FC = ({ logs, appDetail, onRefresh }) => { ) } + if (status === 'suspended') { + return ( +
+ + Pending +
+ ) + } if (status === 'running') { return (
diff --git a/web/app/components/workflow/run/node.tsx b/web/app/components/workflow/run/node.tsx index a4df5f4c74..538f9bc618 100644 --- a/web/app/components/workflow/run/node.tsx +++ b/web/app/components/workflow/run/node.tsx @@ -8,6 +8,7 @@ import { RiCheckboxCircleFill, RiErrorWarningLine, RiLoader2Line, + RiPauseCircleFill, } from '@remixicon/react' import BlockIcon from '../block-icon' import { BlockEnum } from '../types' @@ -152,6 +153,9 @@ const NodePanel: FC = ({ {nodeInfo.status === 'stopped' && ( )} + {nodeInfo.status === 'suspended' && ( + + )} {nodeInfo.status === 'exception' && ( )} @@ -222,6 +226,11 @@ const NodePanel: FC = ({ {nodeInfo.error} )} + {(nodeInfo.status === 'suspended') && ( + +
{t('workflow.nodes.humanInput.log.reasonContent')}
+
+ )}
{nodeInfo.inputs && (
diff --git a/web/app/components/workflow/run/status-container.tsx b/web/app/components/workflow/run/status-container.tsx index 47890da0b2..34657d931b 100644 --- a/web/app/components/workflow/run/status-container.tsx +++ b/web/app/components/workflow/run/status-container.tsx @@ -27,9 +27,9 @@ const StatusContainer: FC = ({ status === 'failed' && 'border-[rgba(240,68,56,0.8)] bg-workflow-display-error-bg bg-[url(~@/app/components/workflow/run/assets/bg-line-error.svg)] text-text-warning', status === 'failed' && theme === Theme.light && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.5),inset_0_1px_3px_0_rgba(0,0,0,0.12),inset_0_2px_24px_0_rgba(240,68,56,0.2),0_1px_2px_0_rgba(9,9,11,0.05),0_0_0_1px_rgba(0,0,0,0.05)]', status === 'failed' && theme === Theme.dark && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.12),inset_0_1px_3px_0_rgba(0,0,0,0.4),inset_0_2px_24px_0_rgba(240,68,56,0.25),0_1px_2px_0_rgba(0,0,0,0.1),0_0_0_1px_rgba(24, 24, 27, 0.95)]', - status === 'stopped' && 'border-[rgba(247,144,9,0.8)] bg-workflow-display-warning-bg bg-[url(~@/app/components/workflow/run/assets/bg-line-warning.svg)] text-text-destructive', - status === 'stopped' && theme === Theme.light && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.5),inset_0_1px_3px_0_rgba(0,0,0,0.12),inset_0_2px_24px_0_rgba(247,144,9,0.2),0_1px_2px_0_rgba(9,9,11,0.05),0_0_0_1px_rgba(0,0,0,0.05)]', - status === 'stopped' && theme === Theme.dark && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.12),inset_0_1px_3px_0_rgba(0,0,0,0.4),inset_0_2px_24px_0_rgba(247,144,9,0.25),0_1px_2px_0_rgba(0,0,0,0.1),0_0_0_1px_rgba(24, 24, 27, 0.95)]', + (status === 'stopped' || status === 'suspended') && 'border-[rgba(247,144,9,0.8)] bg-workflow-display-warning-bg bg-[url(~@/app/components/workflow/run/assets/bg-line-warning.svg)] text-text-destructive', + (status === 'stopped' || status === 'suspended') && theme === Theme.light && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.5),inset_0_1px_3px_0_rgba(0,0,0,0.12),inset_0_2px_24px_0_rgba(247,144,9,0.2),0_1px_2px_0_rgba(9,9,11,0.05),0_0_0_1px_rgba(0,0,0,0.05)]', + (status === 'stopped' || status === 'suspended') && theme === Theme.dark && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.12),inset_0_1px_3px_0_rgba(0,0,0,0.4),inset_0_2px_24px_0_rgba(247,144,9,0.25),0_1px_2px_0_rgba(0,0,0,0.1),0_0_0_1px_rgba(24, 24, 27, 0.95)]', status === 'exception' && 'border-[rgba(247,144,9,0.8)] bg-workflow-display-warning-bg bg-[url(~@/app/components/workflow/run/assets/bg-line-warning.svg)] text-text-destructive', status === 'exception' && theme === Theme.light && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.5),inset_0_1px_3px_0_rgba(0,0,0,0.12),inset_0_2px_24px_0_rgba(247,144,9,0.2),0_1px_2px_0_rgba(9,9,11,0.05),0_0_0_1px_rgba(0,0,0,0.05)]', status === 'exception' && theme === Theme.dark && 'shadow-[inset_2px_2px_0_0_rgba(255,255,255,0.12),inset_0_1px_3px_0_rgba(0,0,0,0.4),inset_0_2px_24px_0_rgba(247,144,9,0.25),0_1px_2px_0_rgba(0,0,0,0.1),0_0_0_1px_rgba(24, 24, 27, 0.95)]', diff --git a/web/app/components/workflow/run/status.tsx b/web/app/components/workflow/run/status.tsx index 253aaab3a1..243df90f46 100644 --- a/web/app/components/workflow/run/status.tsx +++ b/web/app/components/workflow/run/status.tsx @@ -12,6 +12,7 @@ type ResultProps = { tokens?: number error?: string exceptionCounts?: number + inputURL?: string } const StatusPanel: FC = ({ @@ -20,6 +21,7 @@ const StatusPanel: FC = ({ tokens, error, exceptionCounts, + inputURL, }) => { const { t } = useTranslation() const docLink = useDocLink() @@ -38,7 +40,7 @@ const StatusPanel: FC = ({ status === 'succeeded' && 'text-util-colors-green-green-600', status === 'partial-succeeded' && 'text-util-colors-green-green-600', status === 'failed' && 'text-util-colors-red-red-600', - status === 'stopped' && 'text-util-colors-warning-warning-600', + (status === 'stopped' || status === 'suspended') && 'text-util-colors-warning-warning-600', status === 'running' && 'text-util-colors-blue-light-blue-light-600', )} > @@ -78,15 +80,21 @@ const StatusPanel: FC = ({ STOP )} + {status === 'suspended' && ( + <> + + PENDING + + )}
{t('runLog.resultPanel.time')}
- {status === 'running' && ( + {(status === 'running' || status === 'suspended') && (
)} - {status !== 'running' && ( + {status !== 'running' && status !== 'suspended' && ( {time ? `${time?.toFixed(3)}s` : '-'} )}
@@ -94,10 +102,10 @@ const StatusPanel: FC = ({
{t('runLog.resultPanel.tokens')}
- {status === 'running' && ( + {(status === 'running' || status === 'suspended') && (
)} - {status !== 'running' && ( + {status !== 'running' && status !== 'suspended' && ( {`${tokens || 0} Tokens`} )}
@@ -146,6 +154,25 @@ const StatusPanel: FC = ({ ) } + {status === 'suspended' && ( + <> +
+
+
+
{t('workflow.nodes.humanInput.log.reason')}
+
{t('workflow.nodes.humanInput.log.reasonContent')}
+
+
+
{t('workflow.nodes.humanInput.log.inputURL')}
+ {inputURL} +
+
+ + )} ) } diff --git a/web/i18n/en-US/workflow.ts b/web/i18n/en-US/workflow.ts index c3e0b38b71..32addac076 100644 --- a/web/i18n/en-US/workflow.ts +++ b/web/i18n/en-US/workflow.ts @@ -982,6 +982,11 @@ const translation = { noDeliveryMethodEnabled: 'Please enable at least one delivery method', noUserActions: 'Please add at least one user action', }, + log: { + reason: 'Reason:', + reasonContent: 'Human input required to proceed', + inputURL: 'Input URL:', + }, }, }, tracing: { diff --git a/web/i18n/zh-Hans/workflow.ts b/web/i18n/zh-Hans/workflow.ts index 2e6ef82e69..8b1c431b21 100644 --- a/web/i18n/zh-Hans/workflow.ts +++ b/web/i18n/zh-Hans/workflow.ts @@ -983,6 +983,11 @@ const translation = { noDeliveryMethodEnabled: '请至少启用一种提交方式', noUserActions: '请添加至少一个用户操作', }, + log: { + reason: '原因:', + reasonContent: '需要人类输入才能继续', + inputURL: '输入 URL :', + }, }, }, tracing: {