4.8.6 merge (#1943)

* Dataset collection forbid (#1885)

* perf: tool call support same id

* feat: collection forbid

* feat: collection forbid

* Inheritance Permission for apps (#1897)

* feat: app schema define

chore: references of authapp

* feat: authApp method inheritance

* feat: create and update api

* feat: update

* feat: inheritance Permission controller for app.

* feat: abstract version of inheritPermission

* feat: ancestorId for apps

* chore: update app

* fix: inheritPermission abstract version

* feat: update folder defaultPermission

* feat: app update api

* chore: inheritance frontend

* chore: app list api

* feat: update defaultPermission in app deatil

* feat: backend api finished

* feat: app inheritance permission fe

* fix: app update defaultpermission causes collaborator miss

* fix: ts error

* chore: adjust the codes

* chore: i18n

chore: i18n

* chore: fe adjust and i18n

* chore: adjust the code

* feat: resume api;
chore: rewrite update api and inheritPermission methods

* chore: something

* chore: fe code adjusting

* feat: frontend adjusting

* chore: fe code adjusting

* chore: adjusting the code

* perf: fe loading

* format

* Inheritance fix (#1908)

* fix: SlideCard

* fix: authapp did not return parent app for inheritance app

* fix: fe adjusting

* feat: fe adjusing

* perf: inherit per ux

* doc

* fix: ts errors (#1916)

* perf: inherit permission

* fix: permission inherit

* Workflow type (#1938)

* perf: workflow type

tmp workflow

perf: workflow type

feat: custom field config

* perf: dynamic input

* perf: node classify

* perf: node classify

* perf: node classify

* perf: node classify

* fix: workflow custom input

* feat: text editor and customFeedback move to basic nodes

* feat: community system plugin

* fix: ts

* feat: exprEval plugin

* perf: workflow type

* perf: plugin important

* fix: default templates

* perf: markdown hr css

* lock

* perf: fetch url

* perf: new plugin version

* fix: chat histories update

* fix: collection paths invalid

* perf: app card ui

---------

Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
Archer
2024-07-04 17:42:09 +08:00
committed by GitHub
parent babf03c218
commit a9cdece341
303 changed files with 18883 additions and 13149 deletions

View File

@@ -100,6 +100,7 @@ export const iconPaths = {
'core/chat/chatFill': () => import('./icons/core/chat/chatFill.svg'),
'core/chat/chatLight': () => import('./icons/core/chat/chatLight.svg'),
'core/chat/chatModelTag': () => import('./icons/core/chat/chatModelTag.svg'),
'core/chat/export/pdf': () => import('./icons/core/chat/export/pdf.svg'),
'core/chat/feedback/badLight': () => import('./icons/core/chat/feedback/badLight.svg'),
'core/chat/feedback/goodLight': () => import('./icons/core/chat/feedback/goodLight.svg'),
'core/chat/fileSelect': () => import('./icons/core/chat/fileSelect.svg'),

View File

@@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 17">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.66667 2.48353C8.53982 2.47295 8.3545 2.47125 8.00785 2.47125H5.86667C5.29628 2.47125 4.90614 2.47171 4.60405 2.49488C4.30859 2.51754 4.15443 2.55893 4.04634 2.61063C3.7917 2.73242 3.59259 2.92289 3.47057 3.14769C3.42305 3.23524 3.38143 3.3648 3.35807 3.63314C3.33392 3.91059 3.33333 4.27096 3.33333 4.80839V11.3166C3.33333 11.854 3.33392 12.2144 3.35807 12.4919C3.38143 12.7602 3.42305 12.8898 3.47057 12.9773C3.59259 13.2021 3.79169 13.3926 4.04634 13.5144C4.15443 13.5661 4.30859 13.6075 4.60405 13.6301C4.90614 13.6533 5.29628 13.6538 5.86667 13.6538H10.1333C10.7037 13.6538 11.0939 13.6533 11.396 13.6301C11.6914 13.6075 11.8456 13.5661 11.9537 13.5144C12.2083 13.3926 12.4074 13.2021 12.5294 12.9773C12.577 12.8898 12.6186 12.7602 12.6419 12.4919C12.6661 12.2144 12.6667 11.854 12.6667 11.3166V6.80355C12.6667 6.50209 12.6649 6.33604 12.6567 6.226L10.3796 6.226C10.2106 6.22602 10.0482 6.22604 9.91116 6.21553C9.76194 6.20408 9.58682 6.17726 9.40969 6.09255C9.16257 5.97435 8.95372 5.78188 8.82008 5.53569C8.72228 5.3555 8.69124 5.17597 8.67826 5.0269C8.66662 4.8931 8.66664 4.7361 8.66667 4.57967C8.66667 4.57247 8.66667 4.56527 8.66667 4.55807V2.48353ZM9.5789 1.35323C9.43034 1.29091 9.27618 1.24167 9.11836 1.2061C8.8144 1.1376 8.49918 1.13773 8.07363 1.1379C8.05199 1.13791 8.03007 1.13792 8.00785 1.13792L5.84058 1.13792C5.30269 1.13791 4.86122 1.13791 4.50209 1.16545C4.13054 1.19395 3.79077 1.25487 3.47104 1.40779C2.97303 1.64598 2.56021 2.02992 2.29874 2.51161C2.12827 2.82566 2.0609 3.15974 2.02976 3.51752C1.99998 3.85966 1.99999 4.27839 2 4.77963V11.3454C1.99999 11.8466 1.99998 12.2653 2.02976 12.6075C2.0609 12.9653 2.12827 13.2993 2.29874 13.6134C2.56021 14.0951 2.97303 14.479 3.47104 14.7172C3.79077 14.8701 4.13054 14.9311 4.50209 14.9596C4.86121 14.9871 5.30268 14.9871 5.84055 14.9871H10.1595C10.6973 14.9871 11.1388 14.9871 11.4979 14.9596C11.8695 14.9311 12.2092 14.8701 12.529 14.7172C13.027 14.479 13.4398 14.0951 13.7013 13.6134C13.8717 13.2993 13.9391 12.9653 13.9702 12.6075C14 12.2653 14 11.8466 14 11.3454V6.80355C14 6.7806 14 6.75793 14 6.73553C14.0003 6.3426 14.0005 6.03268 13.924 5.73352C13.8843 5.57857 13.8297 5.42814 13.7611 5.28406C13.7565 5.27396 13.7516 5.264 13.7466 5.25417C13.7021 5.16392 13.6521 5.07625 13.5969 4.99161C13.4285 4.73377 13.1997 4.51924 12.9024 4.24039C12.8859 4.22496 12.8692 4.20932 12.8523 4.19347L10.7269 2.19831C10.7108 2.18321 10.6949 2.1683 10.6792 2.15357C10.3796 1.87201 10.1528 1.65893 9.88232 1.50336C9.7944 1.45278 9.70372 1.40723 9.61076 1.36684C9.60029 1.36204 9.58966 1.3575 9.5789 1.35323ZM10 3.34474V4.55807C10 4.72277 10.0005 4.81805 10.0047 4.88541C10.0073 4.88564 10.0102 4.88587 10.0131 4.8861C10.0929 4.89221 10.203 4.89267 10.4 4.89267H11.649L10 3.34474Z" />
<path d="M4.36217 12.3512C4.24484 12.3512 4.15417 12.3192 4.09017 12.2552C4.02617 12.1885 3.99417 12.0965 3.99417 11.9792V9.86719C3.99417 9.74719 4.02617 9.65519 4.09017 9.59119C4.15684 9.52719 4.24884 9.49519 4.36617 9.49519H5.35017C5.67017 9.49519 5.91684 9.57785 6.09017 9.74319C6.26617 9.90585 6.35417 10.1312 6.35417 10.4192C6.35417 10.7072 6.26617 10.9339 6.09017 11.0992C5.91684 11.2619 5.67017 11.3432 5.35017 11.3432H4.73017V11.9792C4.73017 12.0965 4.6995 12.1885 4.63817 12.2552C4.57684 12.3192 4.48484 12.3512 4.36217 12.3512ZM4.73017 10.7792H5.22217C5.36084 10.7792 5.4675 10.7499 5.54217 10.6912C5.61684 10.6299 5.65417 10.5392 5.65417 10.4192C5.65417 10.2965 5.61684 10.2059 5.54217 10.1472C5.4675 10.0885 5.36084 10.0592 5.22217 10.0592H4.73017V10.7792Z" />
<path d="M7.16129 12.3152C7.03596 12.3152 6.93996 12.2832 6.87329 12.2192C6.80929 12.1525 6.77729 12.0579 6.77729 11.9352V9.87519C6.77729 9.75252 6.80929 9.65919 6.87329 9.59519C6.93996 9.52852 7.03596 9.49519 7.16129 9.49519H7.94529C8.43596 9.49519 8.81463 9.61785 9.08129 9.86319C9.35063 10.1085 9.48529 10.4552 9.48529 10.9032C9.48529 11.1272 9.45063 11.3272 9.38129 11.5032C9.31196 11.6765 9.21196 11.8245 9.08129 11.9472C8.95063 12.0672 8.78929 12.1592 8.59729 12.2232C8.40796 12.2845 8.19063 12.3152 7.94529 12.3152H7.16129ZM7.51329 11.7192H7.89729C8.03863 11.7192 8.15996 11.7019 8.26129 11.6672C8.36529 11.6325 8.45063 11.5819 8.51729 11.5152C8.58663 11.4485 8.63729 11.3645 8.66929 11.2632C8.70396 11.1619 8.72129 11.0419 8.72129 10.9032C8.72129 10.6259 8.65329 10.4219 8.51729 10.2912C8.38129 10.1579 8.17463 10.0912 7.89729 10.0912H7.51329V11.7192Z" />
<path d="M10.3738 12.3512C10.2565 12.3512 10.1645 12.3192 10.0978 12.2552C10.0338 12.1885 10.0018 12.0939 10.0018 11.9712V9.87519C10.0018 9.75252 10.0338 9.65919 10.0978 9.59519C10.1645 9.52852 10.2605 9.49519 10.3858 9.49519H11.7178C11.8138 9.49519 11.8858 9.51919 11.9338 9.56719C11.9818 9.61519 12.0058 9.68452 12.0058 9.77519C12.0058 9.86852 11.9818 9.94052 11.9338 9.99119C11.8858 10.0392 11.8138 10.0632 11.7178 10.0632H10.7378V10.6312H11.6298C11.7232 10.6312 11.7938 10.6552 11.8418 10.7032C11.8925 10.7512 11.9178 10.8205 11.9178 10.9112C11.9178 11.0045 11.8925 11.0752 11.8418 11.1232C11.7938 11.1712 11.7232 11.1952 11.6298 11.1952H10.7378V11.9712C10.7378 12.2245 10.6165 12.3512 10.3738 12.3512Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M4.73017 10.0592V10.7792H5.22217C5.36084 10.7792 5.4675 10.7499 5.54217 10.6912C5.61684 10.6299 5.65417 10.5392 5.65417 10.4192C5.65417 10.2965 5.61684 10.2059 5.54217 10.1472C5.4675 10.0885 5.36084 10.0592 5.22217 10.0592H4.73017ZM5.22217 10.7125H4.79683V10.1259H5.22217C5.35254 10.1259 5.44239 10.1536 5.50098 10.1996C5.55507 10.2421 5.5875 10.3105 5.5875 10.4192C5.5875 10.5242 5.55566 10.5935 5.50041 10.6392C5.4418 10.685 5.35212 10.7125 5.22217 10.7125Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.9275 11.9792C3.9275 12.1089 3.96318 12.2192 4.04208 12.3014L4.04303 12.3023C4.12293 12.3822 4.23262 12.4179 4.36217 12.4179C4.49585 12.4179 4.60819 12.3828 4.68631 12.3013L4.68723 12.3003C4.76291 12.2181 4.79683 12.1082 4.79683 11.9792V11.4099H5.35017C5.68113 11.4099 5.94636 11.3256 6.13581 11.1478C6.32779 10.9674 6.42083 10.7218 6.42083 10.4192C6.42083 10.1169 6.32792 9.87236 6.1358 9.69458C5.9464 9.51414 5.68118 9.42852 5.35017 9.42852H4.36617C4.23647 9.42852 4.12618 9.46419 4.04399 9.54308L4.04303 9.54405C3.96286 9.62421 3.9275 9.73547 3.9275 9.86719V11.9792ZM5.35017 11.3432H4.73017V11.9792C4.73017 12.0965 4.6995 12.1885 4.63817 12.2552C4.57684 12.3192 4.48484 12.3512 4.36217 12.3512C4.24484 12.3512 4.15417 12.3192 4.09017 12.2552C4.02617 12.1885 3.99417 12.0965 3.99417 11.9792V9.86719C3.99417 9.74719 4.02617 9.65519 4.09017 9.59119C4.15684 9.52719 4.24884 9.49519 4.36617 9.49519H5.35017C5.67017 9.49519 5.91684 9.57785 6.09017 9.74319C6.26617 9.90585 6.35417 10.1312 6.35417 10.4192C6.35417 10.7072 6.26617 10.9339 6.09017 11.0992C5.91684 11.2619 5.67017 11.3432 5.35017 11.3432Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.51329 10.0912V11.7192H7.89729C8.03863 11.7192 8.15996 11.7019 8.26129 11.6672C8.36529 11.6325 8.45063 11.5819 8.51729 11.5152C8.58663 11.4485 8.63729 11.3645 8.66929 11.2632C8.70396 11.1619 8.72129 11.0419 8.72129 10.9032C8.72129 10.6259 8.65329 10.4219 8.51729 10.2912C8.38129 10.1579 8.17463 10.0912 7.89729 10.0912H7.51329ZM8.47015 11.468C8.41191 11.5263 8.33599 11.572 8.24021 11.6039C8.14764 11.6356 8.03349 11.6525 7.89729 11.6525H7.57996V10.1579H7.89729C8.16511 10.1579 8.35179 10.2223 8.47062 10.3388L8.47111 10.3393C8.58892 10.4525 8.65463 10.6354 8.65463 10.9032C8.65463 11.0366 8.63791 11.1489 8.6062 11.2416L8.60572 11.2431C8.57672 11.335 8.53156 11.409 8.47108 11.4671L8.47015 11.468Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.71063 11.9352C6.71063 12.0693 6.7458 12.1826 6.8252 12.2654L6.82712 12.2673C6.91008 12.3469 7.02501 12.3819 7.16129 12.3819H7.94529C8.19604 12.3819 8.42107 12.3503 8.61838 12.2864C8.81803 12.2199 8.9879 12.1235 9.12639 11.9963L9.12692 11.9958C9.26499 11.8662 9.37052 11.7096 9.44332 11.5276C9.51623 11.3425 9.55196 11.134 9.55196 10.9032C9.55196 10.4411 9.41253 10.0748 9.12631 9.81401C8.84354 9.55394 8.4466 9.42852 7.94529 9.42852H7.16129C7.0243 9.42852 6.90902 9.46518 6.82615 9.54805C6.74573 9.62847 6.71063 9.74129 6.71063 9.87519V11.9352ZM6.87329 12.2192C6.93996 12.2832 7.03596 12.3152 7.16129 12.3152H7.94529C8.19063 12.3152 8.40796 12.2845 8.59729 12.2232C8.78929 12.1592 8.95063 12.0672 9.08129 11.9472C9.21196 11.8245 9.31196 11.6765 9.38129 11.5032C9.45063 11.3272 9.48529 11.1272 9.48529 10.9032C9.48529 10.4552 9.35063 10.1085 9.08129 9.86319C8.81463 9.61785 8.43596 9.49519 7.94529 9.49519H7.16129C7.03596 9.49519 6.93996 9.52852 6.87329 9.59519C6.80929 9.65919 6.77729 9.75252 6.77729 9.87519V11.9352C6.77729 12.0579 6.80929 12.1525 6.87329 12.2192Z" />
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.93516 11.9712C9.93516 12.1053 9.97033 12.2186 10.0497 12.3014L10.0517 12.3033C10.1338 12.3822 10.2441 12.4179 10.3738 12.4179C10.5062 12.4179 10.6175 12.3832 10.695 12.3023C10.7719 12.222 10.8045 12.1074 10.8045 11.9712V11.2619H11.6298C11.7337 11.2619 11.8238 11.2351 11.8883 11.171C11.9559 11.1066 11.9845 11.0161 11.9845 10.9112C11.9845 10.8083 11.9555 10.7194 11.8883 10.6554C11.8238 10.5913 11.7337 10.5645 11.6298 10.5645H10.8045V10.1299H11.7178C11.8241 10.1299 11.9161 10.1033 11.981 10.0383L11.9822 10.037C12.0455 9.97029 12.0725 9.87969 12.0725 9.77519C12.0725 9.67297 12.0452 9.5843 11.981 9.52005C11.9161 9.45513 11.8241 9.42852 11.7178 9.42852H10.3858C10.2488 9.42852 10.1336 9.46518 10.0507 9.54805C9.97026 9.62847 9.93516 9.74129 9.93516 9.87519V11.9712ZM11.8883 10.6554L11.8877 10.6548L11.8418 10.7032L11.889 10.656L11.8883 10.6554ZM11.8883 11.171L11.8877 11.1716L11.8418 11.1232L11.889 11.1703L11.8883 11.171Z" />
</svg>

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@@ -9,7 +9,7 @@ import {
import React from 'react';
type Props = Omit<NumberInputProps, 'onChange'> & {
onChange: (e: number | '') => any;
onChange: (e?: number) => any;
placeholder?: string;
};
@@ -19,7 +19,7 @@ const MyNumberInput = (props: Props) => {
{...props}
onChange={(e) => {
if (isNaN(Number(e))) {
props?.onChange('');
props?.onChange();
} else {
props?.onChange(Number(e));
}

View File

@@ -3,12 +3,19 @@ import { Box, BoxProps } from '@chakra-ui/react';
const FormLabel = ({
children,
required,
...props
}: BoxProps & {
required?: boolean;
children: React.ReactNode;
}) => {
return (
<Box color={'myGray.900'} fontSize={'sm'} {...props}>
<Box color={'myGray.900'} fontSize={'sm'} position={'relative'} {...props}>
{required && (
<Box color={'red.600'} position={'absolute'} top={'-4px'} left={'-6px'}>
*
</Box>
)}
{children}
</Box>
);

View File

@@ -1,131 +1,179 @@
import { Box, Flex, useDisclosure, useOutsideClick } from '@chakra-ui/react';
import {
Box,
Button,
ButtonProps,
Flex,
Menu,
MenuButton,
MenuItem,
MenuItemProps,
MenuList,
useDisclosure,
useOutsideClick
} from '@chakra-ui/react';
import React, { useRef } from 'react';
import { useTranslation } from 'next-i18next';
import MyTag from '../Tag/index';
import MyIcon from '../Icon';
export type SelectProps = {
value?: string[];
export type SelectProps<T = any> = {
value: T[];
placeholder?: string;
list: {
icon?: string;
alias?: string;
label: string | React.ReactNode;
value: string;
value: T;
}[];
maxH?: number;
onSelect: (val: any[]) => void;
};
onSelect: (val: T[]) => void;
} & Omit<ButtonProps, 'onSelect'>;
const MultipleSelect = ({
const MultipleSelect = <T = any,>({
value = [],
placeholder,
list = [],
width = '100%',
maxH = 400,
onSelect
}: SelectProps) => {
onSelect,
...props
}: SelectProps<T>) => {
const { t } = useTranslation();
const ref = useRef<HTMLDivElement>(null);
const ref = useRef<HTMLButtonElement>(null);
const { isOpen, onOpen, onClose } = useDisclosure();
const menuItemStyles: MenuItemProps = {
borderRadius: 'sm',
py: 2,
display: 'flex',
alignItems: 'center',
_hover: {
backgroundColor: 'myGray.100'
},
_notLast: {
mb: 2
}
};
useOutsideClick({
ref: ref,
handler: onClose
});
const onclickItem = (val: T) => {
if (value.includes(val)) {
onSelect(value.filter((i) => i !== val));
} else {
onSelect([...value, val]);
}
};
return (
<Box ref={ref} position={'relative'}>
<Flex
alignItems={'center'}
flexWrap={'wrap'}
border={'base'}
py={2}
px={3}
borderRadius={'md'}
cursor={'pointer'}
gap={3}
onClick={() => (isOpen ? onClose() : onOpen())}
<Box>
<Menu
autoSelect={false}
isOpen={isOpen}
onOpen={onOpen}
onClose={onClose}
strategy={'fixed'}
matchWidth
closeOnSelect={false}
>
{value.map((item) => {
const listItem = list.find((i) => i.value === item);
if (!listItem) return null;
return (
<MyTag colorSchema="blue" p={2} cursor={'default'}>
{listItem.alias || listItem.label}
<MyIcon
name={'common/closeLight'}
ml={1}
w="14px"
cursor={'pointer'}
onClick={(e) => {
e.stopPropagation();
onSelect(value.filter((i) => i !== item));
}}
/>
</MyTag>
);
})}
{value.length === 0 && placeholder && (
<Box color={'myGray.500'} fontSize={'sm'}>
{placeholder}
</Box>
)}
</Flex>
{isOpen && (
<Box
<MenuButton
as={Box}
ref={ref}
width={width}
px={3}
py={2}
bg={'white'}
borderRadius={'md'}
whiteSpace={'nowrap'}
maxH={`${maxH}px`}
overflowY={'auto'}
boxShadow={'2'}
position={'absolute'}
top={'110%'}
border={'base'}
w={'100%'}
zIndex={100}
userSelect={'none'}
minH={'40px'}
cursor={'pointer'}
_active={{
transform: 'none'
}}
{...props}
{...(isOpen
? {
boxShadow: '0px 0px 4px #A8DBFF',
borderColor: 'primary.500',
bg: 'white'
}
: {})}
>
{list.map((item) => {
const selected = value.includes(item.value);
{value.length === 0 && placeholder ? (
<Box color={'myGray.500'} fontSize={'sm'}>
{placeholder}
</Box>
) : (
<Flex alignItems={'center'} gap={2} flexWrap={'wrap'}>
{value.map((item, i) => {
const listItem = list.find((i) => i.value === item);
if (!listItem) return null;
return (
<Flex
alignItems={'center'}
_notLast={{ mb: 1 }}
py={2}
px={3}
borderRadius={'md'}
cursor={'pointer'}
_hover={{
bg: 'primary.50'
}}
{...(selected
? {
color: 'primary.600',
onClick: (e) => {
return (
<MyTag key={i} colorSchema="blue" type={'borderFill'}>
{listItem.label}
{/* <MyIcon
name={'common/closeLight'}
ml={1}
w="14px"
cursor={'pointer'}
onClickCapture={(e) => {
console.log(111);
e.stopPropagation();
onSelect(value.filter((i) => i !== item.value));
}
}
: {
onClick: (e) => {
e.stopPropagation();
onSelect([...value, item.value]);
}
})}
>
{item.icon && <MyIcon name={item.icon as any} w={'14px'} mr={1} />}
<Box>{item.label}</Box>
</Flex>
);
})}
</Box>
)}
onclickItem(item);
}}
/> */}
</MyTag>
);
})}
</Flex>
)}
</MenuButton>
<MenuList
className={props.className}
minW={(() => {
const w = ref.current?.clientWidth;
if (w) {
return `${w}px !important`;
}
return Array.isArray(width)
? width.map((item) => `${item} !important`)
: `${width} !important`;
})()}
w={'auto'}
px={'6px'}
py={'6px'}
border={'1px solid #fff'}
boxShadow={
'0px 2px 4px rgba(161, 167, 179, 0.25), 0px 0px 1px rgba(121, 141, 159, 0.25);'
}
zIndex={99}
maxH={'40vh'}
overflowY={'auto'}
>
{list.map((item, i) => (
<MenuItem
key={i}
{...menuItemStyles}
{...(value.includes(item.value)
? {
color: 'primary.600'
}
: {
color: 'myGray.900'
})}
onClick={() => onclickItem(item.value)}
whiteSpace={'pre-wrap'}
fontSize={'sm'}
gap={2}
>
<Box w={'0.8rem'} lineHeight={1}>
{value.includes(item.value) && <MyIcon name={'price/right'} w={'1rem'} />}
</Box>
<Box>{item.label}</Box>
</MenuItem>
))}
</MenuList>
</Menu>
</Box>
);
};
export default React.memo(MultipleSelect);
export default MultipleSelect;

View File

@@ -15,31 +15,28 @@ import { ChevronDownIcon } from '@chakra-ui/icons';
import { useLoading } from '../../../hooks/useLoading';
import MyIcon from '../Icon';
export type SelectProps = ButtonProps & {
value?: string | number;
export type SelectProps<T = any> = ButtonProps & {
value?: T;
placeholder?: string;
list: {
alias?: string;
label: string | React.ReactNode;
description?: string;
value: string | number;
value: T;
}[];
isLoading?: boolean;
onchange?: (val: any) => void;
onchange?: (val: T) => void;
};
const MySelect = (
{
placeholder,
value,
width = '100%',
list = [],
onchange,
isLoading = false,
...props
}: SelectProps,
selectRef: any
) => {
const MySelect = <T = any,>({
placeholder,
value,
width = '100%',
list = [],
onchange,
isLoading = false,
...props
}: SelectProps<T>) => {
const ref = useRef<HTMLButtonElement>(null);
const { Loading } = useLoading();
const menuItemStyles: MenuItemProps = {
@@ -120,9 +117,9 @@ const MySelect = (
maxH={'40vh'}
overflowY={'auto'}
>
{list.map((item) => (
{list.map((item, i) => (
<MenuItem
key={item.value}
key={i}
{...menuItemStyles}
{...(value === item.value
? {
@@ -155,4 +152,4 @@ const MySelect = (
);
};
export default React.memo(forwardRef(MySelect));
export default MySelect;

View File

@@ -66,7 +66,8 @@ const MyTag = ({ children, colorSchema = 'blue', type = 'fill', showDot, ...prop
}, [colorSchema]);
return (
<Flex
<Box
display={'inline-flex'}
px={2.5}
lineHeight={1}
py={1}
@@ -82,7 +83,7 @@ const MyTag = ({ children, colorSchema = 'blue', type = 'fill', showDot, ...prop
>
{showDot && <Box w={1.5} h={1.5} borderRadius={'md'} bg={theme.color} mr={1.5}></Box>}
{children}
</Flex>
</Box>
);
};

View File

@@ -1,21 +1,16 @@
import { FlowNodeTemplateTypeEnum } from '@fastgpt/global/core/workflow/constants';
import { nodeTemplateListType } from '@fastgpt/global/core/workflow/type';
import { NodeTemplateListType } from '@fastgpt/global/core/workflow/type/node';
import { TFunction } from 'next-i18next';
export const workflowNodeTemplateList = (t: TFunction): nodeTemplateListType => [
export const workflowNodeTemplateList = (t: TFunction): NodeTemplateListType => [
{
type: FlowNodeTemplateTypeEnum.systemInput,
label: t('core.module.template.System input module'),
list: []
},
{
type: FlowNodeTemplateTypeEnum.textAnswer,
label: t('core.module.template.Response module'),
list: []
},
{
type: FlowNodeTemplateTypeEnum.functionCall,
label: t('core.module.template.Function module'),
type: FlowNodeTemplateTypeEnum.ai,
label: t('core.module.template.AI function'),
list: []
},
{
@@ -23,19 +18,14 @@ export const workflowNodeTemplateList = (t: TFunction): nodeTemplateListType =>
label: t('core.module.template.Tool module'),
list: []
},
{
type: FlowNodeTemplateTypeEnum.externalCall,
label: t('core.module.template.External module'),
list: []
},
{
type: FlowNodeTemplateTypeEnum.personalPlugin,
label: '',
list: []
},
{
type: FlowNodeTemplateTypeEnum.other,
label: t('common.Other'),
list: []
},
{
type: FlowNodeTemplateTypeEnum.teamApp,
label: '',
list: []
}
];

View File

@@ -1,6 +1,7 @@
{
"Add new": "Add new",
"App": "App",
"Click to resume": "Resume",
"Code editor": "Code edit",
"Export": "Export",
"Field name": "Name",
@@ -12,6 +13,7 @@
"New Create": "Create New",
"No data": "No data",
"Rename": "Rename",
"Resume": "Resume",
"Running": "Running",
"UnKnow": "Unknown",
"Warning": "Warning",
@@ -955,6 +957,7 @@
}
},
"template": {
"AI function": "AI function",
"AI response switch tip": "If you wish the current node not to output content, you can turn off this switch. AI output content will not be displayed to the user, you can manually use 'AI response content' for special processing.",
"AI support tool tip": "Supports function calls model, can better use tool invocation.",
"Ai chat": "AI chat",
@@ -1194,6 +1197,8 @@
"error": {
"Create failed": "Create failed",
"fileNotFound": "File not found~",
"inheritPermissionError": "Inherit permission Error",
"missingParams": "Insufficient parameters",
"team": {
"overSize": "Team members exceed the limit"
}
@@ -1227,6 +1232,7 @@
"Collaborator": "",
"Default permission": "Default permission",
"Manage": "Manage",
"No InheritPermission": "The permission has been restricted, and the parent folder's permission will not be inherited,",
"Not collaborator": "Not collaborator",
"Owner": "Owner",
"Permission": "Permission",
@@ -1235,6 +1241,10 @@
"Private Tip": "Only available to oneself",
"Public": "Team",
"Public Tip": "Available to all team members",
"Remove InheritPermission Confirm": "This operation will cause to lose the current permission settings, whether to continue?",
"Resume InheritPermission Confirm": "Whether to resume to inherit the parent folder's permission?",
"Resume InheritPermission Failed": "Resume Failed",
"Resume InheritPermission Success": "Resume Success",
"Set Private": "Set as private",
"Set Public": "Set as available to the team"
},
@@ -1509,6 +1519,7 @@
}
},
"system": {
"Concat us": "Concat",
"Help Document": "Help document"
},
"template": {

View File

@@ -3,6 +3,9 @@
"Common Dataset": "Common dataset",
"Common Dataset Desc": "Can be built by importing files, web links, or manual entry",
"Confirm to rebuild embedding tip": "Are you sure to switch the knowledge base index?\nSwitching index is a very heavy operation that requires re-indexing all the data in your knowledge base, which may take a long time. Please ensure that the remaining points in your account are sufficient.\n\nIn addition, you need to be careful to modify the applications that select this knowledge base to avoid mixing them with other index model knowledge bases.",
"Disabled": "Disabled",
"Enable": "Enable",
"Enabled": "Enabled",
"External file": "External file",
"External file Dataset Desc": "You can import files from an external file library to build a knowledge base. Files are not stored twice",
"External id": "File id",
@@ -15,5 +18,9 @@
"The knowledge base has indexes that are being trained or being rebuilt": "The knowledge base has indexes that are being trained or being rebuilt",
"Website Dataset": "Web site",
"Website Dataset Desc": "Web site synchronization allows you to use a web page link to build a dataset",
"collection": {
"Create update time": "Create/Update time",
"Training type": "Training type"
},
"filename": "filename"
}

View File

@@ -1,7 +1,8 @@
{
"permission": {
"Set read permission": "Read permission",
"Set write permission": "Write permission"
"Set write permission": "Write permission",
"Write": "Write"
},
"team": {
"Add manager": "Add manager"

View File

@@ -1,6 +1,19 @@
{
"Add new input": "Add input",
"Code": "Code",
"Confirm delete field tip": "Confirm to delete the field?",
"Custom input": "Custom input",
"Edit input": "Edit input",
"Field Name already exists": "Field name already exists",
"Field description": "Field description",
"Field description placeholder": "Describes the functionality of this input field, which affects the quality of model generation if the parameter is called for a tool",
"Field required": "Required",
"Field used as tool input": "As tool input",
"Input description": "Input descriotion",
"Only the Reference type is supported": "Only the Reference type is supported",
"Optional value type": "Optional value type",
"Optional value type tip": "One or more data types can be specified, and users can only select the configured type when adding fields in winter",
"Tool input": "Tool",
"code": {
"Reset template": "Reset template",
"Reset template confirm": "Are you sure to restore the code template? Be careful to save the current code."

View File

@@ -1,6 +1,7 @@
{
"Add new": "新增",
"App": "应用",
"Click to resume": "点击恢复",
"Code editor": "代码编辑",
"Export": "导出",
"Field name": "字段名",
@@ -12,6 +13,7 @@
"New Create": "新建",
"No data": "暂无数据",
"Rename": "重命名",
"Resume": "恢复",
"Running": "运行中",
"UnKnow": "未知",
"Warning": "提示",
@@ -596,7 +598,8 @@
"success": "开始同步"
}
},
"training": {}
"training": {
}
},
"data": {
"Auxiliary Data": "辅助数据",
@@ -963,6 +966,7 @@
}
},
"template": {
"AI function": "AI能力",
"AI response switch tip": "如果你希望当前节点不输出内容可以关闭该开关。AI 输出的内容不会展示给用户你可以手动的使用“AI 回复内容”进行特殊处理。",
"AI support tool tip": "支持函数调用的模型,可以更好的使用工具调用。",
"Ai chat": "AI 对话",
@@ -1202,6 +1206,8 @@
"error": {
"Create failed": "创建失败",
"fileNotFound": "文件找不到了~",
"inheritPermissionError": "权限继承错误",
"missingParams": "参数缺失",
"team": {
"overSize": "团队成员超出上限"
}
@@ -1235,6 +1241,7 @@
"Collaborator": "协作者",
"Default permission": "默认权限",
"Manage": "管理",
"No InheritPermission": "已限制权限,不再继承父级文件夹的权限,",
"Not collaborator": "暂无协作者",
"Owner": "创建者",
"Permission": "权限",
@@ -1243,6 +1250,10 @@
"Private Tip": "仅自己可用",
"Public": "团队",
"Public Tip": "团队所有成员可使用",
"Remove InheritPermission Confirm": "此操作会导致权限继承失效,是否进行?",
"Resume InheritPermission Confirm": "是否恢复为继承父级文件夹的权限?",
"Resume InheritPermission Failed": "恢复失败",
"Resume InheritPermission Success": "恢复成功",
"Set Private": "设为私有",
"Set Public": "设为团队可用"
},
@@ -1517,6 +1528,7 @@
}
},
"system": {
"Concat us": "联系我们",
"Help Document": "帮助文档"
},
"template": {

View File

@@ -3,6 +3,9 @@
"Common Dataset": "通用知识库",
"Common Dataset Desc": "可通过导入文件、网页链接或手动录入形式构建知识库",
"Confirm to rebuild embedding tip": "确认为知识库切换索引?\n切换索引是一个非常重量的操作需要对您知识库内所有数据进行重新索引时间可能较长请确保账号内剩余积分充足。\n\n此外你还需要注意修改选择该知识库的应用避免它们与其他索引模型知识库混用。",
"Disabled": "已禁用",
"Enable": "启用",
"Enabled": "已启用",
"External File": "外部文件库",
"External file Dataset Desc": "可以从外部文件库导入文件构建知识库,文件不会进行二次存储",
"External id": "文件阅读 ID",
@@ -15,5 +18,9 @@
"The knowledge base has indexes that are being trained or being rebuilt": "知识库有训练中或正在重建的索引",
"Website Dataset": "Web 站点同步",
"Website Dataset Desc": "Web 站点同步允许你直接使用一个网页链接构建知识库",
"collection": {
"Create update time": "创建/更新时间",
"Training type": "训练模式"
},
"filename": "文件名"
}

View File

@@ -1,6 +1,19 @@
{
"Add new input": "新增输入",
"Code": "代码",
"Confirm delete field tip": "确认删除该字段?",
"Custom input": "自定义输入",
"Edit input": "编辑输入",
"Field Name already exists": "字段名已经存在",
"Field description": "字段描述",
"Field description placeholder": "描述该输入字段的功能,如果为工具调用参数,则该描述会影响模型生成的质量",
"Field required": "必填",
"Field used as tool input": "作为工具调用参数",
"Input description": "字段描述",
"Only the Reference type is supported": "仅支持引用类型",
"Optional value type": "可选的数据类型",
"Optional value type tip": "可以指定 1 个或多个数据类型,用户在冬天添加字段时,仅可选择配置的类型",
"Tool input": "工具参数",
"code": {
"Reset template": "还原模板",
"Reset template confirm": "确认还原代码模板?请注意保存当前代码。"