forked from labring/FastGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix http plugin edge (labring#95) * fix http plugin edge * use getHandleId * perf: i18n file * feat: histories list * perf: request lock * fix: ts * move box components * fix: edit form refresh --------- Co-authored-by: heheer <[email protected]>
- Loading branch information
1 parent
a0c1320
commit db6fc53
Showing
46 changed files
with
740 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type PaginationProps<T = {}> = T & { | ||
current: number; | ||
pageSize: number; | ||
}; | ||
export type PaginationResponse<T = any> = { | ||
total: number; | ||
list: T[]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 3 additions & 5 deletions
8
packages/web/components/common/Icon/icons/common/publishFill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
packages/web/components/common/Icon/icons/core/workflow/revertVersion.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
packages/web/components/common/Icon/icons/core/workflow/versionHistories.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { forwardRef } from 'react'; | ||
import { Box, BoxProps } from '@chakra-ui/react'; | ||
import Loading from '../MyLoading'; | ||
|
||
type Props = BoxProps & { | ||
isLoading?: boolean; | ||
text?: string; | ||
}; | ||
|
||
const MyBox = ({ text, isLoading, children, ...props }: Props, ref: any) => { | ||
return ( | ||
<Box ref={ref} position={'relative'} {...props}> | ||
{isLoading && <Loading fixed={false} text={text} />} | ||
{children} | ||
</Box> | ||
); | ||
}; | ||
|
||
export default forwardRef(MyBox); |
80 changes: 80 additions & 0 deletions
80
packages/web/components/common/MyDrawer/CustomRightDrawer.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import React from 'react'; | ||
import MyIcon from '../Icon'; | ||
import { Flex, Image, Box, CloseButton, FlexProps } from '@chakra-ui/react'; | ||
import { useLoading } from '../../../hooks/useLoading'; | ||
|
||
type Props = FlexProps & { | ||
onClose: () => void; | ||
iconSrc?: string; | ||
title?: any; | ||
isLoading?: boolean; | ||
showMask?: boolean; | ||
}; | ||
|
||
const CustomRightDrawer = ({ | ||
onClose, | ||
iconSrc, | ||
title, | ||
maxW = ['90vw', '30vw'], | ||
children, | ||
isLoading, | ||
showMask = true, | ||
...props | ||
}: Props) => { | ||
const { Loading } = useLoading(); | ||
return ( | ||
<Flex | ||
flexDirection={'column'} | ||
position={'fixed'} | ||
right={0} | ||
bg={'white'} | ||
zIndex={100} | ||
maxW={maxW} | ||
w={'100%'} | ||
h={'90vh'} | ||
borderLeftRadius={'lg'} | ||
border={'base'} | ||
boxShadow={'2'} | ||
{...props} | ||
> | ||
<Flex | ||
display={'flex'} | ||
alignItems={'center'} | ||
fontWeight={500} | ||
background={'#FBFBFC'} | ||
borderBottom={'1px solid #F4F6F8'} | ||
roundedTop={'lg'} | ||
py={'10px'} | ||
px={5} | ||
> | ||
{iconSrc && ( | ||
<> | ||
{iconSrc.startsWith('/') ? ( | ||
<Image mr={3} objectFit={'contain'} alt="" src={iconSrc} w={'20px'} /> | ||
) : ( | ||
<MyIcon mr={3} name={iconSrc as any} w={'20px'} /> | ||
)} | ||
</> | ||
)} | ||
<Box flex={'1'} fontSize={'lg'}> | ||
{title} | ||
</Box> | ||
<CloseButton position={'relative'} fontSize={'sm'} top={0} right={0} onClick={onClose} /> | ||
</Flex> | ||
|
||
<Box | ||
flex={'1 0 0'} | ||
py={props.py ?? 3} | ||
px={props.px ?? 5} | ||
overflow={props?.overflow ?? 'auto'} | ||
display={'flex'} | ||
flexDirection={'column'} | ||
> | ||
{children} | ||
</Box> | ||
<Loading loading={isLoading} fixed={false} /> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default React.memo(CustomRightDrawer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { FlowNodeTemplateTypeEnum } from '@fastgpt/global/core/workflow/constants'; | ||
import { nodeTemplateListType } from '@fastgpt/global/core/workflow/type'; | ||
import { TFunction } from 'next-i18next'; | ||
|
||
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'), | ||
list: [] | ||
}, | ||
{ | ||
type: FlowNodeTemplateTypeEnum.tools, | ||
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: [] | ||
} | ||
]; |
Oops, something went wrong.