Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/EDEAI/NexusAI into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
liangweizhi1461875316 committed Dec 12, 2024
2 parents a54449c + d47886c commit a7fb7c4
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 19 deletions.
19 changes: 5 additions & 14 deletions web/src/components/WorkFlow/nodes/RunPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export default memo(() => {
setTabKey('4');
};


useUpdateEffect(() => {
// setLoading(false);

Expand Down Expand Up @@ -207,7 +206,7 @@ export default memo(() => {
if (nodeInfo.status == 3 || (nodeInfo.status == 2 && item?.children)) {
return (
<div className="flex flex-col gap-2">
{nodeInfo?.prompt_data?.length > 0 && (
{nodeInfo?.prompt_data?.length > 0 && (
<div className="h-80">
<CodeEditor
language="python3"
Expand Down Expand Up @@ -358,18 +357,13 @@ export default memo(() => {
);
}
if (nodeInfo?.status == 0) {

}
if (nodeInfo?.status == 1) {

}
if (nodeInfo?.status == 2) {


return <LoadingOutlined />;
}
if (nodeInfo?.status == 3) {

return (
<>
<span>
Expand All @@ -384,7 +378,6 @@ export default memo(() => {
</>
);
} else if (nodeInfo?.status == 4) {

return <span className="text-red-500">ERROR</span>;
}

Expand Down Expand Up @@ -512,9 +505,7 @@ const InputContent = memo(({ onRunResult, loading }: InputContentProps) => {
const run = async value => {
const findEnd = nodes.find(x => x.type == BlockEnum.End);
if (!findEnd) {
return message.error(
intl.formatMessage({ id: 'workflow.notEnd', defaultMessage: '' }),
);
return message.error(intl.formatMessage({ id: 'workflow.notEnd', defaultMessage: '' }));
}

setSubmitLoading(true);
Expand Down Expand Up @@ -639,7 +630,7 @@ const InputContent = memo(({ onRunResult, loading }: InputContentProps) => {
return (
<ProFormDigit
key={index}
label={item.createVar.display_name||item.createVar.name}
label={item.createVar.display_name || item.createVar.name}
name={item.createVar.name}
required={item.createVar.required}
rules={[
Expand All @@ -656,7 +647,7 @@ const InputContent = memo(({ onRunResult, loading }: InputContentProps) => {
return (
<ProFormTextArea
key={index}
label={item.createVar.display_name||item.createVar.name}
label={item.createVar.display_name || item.createVar.name}
name={item.createVar.name}
required={item.createVar.required}
rules={[
Expand All @@ -667,7 +658,7 @@ const InputContent = memo(({ onRunResult, loading }: InputContentProps) => {
]}
></ProFormTextArea>
);
})}
})}
{nodes[0]?.data?.requires_upload && (
<div>
<Typography.Title level={5}>
Expand Down
3 changes: 3 additions & 0 deletions web/src/locales/en-US/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,4 +247,7 @@ export default {
'workflow.vars.variableNameExists': 'Variable name already exists',
'workflow.vars.displayName': 'Display Name',
'workflow.vars.isRequired': 'Is Required',

'workflow.needHumanConfirm': 'Need human confirmation',
'workflow.noHumanConfirm': 'Human confirmation processed',
};
2 changes: 1 addition & 1 deletion web/src/locales/zh-CN/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @LastEditors: biz
*/
export default {
'pages.layouts.userLayout.title': 'NexusAI-人工智能平台',
'pages.layouts.userLayout.title': 'NexusAI-人机协作共生',
'pages.login.accountLogin.tab': '账户密码登录',
'pages.login.accountLogin.errorMessage': '邮箱或密码错误,请重试!',
'pages.login.failure': '登录失败,请重试!',
Expand Down
10 changes: 9 additions & 1 deletion web/src/locales/zh-CN/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,13 @@ export default {
"workflow.vars.variableNamePattern": "变量名称只能包含字母、数字和下划线",
"workflow.vars.variableNameExists": "变量名称已存在",
"workflow.vars.displayName": "显示名称",
"workflow.vars.isRequired": "是否必填"
"workflow.vars.isRequired": "是否必填",

"workflow.needHumanConfirm":"需要人工确认",
"workflow.noHumanConfirm":"已处理人工确认"





};
29 changes: 26 additions & 3 deletions web/src/pages/WorkSpace/components/Backlogs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
*/
import { getBacklogsList } from '@/api/workflow';
import useUserStore from '@/store/user';
import { SwapRightOutlined } from '@ant-design/icons';
import {
CheckCircleOutlined,
ExclamationCircleOutlined,
SwapRightOutlined,
} from '@ant-design/icons';
import { usePagination, useSessionStorageState, useUpdateEffect } from 'ahooks';

import Headportrait from '@/components/headportrait';
import { headportrait } from '@/utils/useUser';
import { useIntl } from '@umijs/max';
import { Empty, Spin } from 'antd';
import { Empty, Spin, Tooltip } from 'antd';
import { useRef } from 'react';
import { Title } from './TableTitle';
export default () => {
Expand Down Expand Up @@ -91,7 +95,7 @@ export default () => {
Image={headportrait('single', item.icon)}
// icon={`/icons/creation/${WORKFLOW_ICON.WorkFlow}.svg`}
></Headportrait>
<div className="flex flex-col gap-1 truncate">
<div className="flex flex-col gap-1 truncate flex-1">
<div>
<span>{item.app_name}</span> <SwapRightOutlined />
<span className="text-[#1B64F3]">{item.node_name}</span>
Expand All @@ -100,6 +104,25 @@ export default () => {
{item.app_run_name}
</div>
</div>
<div>
{item.need_human_confirm ? (
<Tooltip
title={intl.formatMessage({
id: 'workflow.needHumanConfirm',
})}
>
<ExclamationCircleOutlined className="text-[#1B64F3]" />
</Tooltip>
) : (
<Tooltip
title={intl.formatMessage({
id: 'workflow.noHumanConfirm',
})}
>
<CheckCircleOutlined className="text-[#808183]" />
</Tooltip>
)}
</div>
</div>
);
})}
Expand Down

0 comments on commit a7fb7c4

Please sign in to comment.