mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-25 20:02:47 +00:00
fix: plugin input type options & save button (#2590)
This commit is contained in:
parent
fdab383b26
commit
84de95d294
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useCallback, useMemo, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import {
|
||||
Box,
|
||||
Flex,
|
||||
|
|
@ -41,7 +41,6 @@ const Header = () => {
|
|||
|
||||
const { appDetail, onSaveApp, currentTab } = useContextSelector(AppContext, (v) => v);
|
||||
const isV2Workflow = appDetail?.version === 'v2';
|
||||
|
||||
const {
|
||||
isOpen: isOpenBackConfirm,
|
||||
onOpen: onOpenBackConfirm,
|
||||
|
|
@ -52,7 +51,6 @@ const Header = () => {
|
|||
onOpen: onSaveAndPublishModalOpen,
|
||||
onClose: onSaveAndPublishModalClose
|
||||
} = useDisclosure();
|
||||
|
||||
const [isSave, setIsSave] = useState(false);
|
||||
|
||||
const {
|
||||
|
|
@ -251,6 +249,8 @@ const Header = () => {
|
|||
status: 'success',
|
||||
title: t('app:saved_success')
|
||||
});
|
||||
onClose();
|
||||
setIsSave(false);
|
||||
}}
|
||||
>
|
||||
<MyIcon name={'core/workflow/upload'} w={'16px'} mr={2} />
|
||||
|
|
@ -268,6 +268,7 @@ const Header = () => {
|
|||
onSaveAndPublishModalOpen();
|
||||
}
|
||||
onClose();
|
||||
setIsSave(false);
|
||||
}}
|
||||
>
|
||||
<MyIcon name={'core/workflow/publish'} w={'16px'} mr={2} />
|
||||
|
|
@ -314,6 +315,10 @@ const Header = () => {
|
|||
await onClickSave({});
|
||||
onCloseBackConfirm();
|
||||
onBack();
|
||||
toast({
|
||||
status: 'success',
|
||||
title: t('app:saved_success')
|
||||
});
|
||||
}}
|
||||
>
|
||||
{t('common:common.Save_and_exit')}
|
||||
|
|
|
|||
|
|
@ -249,6 +249,8 @@ const Header = () => {
|
|||
status: 'success',
|
||||
title: t('app:saved_success')
|
||||
});
|
||||
onClose();
|
||||
setIsSave(false);
|
||||
}}
|
||||
>
|
||||
<MyIcon name={'core/workflow/upload'} w={'16px'} mr={2} />
|
||||
|
|
@ -266,6 +268,7 @@ const Header = () => {
|
|||
onSaveAndPublishModalOpen();
|
||||
}
|
||||
onClose();
|
||||
setIsSave(false);
|
||||
}}
|
||||
>
|
||||
<MyIcon name={'core/workflow/publish'} w={'16px'} mr={2} />
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { Box, Button, Input, ModalBody, ModalFooter } from '@chakra-ui/react';
|
||||
import { formatTime2YMDHMS } from '@fastgpt/global/common/string/time';
|
||||
import MyModal from '@fastgpt/web/components/common/MyModal';
|
||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||
import { useForm } from 'react-hook-form';
|
||||
|
|
@ -21,7 +22,7 @@ const SaveAndPublishModal = ({
|
|||
const { toast } = useToast();
|
||||
const { register, handleSubmit } = useForm<FormType>({
|
||||
defaultValues: {
|
||||
versionName: '',
|
||||
versionName: formatTime2YMDHMS(new Date()),
|
||||
isPublish: undefined
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -107,12 +107,6 @@ const FieldEditModal = ({
|
|||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
icon: 'core/workflow/inputType/selectApp',
|
||||
label: t('common:core.workflow.inputType.selectApp'),
|
||||
value: FlowNodeInputTypeEnum.selectApp,
|
||||
defaultValueType: WorkflowIOValueTypeEnum.selectApp
|
||||
},
|
||||
{
|
||||
icon: 'core/workflow/inputType/selectLLM',
|
||||
label: t('common:core.workflow.inputType.selectLLMModel'),
|
||||
|
|
|
|||
Loading…
Reference in New Issue