diff --git a/projects/app/src/pages/api/admin/initv4810.ts b/projects/app/src/pages/api/admin/initv4810.ts new file mode 100644 index 000000000000..e7960569e7a8 --- /dev/null +++ b/projects/app/src/pages/api/admin/initv4810.ts @@ -0,0 +1,35 @@ +import type { NextApiRequest, NextApiResponse } from 'next'; +import { jsonRes } from '@fastgpt/service/common/response'; +import { connectToDatabase } from '@/service/mongo'; +import { authCert } from '@fastgpt/service/support/permission/auth/common'; +import { MongoDataset } from '@fastgpt/service/core/dataset/schema'; +import { DatasetDefaultPermissionVal } from '@fastgpt/global/support/permission/dataset/constant'; +import { MongoAppVersion } from '@fastgpt/service/core/app/version/schema'; + +/* pg 中的数据搬到 mongo dataset.datas 中,并做映射 */ +export default async function handler(req: NextApiRequest, res: NextApiResponse) { + try { + await connectToDatabase(); + await authCert({ req, authRoot: true }); + + await MongoAppVersion.updateMany( + {}, + { + $set: { + isPublish: true + } + } + ); + + jsonRes(res, { + message: 'success' + }); + } catch (error) { + console.log(error); + + jsonRes(res, { + code: 500, + error + }); + } +} diff --git a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/components/FlowController.tsx b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/components/FlowController.tsx index 6c4b04fd75ac..aab7ebcb88b6 100644 --- a/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/components/FlowController.tsx +++ b/projects/app/src/pages/app/detail/components/WorkflowComponents/Flow/components/FlowController.tsx @@ -7,7 +7,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon'; import { Box } from '@chakra-ui/react'; import { useTranslation } from 'react-i18next'; import styles from './index.module.scss'; -import { maxZoom, minZoom } from '..'; +import { maxZoom, minZoom } from '../index'; const FlowController = React.memo(function FlowController() { const { fitView, zoomIn, zoomOut } = useReactFlow(); diff --git a/projects/app/src/web/core/app/constants.ts b/projects/app/src/web/core/app/constants.ts index 8b016aafff05..ec69273324a6 100644 --- a/projects/app/src/web/core/app/constants.ts +++ b/projects/app/src/web/core/app/constants.ts @@ -6,7 +6,7 @@ import { NullPermission } from '@fastgpt/global/support/permission/constant'; import { i18nT } from '@fastgpt/web/i18n/utils'; export const defaultApp: AppDetailType = { _id: '', - name: i18nT('common:core.app.loading'), + name: 'AI', type: AppTypeEnum.simple, avatar: '/icon/logo.svg', intro: '',