@@ -111,7 +111,7 @@ export const Input_Template_Node_Height: FlowNodeInputItemType = {
|
|||||||
renderTypeList: [FlowNodeInputTypeEnum.hidden],
|
renderTypeList: [FlowNodeInputTypeEnum.hidden],
|
||||||
valueType: WorkflowIOValueTypeEnum.number,
|
valueType: WorkflowIOValueTypeEnum.number,
|
||||||
label: '',
|
label: '',
|
||||||
value: 900
|
value: 960
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Input_Template_Stream_MODE: FlowNodeInputItemType = {
|
export const Input_Template_Stream_MODE: FlowNodeInputItemType = {
|
||||||
|
|||||||
@@ -4,19 +4,18 @@ import { useContextSelector } from 'use-context-selector';
|
|||||||
import { AppContext, TabEnum } from '../context';
|
import { AppContext, TabEnum } from '../context';
|
||||||
import { useTranslation } from 'next-i18next';
|
import { useTranslation } from 'next-i18next';
|
||||||
import Avatar from '@fastgpt/web/components/common/Avatar';
|
import Avatar from '@fastgpt/web/components/common/Avatar';
|
||||||
import MyMenu from '@fastgpt/web/components/common/MyMenu';
|
|
||||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||||
import { WorkflowContext } from './context';
|
import { WorkflowContext } from './context';
|
||||||
import { filterSensitiveNodesData } from '@/web/core/workflow/utils';
|
import { filterSensitiveNodesData } from '@/web/core/workflow/utils';
|
||||||
import dynamic from 'next/dynamic';
|
import dynamic from 'next/dynamic';
|
||||||
import { useCopyData } from '@/web/common/hooks/useCopyData';
|
import { useCopyData } from '@/web/common/hooks/useCopyData';
|
||||||
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
|
||||||
import MyTag from '@fastgpt/web/components/common/Tag/index';
|
import MyTag from '@fastgpt/web/components/common/Tag/index';
|
||||||
import { publishStatusStyle } from '../constants';
|
import { publishStatusStyle } from '../constants';
|
||||||
import MyPopover from '@fastgpt/web/components/common/MyPopover';
|
import MyPopover from '@fastgpt/web/components/common/MyPopover';
|
||||||
import { fileDownload } from '@/web/common/file/utils';
|
import { fileDownload } from '@/web/common/file/utils';
|
||||||
import { AppChatConfigType } from '@fastgpt/global/core/app/type';
|
import { AppChatConfigType } from '@fastgpt/global/core/app/type';
|
||||||
import MyBox from '@fastgpt/web/components/common/MyBox';
|
import MyBox from '@fastgpt/web/components/common/MyBox';
|
||||||
|
import { useSystemStore } from '@/web/common/system/useSystemStore';
|
||||||
|
|
||||||
const ImportSettings = dynamic(() => import('./Flow/ImportSettings'));
|
const ImportSettings = dynamic(() => import('./Flow/ImportSettings'));
|
||||||
|
|
||||||
@@ -28,11 +27,10 @@ const AppCard = ({
|
|||||||
isPublished: boolean;
|
isPublished: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { feConfigs } = useSystemStore();
|
||||||
|
|
||||||
const { appDetail, onOpenInfoEdit, onOpenTeamTagModal, onDelApp } = useContextSelector(
|
const { appDetail, onOpenInfoEdit, onOpenTeamTagModal, onDelApp, currentTab } =
|
||||||
AppContext,
|
useContextSelector(AppContext, (v) => v);
|
||||||
(v) => v
|
|
||||||
);
|
|
||||||
|
|
||||||
const { isOpen: isOpenImport, onOpen: onOpenImport, onClose: onCloseImport } = useDisclosure();
|
const { isOpen: isOpenImport, onOpen: onOpenImport, onClose: onCloseImport } = useDisclosure();
|
||||||
|
|
||||||
@@ -104,36 +102,41 @@ const AppCard = ({
|
|||||||
})}
|
})}
|
||||||
</MyBox>
|
</MyBox>
|
||||||
<Box w={'full'} h={'1px'} bg={'myGray.200'} my={1} />
|
<Box w={'full'} h={'1px'} bg={'myGray.200'} my={1} />
|
||||||
|
{appDetail.permission.hasWritePer && feConfigs?.show_team_chat && (
|
||||||
|
<>
|
||||||
|
<MyBox
|
||||||
|
display={'flex'}
|
||||||
|
size={'md'}
|
||||||
|
px={1}
|
||||||
|
py={1.5}
|
||||||
|
rounded={'4px'}
|
||||||
|
_hover={{ color: 'primary.600', bg: 'rgba(17, 24, 36, 0.05)' }}
|
||||||
|
cursor={'pointer'}
|
||||||
|
onClick={onOpenTeamTagModal}
|
||||||
|
>
|
||||||
|
<MyIcon name={'core/dataset/tag'} w={'16px'} mr={2} />
|
||||||
|
<Box fontSize={'sm'}>{t('app:Team_Tags')}</Box>
|
||||||
|
</MyBox>
|
||||||
|
<Box w={'full'} h={'1px'} bg={'myGray.200'} my={1} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<MyBox
|
{appDetail.permission.isOwner && (
|
||||||
display={'flex'}
|
<MyBox
|
||||||
size={'md'}
|
display={'flex'}
|
||||||
px={1}
|
size={'md'}
|
||||||
py={1.5}
|
px={1}
|
||||||
rounded={'4px'}
|
py={1.5}
|
||||||
_hover={{ color: 'primary.600', bg: 'rgba(17, 24, 36, 0.05)' }}
|
rounded={'4px'}
|
||||||
cursor={'pointer'}
|
color={'red.600'}
|
||||||
onClick={onOpenTeamTagModal}
|
_hover={{ bg: 'rgba(17, 24, 36, 0.05)' }}
|
||||||
>
|
cursor={'pointer'}
|
||||||
<MyIcon name={'core/dataset/tag'} w={'16px'} mr={2} />
|
onClick={onDelApp}
|
||||||
<Box fontSize={'sm'}>{t('app:Team_Tags')}</Box>
|
>
|
||||||
</MyBox>
|
<MyIcon name={'delete'} w={'16px'} mr={2} />
|
||||||
<Box w={'full'} h={'1px'} bg={'myGray.200'} my={1} />
|
<Box fontSize={'sm'}>{t('common:common.Delete')}</Box>
|
||||||
|
</MyBox>
|
||||||
<MyBox
|
)}
|
||||||
display={'flex'}
|
|
||||||
size={'md'}
|
|
||||||
px={1}
|
|
||||||
py={1.5}
|
|
||||||
rounded={'4px'}
|
|
||||||
color={'red.600'}
|
|
||||||
_hover={{ bg: 'rgba(17, 24, 36, 0.05)' }}
|
|
||||||
cursor={'pointer'}
|
|
||||||
onClick={onDelApp}
|
|
||||||
>
|
|
||||||
<MyIcon name={'delete'} w={'16px'} mr={2} />
|
|
||||||
<Box fontSize={'sm'}>{t('common:common.Delete')}</Box>
|
|
||||||
</MyBox>
|
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</MyPopover>
|
</MyPopover>
|
||||||
@@ -142,6 +145,10 @@ const AppCard = ({
|
|||||||
[
|
[
|
||||||
appDetail.chatConfig,
|
appDetail.chatConfig,
|
||||||
appDetail.name,
|
appDetail.name,
|
||||||
|
appDetail.permission.hasWritePer,
|
||||||
|
appDetail.permission.isOwner,
|
||||||
|
currentTab,
|
||||||
|
feConfigs?.show_team_chat,
|
||||||
onDelApp,
|
onDelApp,
|
||||||
onOpenImport,
|
onOpenImport,
|
||||||
onOpenInfoEdit,
|
onOpenInfoEdit,
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ export const useWorkflow = () => {
|
|||||||
type: 'position',
|
type: 'position',
|
||||||
position: {
|
position: {
|
||||||
x: rect.x - 50,
|
x: rect.x - 50,
|
||||||
y: rect.y - 280
|
y: rect.y - 300
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ const ListItem = ({
|
|||||||
nodeId={nodeId}
|
nodeId={nodeId}
|
||||||
handleId={handleId}
|
handleId={handleId}
|
||||||
position={Position.Right}
|
position={Position.Right}
|
||||||
translate={[18, 0]}
|
translate={[3, 0]}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ const NodeIfElse = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<NodeCard selected={selected} maxW={'1000px'} {...data}>
|
<NodeCard selected={selected} maxW={'1000px'} {...data}>
|
||||||
<Box px={4} cursor={'default'}>
|
<Flex flexDirection={'column'} cursor={'default'} gap={2}>
|
||||||
<DndDrag<IfElseListItemType>
|
<DndDrag<IfElseListItemType>
|
||||||
onDragEndCb={(list: IfElseListItemType[]) => onUpdateIfElseList(list)}
|
onDragEndCb={(list: IfElseListItemType[]) => onUpdateIfElseList(list)}
|
||||||
dataList={ifElseList}
|
dataList={ifElseList}
|
||||||
@@ -98,12 +98,12 @@ const NodeIfElse = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
|||||||
nodeId={nodeId}
|
nodeId={nodeId}
|
||||||
handleId={elseHandleId}
|
handleId={elseHandleId}
|
||||||
position={Position.Right}
|
position={Position.Right}
|
||||||
translate={[26, 0]}
|
translate={[20, 0]}
|
||||||
/>
|
/>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Container>
|
</Container>
|
||||||
</Box>
|
</Flex>
|
||||||
<Box py={3} px={6}>
|
<Box py={3} px={4}>
|
||||||
<Button
|
<Button
|
||||||
variant={'whiteBase'}
|
variant={'whiteBase'}
|
||||||
w={'full'}
|
w={'full'}
|
||||||
|
|||||||
@@ -295,18 +295,15 @@ const InputTypeConfig = ({
|
|||||||
</FormLabel>
|
</FormLabel>
|
||||||
<Flex alignItems={'start'} flex={1} h={10}>
|
<Flex alignItems={'start'} flex={1} h={10}>
|
||||||
{inputType === FlowNodeInputTypeEnum.numberInput && (
|
{inputType === FlowNodeInputTypeEnum.numberInput && (
|
||||||
<NumberInput flex={1} step={1} min={min} max={max} position={'relative'}>
|
<MyNumberInput
|
||||||
<NumberInputField
|
value={defaultValue}
|
||||||
{...register('defaultValue', {
|
min={min}
|
||||||
min: min,
|
max={max}
|
||||||
max: max
|
onChange={(e) => {
|
||||||
})}
|
// @ts-ignore
|
||||||
/>
|
setValue('defaultValue', e || '');
|
||||||
<NumberInputStepper>
|
}}
|
||||||
<NumberIncrementStepper />
|
/>
|
||||||
<NumberDecrementStepper />
|
|
||||||
</NumberInputStepper>
|
|
||||||
</NumberInput>
|
|
||||||
)}
|
)}
|
||||||
{inputType === FlowNodeInputTypeEnum.input && (
|
{inputType === FlowNodeInputTypeEnum.input && (
|
||||||
<MyTextarea
|
<MyTextarea
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ const FieldEditModal = dynamic(() => import('./InputEditModal'));
|
|||||||
const NodePluginInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
const NodePluginInput = ({ data, selected }: NodeProps<FlowNodeItemType>) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { nodeId, inputs = [], outputs } = data;
|
const { nodeId, inputs = [], outputs } = data;
|
||||||
console.log(outputs);
|
|
||||||
|
|
||||||
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);
|
const onChangeNode = useContextSelector(WorkflowContext, (v) => v.onChangeNode);
|
||||||
|
|
||||||
|
|||||||
@@ -269,7 +269,13 @@ const NodeVariableUpdate = ({ data, selected }: NodeProps<FlowNodeItemType>) =>
|
|||||||
<ValueRender key={index} updateItem={updateItem} index={index} />
|
<ValueRender key={index} updateItem={updateItem} index={index} />
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
<Flex className="nodrag" cursor={'default'} alignItems={'center'} position={'relative'}>
|
<Flex
|
||||||
|
className="nodrag"
|
||||||
|
cursor={'default'}
|
||||||
|
alignItems={'center'}
|
||||||
|
position={'relative'}
|
||||||
|
mt={4}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
variant={'whiteBase'}
|
variant={'whiteBase'}
|
||||||
leftIcon={<SmallAddIcon />}
|
leftIcon={<SmallAddIcon />}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { Handle, Position } from 'reactflow';
|
import { Handle, Position } from 'reactflow';
|
||||||
import { SmallAddIcon } from '@chakra-ui/icons';
|
|
||||||
import { handleHighLightStyle, sourceCommonStyle, handleConnectedStyle, handleSize } from './style';
|
import { handleHighLightStyle, sourceCommonStyle, handleConnectedStyle, handleSize } from './style';
|
||||||
import { NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
import { NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
||||||
import { useContextSelector } from 'use-context-selector';
|
import { useContextSelector } from 'use-context-selector';
|
||||||
@@ -109,7 +108,7 @@ const MySourceHandle = React.memo(function MySourceHandle({
|
|||||||
position={position}
|
position={position}
|
||||||
isConnectableEnd={false}
|
isConnectableEnd={false}
|
||||||
>
|
>
|
||||||
{showAddIcon && <MyIcon name={'edgeAdd'} />}
|
{showAddIcon && <MyIcon name={'edgeAdd'} pointerEvents={'none'} />}
|
||||||
</Handle>
|
</Handle>
|
||||||
);
|
);
|
||||||
}, [handleId, position, showAddIcon, styles, transform]);
|
}, [handleId, position, showAddIcon, styles, transform]);
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ const NodeCard = (props: Props) => {
|
|||||||
</MyTooltip>
|
</MyTooltip>
|
||||||
)}
|
)}
|
||||||
</Flex>
|
</Flex>
|
||||||
<NodeIntro nodeId={nodeId} intro={intro} />
|
{intro && <NodeIntro nodeId={nodeId} intro={intro} />}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<MenuRender nodeId={nodeId} menuForbid={menuForbid} nodeList={nodeList} />
|
<MenuRender nodeId={nodeId} menuForbid={menuForbid} nodeList={nodeList} />
|
||||||
|
|||||||
Reference in New Issue
Block a user