mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-28 09:03:53 +00:00
4.8.10 test (#2578)
* fix: auth error * perf: refresh members * fix: variable run * fix: runtime check * fix: dataset info show
This commit is contained in:
@@ -71,7 +71,7 @@ export const TeamModalContextProvider = ({ children }: { children: ReactNode })
|
||||
} = useRequest2(
|
||||
() => {
|
||||
if (!userInfo?.team?.teamId) return Promise.resolve([]);
|
||||
return loadAndGetTeamMembers();
|
||||
return loadAndGetTeamMembers(true);
|
||||
},
|
||||
{
|
||||
manual: false,
|
||||
|
@@ -244,9 +244,10 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||
// Get runtimeNodes
|
||||
let runtimeNodes = storeNodes2RuntimeNodes(nodes, getWorkflowEntryNodeIds(nodes, newHistories));
|
||||
if (isPlugin) {
|
||||
// Rewrite plugin run params variables
|
||||
variables = removePluginInputVariables(variables, runtimeNodes);
|
||||
// Assign values to runtimeNodes using variables
|
||||
runtimeNodes = updatePluginInputByVariables(runtimeNodes, variables);
|
||||
// Remove pluginInput fields from variables (they are not global variables)
|
||||
variables = removePluginInputVariables(variables, runtimeNodes);
|
||||
}
|
||||
runtimeNodes = rewriteNodeOutputByHistories(newHistories, runtimeNodes);
|
||||
|
||||
|
@@ -247,7 +247,7 @@ const ListItem = () => {
|
||||
<Box color={'myGray.500'}>{formatTimeToChatTime(app.updateTime)}</Box>
|
||||
</HStack>
|
||||
)}
|
||||
{app.permission.hasManagePer && (
|
||||
{app.permission.hasWritePer && (
|
||||
<Box className="more" display={['', 'none']}>
|
||||
<MyMenu
|
||||
Button={
|
||||
@@ -289,50 +289,54 @@ const ListItem = () => {
|
||||
}
|
||||
]
|
||||
: []),
|
||||
{
|
||||
children: [
|
||||
{
|
||||
icon: 'edit',
|
||||
label: t('common:dataset.Edit Info'),
|
||||
onClick: () => {
|
||||
if (app.type === AppTypeEnum.httpPlugin) {
|
||||
setEditHttpPlugin({
|
||||
id: app._id,
|
||||
name: app.name,
|
||||
avatar: app.avatar,
|
||||
intro: app.intro,
|
||||
pluginData: app.pluginData
|
||||
});
|
||||
} else {
|
||||
setEditedApp({
|
||||
id: app._id,
|
||||
avatar: app.avatar,
|
||||
name: app.name,
|
||||
intro: app.intro
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
...(folderDetail?.type === AppTypeEnum.httpPlugin
|
||||
? []
|
||||
: [
|
||||
...(app.permission.hasManagePer
|
||||
? [
|
||||
{
|
||||
children: [
|
||||
{
|
||||
icon: 'common/file/move',
|
||||
label: t('common:common.folder.Move to'),
|
||||
onClick: () => setMoveAppId(app._id)
|
||||
}
|
||||
]),
|
||||
...(app.permission.hasManagePer
|
||||
? [
|
||||
{
|
||||
icon: 'support/team/key',
|
||||
label: t('common:permission.Permission'),
|
||||
onClick: () => setEditPerAppIndex(index)
|
||||
}
|
||||
icon: 'edit',
|
||||
label: t('common:dataset.Edit Info'),
|
||||
onClick: () => {
|
||||
if (app.type === AppTypeEnum.httpPlugin) {
|
||||
setEditHttpPlugin({
|
||||
id: app._id,
|
||||
name: app.name,
|
||||
avatar: app.avatar,
|
||||
intro: app.intro,
|
||||
pluginData: app.pluginData
|
||||
});
|
||||
} else {
|
||||
setEditedApp({
|
||||
id: app._id,
|
||||
avatar: app.avatar,
|
||||
name: app.name,
|
||||
intro: app.intro
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
...(folderDetail?.type === AppTypeEnum.httpPlugin
|
||||
? []
|
||||
: [
|
||||
{
|
||||
icon: 'common/file/move',
|
||||
label: t('common:common.folder.Move to'),
|
||||
onClick: () => setMoveAppId(app._id)
|
||||
}
|
||||
]),
|
||||
...(app.permission.hasManagePer
|
||||
? [
|
||||
{
|
||||
icon: 'support/team/key',
|
||||
label: t('common:permission.Permission'),
|
||||
onClick: () => setEditPerAppIndex(index)
|
||||
}
|
||||
]
|
||||
: [])
|
||||
]
|
||||
: [])
|
||||
]
|
||||
},
|
||||
}
|
||||
]
|
||||
: []),
|
||||
...(AppFolderTypeList.includes(app.type)
|
||||
? []
|
||||
: [
|
||||
@@ -347,7 +351,6 @@ const ListItem = () => {
|
||||
]
|
||||
}
|
||||
]),
|
||||
|
||||
...(app.permission.isOwner
|
||||
? [
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Box, Flex, Input } from '@chakra-ui/react';
|
||||
import { delDatasetById } from '@/web/core/dataset/api';
|
||||
@@ -50,7 +50,7 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
DatasetPageContext,
|
||||
(v) => v.refetchDatasetTraining
|
||||
);
|
||||
const { setValue, register, handleSubmit, watch } = useForm<DatasetItemType>({
|
||||
const { setValue, register, handleSubmit, watch, reset } = useForm<DatasetItemType>({
|
||||
defaultValues: datasetDetail
|
||||
});
|
||||
|
||||
@@ -147,6 +147,10 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
errorToast: t('common:common.Update Failed')
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
reset(datasetDetail);
|
||||
}, [datasetDetail._id]);
|
||||
|
||||
return (
|
||||
<Box w={'100%'} h={'100%'} p={6}>
|
||||
<Box>
|
||||
|
@@ -18,7 +18,7 @@ export const useCopyData = () => {
|
||||
duration = 1000
|
||||
) => {
|
||||
try {
|
||||
if (hasHttps() && !isProduction && navigator.clipboard) {
|
||||
if ((hasHttps() || !isProduction) && navigator.clipboard) {
|
||||
await navigator.clipboard.writeText(data);
|
||||
} else {
|
||||
throw new Error('');
|
||||
|
Reference in New Issue
Block a user