mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 04:15:53 +08:00
### What problem does this PR solve? feat: add duckduckgo icon #918 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
parent
a2eb0df875
commit
d57a68bc2a
6
web/src/assets/svg/baidu.svg
Normal file
6
web/src/assets/svg/baidu.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg t="1720166509449" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5479"
|
||||
width="200" height="200">
|
||||
<path
|
||||
d="M184.682 538.759c111.177-23.874 96.03-156.737 92.702-185.776-5.445-44.768-58.102-123.02-129.606-116.831-89.98 8.074-103.126 138.052-103.126 138.052-12.17 60.08 29.132 188.452 140.03 164.555zM302.746 769.86c-3.257 9.331-10.517 33.228-4.234 54.03 12.402 46.677 52.912 48.77 52.912 48.77h58.218v-142.31h-62.336c-28.016 8.354-41.535 30.157-44.56 39.51z m88.281-453.898c61.406 0 111.037-70.667 111.037-158.04C502.064 70.643 452.433 0 391.027 0c-61.312 0-111.06 70.643-111.06 157.923 0 87.373 49.77 158.04 111.06 158.04z m264.47 10.447c82.068 10.657 134.84-76.925 145.335-143.31 10.703-66.292-42.256-143.288-100.357-156.527-58.218-13.356-130.909 79.904-137.54 140.704-7.912 74.32 10.633 148.593 92.562 159.133z m201.086 390.213s-126.976-98.24-201.11-204.414C555 355.66 412.272 419.37 364.525 498.993 316.987 578.594 242.9 628.947 232.382 642.28c-10.68 13.124-153.385 90.166-121.694 230.87 31.669 140.612 142.939 137.936 142.939 137.936s81.998 8.074 177.12-13.217c95.168-21.104 177.096 5.26 177.096 5.26s222.284 74.435 283.108-68.852c60.754-143.334-34.368-217.654-34.368-217.654zM476.26 929.88H331.739c-62.406-12.449-87.257-55.03-90.398-62.29-3.072-7.376-20.802-41.604-11.425-99.845 26.968-87.257 103.87-93.516 103.87-93.516h76.926v-94.563l65.524 1V929.88z m269.146-1h-166.3c-64.453-16.614-67.455-62.407-67.455-62.407v-183.89l67.455-1.094v165.276c4.119 17.637 26.015 20.825 26.015 20.825h68.525V682.581h71.76v246.297z m235.408-490.99c0-31.76-26.387-127.394-124.23-127.394-98.008 0-111.108 90.258-111.108 154.06 0 60.894 5.142 145.894 126.883 143.195 121.788-2.7 108.455-137.936 108.455-169.86z m0 0"
|
||||
fill="#3245DF" p-id="5480"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 1.8 KiB |
20
web/src/assets/svg/duck.svg
Normal file
20
web/src/assets/svg/duck.svg
Normal file
@ -0,0 +1,20 @@
|
||||
<svg t="1720166976017" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6815"
|
||||
width="200" height="200">
|
||||
<path d="M514.56 509.44m-486.4 0a486.4 486.4 0 1 0 972.8 0 486.4 486.4 0 1 0-972.8 0Z" fill="#CC6633" p-id="6816">
|
||||
</path>
|
||||
<path d="M512 512m-448 0a448 448 0 1 0 896 0 448 448 0 1 0-896 0Z" fill="#FFFFFF" p-id="6817"></path>
|
||||
<path
|
||||
d="M934.912 516.096c0 199.68-138.24 367.616-324.096 412.672-11.264-21.504-22.016-42.496-31.232-59.904 31.744 28.16 70.144 38.912 91.648 25.6 27.648-16.896 37.376-78.848-5.632-135.168-13.312 0.512-30.72 2.56-50.176 8.192-27.648 8.192-48.128 20.992-61.44 30.72-11.776-17.92-28.16-48.64-36.352-89.6-6.656-33.28-5.12-61.952-2.56-81.408 14.848 10.24 113.664 43.52 162.816 42.496 49.152-1.024 129.536-30.72 120.832-54.784s-88.576 20.992-172.544 13.312c-61.952-5.632-72.704-33.28-58.88-53.76 17.408-25.6 48.64 4.608 100.352-10.752s124.416-43.008 151.04-58.368c61.952-34.816-26.112-49.152-46.592-39.424-19.968 9.216-88.064 26.624-120.32 34.304 17.92-62.976-25.088-172.544-73.216-220.672-15.872-15.872-39.424-25.6-66.56-30.72-10.24-14.336-27.136-28.16-51.2-40.448-46.08-24.064-98.304-32.768-149.504-24.064h-2.56c-6.144 1.024-9.728 3.584-14.848 4.096 6.144 0.512 29.184 11.264 44.032 17.408-7.168 3.072-16.896 4.608-24.576 7.68-3.072 0.512-5.632 1.024-8.704 2.56-7.168 3.072-12.8 15.36-12.288 21.504 34.816-3.584 86.528-1.024 124.416 10.24-26.624 3.584-51.2 10.752-69.12 19.968-0.512 0.512-1.024 0.512-2.048 1.024-2.048 1.024-4.608 1.536-6.144 2.56-56.832 29.696-81.92 99.84-67.072 183.808 13.312 75.776 69.12 336.384 95.232 460.288-164.352-56.32-282.624-214.016-282.624-399.36 0-235.008 190.464-424.96 424.96-424.96s424.96 190.464 424.96 424.96z"
|
||||
fill="#DE5833" p-id="6818"></path>
|
||||
<path d="M389.12 446.976m-31.744 0a31.744 31.744 0 1 0 63.488 0 31.744 31.744 0 1 0-63.488 0Z" fill="#336699"
|
||||
p-id="6819"></path>
|
||||
<path
|
||||
d="M599.552 401.408c-14.848-0.512-27.648 11.264-28.16 26.112s11.264 27.648 26.112 28.16h2.048c14.848 0 27.136-12.288 27.136-27.136s-12.288-27.136-27.136-27.136zM397.824 355.84s-23.552-10.752-46.592 3.584c-23.04 14.848-22.016 29.696-22.016 29.696s-12.288-27.136 20.48-40.448c32.256-13.824 48.64 7.168 48.128 7.168zM615.936 353.792s-16.896-9.728-30.208-9.728c-27.136 0.512-34.816 12.288-34.816 12.288s4.608-28.672 39.424-23.04c11.264 2.56 20.992 9.728 25.6 20.48z"
|
||||
fill="#336699" p-id="6820"></path>
|
||||
<path
|
||||
d="M549.376 522.24c24.576-9.728 35.328-9.728 74.24-17.408 24.576-5.12 56.832-11.776 94.72-23.552 30.208-9.216 36.864-13.824 56.32-15.36 26.112-2.048 62.464 1.024 66.56 15.36 2.048 6.656-4.608 13.824-10.24 20.48-14.336 16.384-32.256 22.016-61.44 30.72-36.352 11.264-38.912 11.264-51.2 15.36-58.368 18.432-55.296 23.552-76.8 25.6-38.912 3.584-60.928-12.8-71.68 0-6.656 8.192-4.608 22.016 0 30.72 6.656 11.776 19.968 15.36 40.96 20.48 25.6 6.144 46.08 5.632 51.2 5.12 18.432-1.024 31.744-4.608 51.2-10.24 40.96-11.776 52.736-21.504 71.68-15.36 3.584 1.024 19.456 6.144 20.48 15.36 2.048 18.432-53.76 43.52-102.4 51.2-47.104 7.168-86.528-2.56-97.28-5.12-7.168-2.048-19.968-6.144-46.08-15.36-29.696-10.24-37.376-13.824-46.08-20.48-9.216-7.168-23.04-17.92-25.6-35.84-2.56-18.432 9.216-33.28 15.36-40.96 9.216-11.264 21.504-20.992 46.08-30.72z"
|
||||
fill="#FDD20A" p-id="6821"></path>
|
||||
<path
|
||||
d="M523.776 798.72c4.096-3.584 9.216-7.168 15.36-10.24 11.776-6.144 22.528-9.216 30.72-10.24-1.536 3.584-3.584 6.656-5.12 10.24 14.336-7.168 29.696-13.824 46.08-20.48 25.088-10.24 49.152-18.432 71.68-25.6 7.68 12.288 22.016 36.864 25.6 71.68 3.584 35.328-5.12 63.488-10.24 76.8-6.144 3.584-32.768 17.408-66.56 10.24s-51.712-30.208-56.32-35.84c-1.536 5.12-3.584 10.24-5.12 15.36-5.632 1.024-14.848 2.048-25.6 0-11.776-2.048-20.48-7.168-25.6-10.24-24.064 11.776-47.616 24.064-71.68 35.84-3.584 4.608-9.728 6.656-15.36 5.12-7.68-2.048-10.24-9.728-10.24-10.24-5.632-16.896-11.264-37.888-15.36-61.44-4.096-25.088-5.12-47.616-5.12-66.56-2.048-6.144 0.512-12.8 5.12-15.36s9.728-0.512 10.24 0c18.944 2.56 44.544 7.68 71.68 20.48 13.824 6.656 26.112 13.824 35.84 20.48z"
|
||||
fill="#66CC33" p-id="6822"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 4.1 KiB |
9
web/src/assets/svg/keyword.svg
Normal file
9
web/src/assets/svg/keyword.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<svg t="1720167308319" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
|
||||
p-id="11640" width="200" height="200">
|
||||
<path
|
||||
d="M419.999992 631.999988v-136.699998c74.443999-50.009999 119.999998-134.033997 119.999997-223.299995C539.999989 123.113998 418.885992 0 269.999995 0S0 123.113998 0 271.999995c0 89.267998 45.555999 173.291997 119.999998 223.299995V871.999983c0 7.968 3.164 15.586 8.789999 21.21l119.999998 121.999997A29.903999 29.903999 0 0 0 269.999995 1023.99998a29.899999 29.899999 0 0 0 21.209999-8.79l119.999998-121.999997c11.718-11.718 11.718-30.703999 0-42.422L372.421993 811.999984l38.789999-38.789999c11.718-11.718 11.718-30.703999 0-42.421999L372.421993 691.999986l38.789999-38.789999A29.979999 29.979999 0 0 0 419.999992 631.999988z m-149.999997-329.999994c-49.627999 0-89.999998-40.371999-89.999999-89.999998s40.371999-89.999998 89.999999-89.999998 89.999998 40.371999 89.999998 89.999998-40.371999 89.999998-89.999998 89.999998z"
|
||||
p-id="11641" fill="#3b76f4"></path>
|
||||
<path
|
||||
d="M933.999982 361.999993c-39.059999 0-72.047999 25.156-84.473999 59.999999H753.999985a30.011999 30.011999 0 0 0-26.835999 16.581999L675.455987 541.999989H509.99999c-16.582 0-29.999999 13.418-29.999999 30s13.418 29.999999 29.999999 29.999999h183.999996a30.011999 30.011999 0 0 0 26.836-16.581999L772.543985 481.999991h76.981998c12.426 34.843999 45.413999 59.999999 84.473999 59.999998 49.627999 0 89.999998-40.371999 89.999998-89.999998s-40.371999-89.999998-89.999998-89.999998zM933.999982 601.999988c-39.059999 0-72.047999 25.156-84.473999 59.999999H509.99999c-16.582 0-29.999999 13.418-29.999999 29.999999s13.418 29.999999 29.999999 30h339.525993c12.426 34.843999 45.413999 59.999999 84.473999 59.999999 49.627999 0 89.999998-40.371999 89.999998-89.999999s-40.371999-89.999998-89.999998-89.999998zM933.999982 841.999984c-39.059999 0-72.047999 25.156-84.473999 59.999998h-76.981998l-51.707999-103.417998A30.011999 30.011999 0 0 0 693.999986 781.999985h-183.999996c-16.582 0-29.999999 13.418-29.999999 29.999999s13.418 29.999999 29.999999 30h165.455997l51.707999 103.417998C732.261986 955.583981 742.631985 963.999981 753.999985 963.999981h95.525998c12.426 34.843999 45.413999 59.999999 84.473999 59.999999 49.627999 0 89.999998-42.371999 89.999998-91.999998s-40.371999-89.999998-89.999998-89.999998zM933.999982 121.999998c-39.059999 0-72.047999 25.156-84.473999 59.999998H753.999985c-10.02 0-19.394 5.01-24.959999 13.36L617.945988 361.999993H569.999989c-16.582 0-29.999999 13.418-30 29.999999s13.418 29.999999 30 30h63.999999c10.02 0 19.394-5.01 24.959999-13.36L770.053985 241.999995h79.471998c12.426 34.843999 45.413999 59.999999 84.473999 59.999999 49.627999 0 89.999998-40.371999 89.999998-89.999998s-40.371999-89.999998-89.999998-89.999998z"
|
||||
p-id="11642" fill="#3b76f4"></path>
|
||||
</svg>
|
After Width: | Height: | Size: 2.8 KiB |
@ -1,3 +1,6 @@
|
||||
import { ReactComponent as BaiduIcon } from '@/assets/svg/baidu.svg';
|
||||
import { ReactComponent as DuckIcon } from '@/assets/svg/duck.svg';
|
||||
import { ReactComponent as KeywordIcon } from '@/assets/svg/keyword.svg';
|
||||
import { variableEnabledFieldMap } from '@/constants/chat';
|
||||
import {
|
||||
BranchesOutlined,
|
||||
@ -19,6 +22,9 @@ export enum Operator {
|
||||
Message = 'Message',
|
||||
Relevant = 'Relevant',
|
||||
RewriteQuestion = 'RewriteQuestion',
|
||||
KeywordExtract = 'KeywordExtract',
|
||||
Baidu = 'Baidu',
|
||||
DuckDuckGo = 'DuckDuckGo',
|
||||
}
|
||||
|
||||
export const operatorIconMap = {
|
||||
@ -30,6 +36,9 @@ export const operatorIconMap = {
|
||||
[Operator.Message]: MessageOutlined,
|
||||
[Operator.Relevant]: BranchesOutlined,
|
||||
[Operator.RewriteQuestion]: FormOutlined,
|
||||
[Operator.KeywordExtract]: KeywordIcon,
|
||||
[Operator.DuckDuckGo]: DuckIcon,
|
||||
[Operator.Baidu]: BaiduIcon,
|
||||
};
|
||||
|
||||
export const operatorMap = {
|
||||
@ -116,6 +125,18 @@ export const componentMenuList = [
|
||||
name: Operator.RewriteQuestion,
|
||||
description: operatorMap[Operator.RewriteQuestion].description,
|
||||
},
|
||||
// {
|
||||
// name: Operator.KeywordExtract,
|
||||
// description: operatorMap[Operator.Message].description,
|
||||
// },
|
||||
// {
|
||||
// name: Operator.DuckDuckGo,
|
||||
// description: operatorMap[Operator.Relevant].description,
|
||||
// },
|
||||
// {
|
||||
// name: Operator.Baidu,
|
||||
// description: operatorMap[Operator.RewriteQuestion].description,
|
||||
// },
|
||||
];
|
||||
|
||||
export const initialRetrievalValues = {
|
||||
@ -200,11 +221,21 @@ export const CategorizeAnchorPointPositions = [
|
||||
// key is the source of the edge, value is the target of the edge
|
||||
// no connection lines are allowed between key and value
|
||||
export const RestrictedUpstreamMap = {
|
||||
[Operator.Begin]: [],
|
||||
[Operator.Categorize]: [Operator.Begin, Operator.Categorize, Operator.Answer],
|
||||
[Operator.Answer]: [Operator.Begin, Operator.Answer, Operator.Message],
|
||||
[Operator.Retrieval]: [Operator.Begin, Operator.Relevant],
|
||||
[Operator.Generate]: [Operator.Begin],
|
||||
[Operator.Begin]: [Operator.Relevant],
|
||||
[Operator.Categorize]: [
|
||||
Operator.Begin,
|
||||
Operator.Categorize,
|
||||
Operator.Answer,
|
||||
Operator.Relevant,
|
||||
],
|
||||
[Operator.Answer]: [
|
||||
Operator.Begin,
|
||||
Operator.Answer,
|
||||
Operator.Message,
|
||||
Operator.Relevant,
|
||||
],
|
||||
[Operator.Retrieval]: [Operator.Begin, Operator.Retrieval],
|
||||
[Operator.Generate]: [Operator.Begin, Operator.Relevant],
|
||||
[Operator.Message]: [
|
||||
Operator.Begin,
|
||||
Operator.Message,
|
||||
@ -212,14 +243,16 @@ export const RestrictedUpstreamMap = {
|
||||
Operator.Retrieval,
|
||||
Operator.RewriteQuestion,
|
||||
Operator.Categorize,
|
||||
Operator.Relevant,
|
||||
],
|
||||
[Operator.Relevant]: [Operator.Begin, Operator.Answer],
|
||||
[Operator.Relevant]: [Operator.Begin, Operator.Answer, Operator.Relevant],
|
||||
[Operator.RewriteQuestion]: [
|
||||
Operator.Begin,
|
||||
Operator.Message,
|
||||
Operator.Generate,
|
||||
Operator.RewriteQuestion,
|
||||
Operator.Categorize,
|
||||
Operator.Relevant,
|
||||
],
|
||||
};
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { useTranslate } from '@/hooks/commonHooks';
|
||||
import { Card, Flex, Layout, Space, Tooltip } from 'antd';
|
||||
import { Card, Divider, Flex, Layout, Tooltip } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import lowerFirst from 'lodash/lowerFirst';
|
||||
import { componentMenuList } from '../constant';
|
||||
import { Operator, componentMenuList } from '../constant';
|
||||
import { useHandleDrag } from '../hooks';
|
||||
import OperatorIcon from '../operator-icon';
|
||||
import styles from './index.less';
|
||||
@ -29,24 +29,35 @@ const FlowSide = ({ setCollapsed, collapsed }: IProps) => {
|
||||
<Flex vertical gap={10} className={styles.siderContent}>
|
||||
{componentMenuList.map((x) => {
|
||||
return (
|
||||
<Card
|
||||
key={x.name}
|
||||
hoverable
|
||||
draggable
|
||||
className={classNames(styles.operatorCard)}
|
||||
onDragStart={handleDragStart(x.name)}
|
||||
>
|
||||
<Flex justify="space-between" align="center">
|
||||
<Space size={15}>
|
||||
<>
|
||||
{x.name === Operator.DuckDuckGo && (
|
||||
<Divider
|
||||
style={{
|
||||
marginTop: 10,
|
||||
marginBottom: 10,
|
||||
padding: 0,
|
||||
borderBlockColor: '#b4afaf',
|
||||
borderStyle: 'dotted',
|
||||
}}
|
||||
></Divider>
|
||||
)}
|
||||
<Card
|
||||
key={x.name}
|
||||
hoverable
|
||||
draggable
|
||||
className={classNames(styles.operatorCard)}
|
||||
onDragStart={handleDragStart(x.name)}
|
||||
>
|
||||
<Flex align="center" gap={15}>
|
||||
<OperatorIcon name={x.name}></OperatorIcon>
|
||||
<section>
|
||||
<Tooltip title={t(`${lowerFirst(x.name)}Description`)}>
|
||||
<b>{x.name}</b>
|
||||
</Tooltip>
|
||||
</section>
|
||||
</Space>
|
||||
</Flex>
|
||||
</Card>
|
||||
</Flex>
|
||||
</Card>
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</Flex>
|
||||
|
@ -1,4 +1,6 @@
|
||||
.icon {
|
||||
color: rgb(59, 118, 244);
|
||||
font-size: 24px;
|
||||
max-width: 24px;
|
||||
max-height: 24px;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user