mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 12:55:52 +08:00
### What problem does this PR solve? feat: add icon to title of operator form #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
0f597b9817
commit
1f967191d4
@ -567,6 +567,7 @@ The above is the content you need to summarize.`,
|
|||||||
operation: 'operation',
|
operation: 'operation',
|
||||||
run: 'Run',
|
run: 'Run',
|
||||||
save: 'Save',
|
save: 'Save',
|
||||||
|
title: 'Title:',
|
||||||
beginDescription: 'This is where the flow begin',
|
beginDescription: 'This is where the flow begin',
|
||||||
answerDescription: `This component is used as an interface between bot and human. It receives input of user and display the result of the computation of the bot.`,
|
answerDescription: `This component is used as an interface between bot and human. It receives input of user and display the result of the computation of the bot.`,
|
||||||
retrievalDescription: `This component is for the process of retrieving relevent information from knowledge base. So, knowledgebases should be selected. If there's nothing retrieved, the 'Empty response' will be returned.`,
|
retrievalDescription: `This component is for the process of retrieving relevent information from knowledge base. So, knowledgebases should be selected. If there's nothing retrieved, the 'Empty response' will be returned.`,
|
||||||
|
@ -527,6 +527,7 @@ export default {
|
|||||||
operation: '操作',
|
operation: '操作',
|
||||||
run: '運行',
|
run: '運行',
|
||||||
save: '儲存',
|
save: '儲存',
|
||||||
|
title: '標題:',
|
||||||
beginDescription: '這是流程開始的地方',
|
beginDescription: '這是流程開始的地方',
|
||||||
answerDescription: `該組件用作機器人與人類之間的介面。它接收使用者的輸入並顯示機器人的計算結果。`,
|
answerDescription: `該組件用作機器人與人類之間的介面。它接收使用者的輸入並顯示機器人的計算結果。`,
|
||||||
retrievalDescription: `此元件用於從知識庫中檢索相關資訊。選擇知識庫。如果沒有檢索到任何內容,將傳回「空響應」。`,
|
retrievalDescription: `此元件用於從知識庫中檢索相關資訊。選擇知識庫。如果沒有檢索到任何內容,將傳回「空響應」。`,
|
||||||
|
@ -546,6 +546,7 @@ export default {
|
|||||||
operation: '操作',
|
operation: '操作',
|
||||||
run: '运行',
|
run: '运行',
|
||||||
save: '保存',
|
save: '保存',
|
||||||
|
title: '标题:',
|
||||||
beginDescription: '这是流程开始的地方',
|
beginDescription: '这是流程开始的地方',
|
||||||
answerDescription: `该组件用作机器人与人类之间的接口。它接收用户的输入并显示机器人的计算结果。`,
|
answerDescription: `该组件用作机器人与人类之间的接口。它接收用户的输入并显示机器人的计算结果。`,
|
||||||
retrievalDescription: `此组件用于从知识库中检索相关信息。选择知识库。如果没有检索到任何内容,将返回“空响应”。`,
|
retrievalDescription: `此组件用于从知识库中检索相关信息。选择知识库。如果没有检索到任何内容,将返回“空响应”。`,
|
||||||
|
3
web/src/pages/flow/flow-drawer/index.less
Normal file
3
web/src/pages/flow/flow-drawer/index.less
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.title {
|
||||||
|
flex-basis: 60px;
|
||||||
|
}
|
@ -1,5 +1,6 @@
|
|||||||
|
import { useTranslate } from '@/hooks/commonHooks';
|
||||||
import { IModalProps } from '@/interfaces/common';
|
import { IModalProps } from '@/interfaces/common';
|
||||||
import { Drawer, Form, Input } from 'antd';
|
import { Drawer, Flex, Form, Input } from 'antd';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { Node } from 'reactflow';
|
import { Node } from 'reactflow';
|
||||||
import AnswerForm from '../answer-form';
|
import AnswerForm from '../answer-form';
|
||||||
@ -9,10 +10,13 @@ import { Operator } from '../constant';
|
|||||||
import GenerateForm from '../generate-form';
|
import GenerateForm from '../generate-form';
|
||||||
import { useHandleFormValuesChange, useHandleNodeNameChange } from '../hooks';
|
import { useHandleFormValuesChange, useHandleNodeNameChange } from '../hooks';
|
||||||
import MessageForm from '../message-form';
|
import MessageForm from '../message-form';
|
||||||
|
import OperatorIcon from '../operator-icon';
|
||||||
import RelevantForm from '../relevant-form';
|
import RelevantForm from '../relevant-form';
|
||||||
import RetrievalForm from '../retrieval-form';
|
import RetrievalForm from '../retrieval-form';
|
||||||
import RewriteQuestionForm from '../rewrite-question-form';
|
import RewriteQuestionForm from '../rewrite-question-form';
|
||||||
|
|
||||||
|
import styles from './index.less';
|
||||||
|
|
||||||
interface IProps {
|
interface IProps {
|
||||||
node?: Node;
|
node?: Node;
|
||||||
}
|
}
|
||||||
@ -40,6 +44,7 @@ const FlowDrawer = ({
|
|||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const { name, handleNameBlur, handleNameChange } =
|
const { name, handleNameBlur, handleNameChange } =
|
||||||
useHandleNodeNameChange(node);
|
useHandleNodeNameChange(node);
|
||||||
|
const { t } = useTranslate('flow');
|
||||||
|
|
||||||
const { handleValuesChange } = useHandleFormValuesChange(node?.id);
|
const { handleValuesChange } = useHandleFormValuesChange(node?.id);
|
||||||
|
|
||||||
@ -52,11 +57,19 @@ const FlowDrawer = ({
|
|||||||
return (
|
return (
|
||||||
<Drawer
|
<Drawer
|
||||||
title={
|
title={
|
||||||
|
<Flex gap={'middle'} align="center">
|
||||||
|
<OperatorIcon name={operatorName}></OperatorIcon>
|
||||||
|
<Flex align="center" gap={'small'} flex={1}>
|
||||||
|
<label htmlFor="" className={styles.title}>
|
||||||
|
{t('title')}
|
||||||
|
</label>
|
||||||
<Input
|
<Input
|
||||||
value={name}
|
value={name}
|
||||||
onBlur={handleNameBlur}
|
onBlur={handleNameBlur}
|
||||||
onChange={handleNameChange}
|
onChange={handleNameChange}
|
||||||
></Input>
|
></Input>
|
||||||
|
</Flex>
|
||||||
|
</Flex>
|
||||||
}
|
}
|
||||||
placement="right"
|
placement="right"
|
||||||
onClose={hideModal}
|
onClose={hideModal}
|
||||||
|
@ -13,8 +13,8 @@ const GenerateForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 6 }}
|
labelCol={{ span: 5 }}
|
||||||
wrapperCol={{ span: 18 }}
|
wrapperCol={{ span: 19 }}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
|
@ -23,8 +23,8 @@ const RelevantForm = ({ onValuesChange, form, node }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 6 }}
|
labelCol={{ span: 4 }}
|
||||||
wrapperCol={{ span: 18 }}
|
wrapperCol={{ span: 20 }}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
|
@ -11,8 +11,8 @@ const RewriteQuestionForm = ({ onValuesChange, form }: IOperatorForm) => {
|
|||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
name="basic"
|
name="basic"
|
||||||
labelCol={{ span: 6 }}
|
labelCol={{ span: 4 }}
|
||||||
wrapperCol={{ span: 18 }}
|
wrapperCol={{ span: 20 }}
|
||||||
onValuesChange={onValuesChange}
|
onValuesChange={onValuesChange}
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
form={form}
|
form={form}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user