mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-25 06:14:06 +00:00
35
projects/app/src/pages/api/admin/initv4810.ts
Normal file
35
projects/app/src/pages/api/admin/initv4810.ts
Normal file
@@ -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
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@@ -7,7 +7,7 @@ import MyIcon from '@fastgpt/web/components/common/Icon';
|
|||||||
import { Box } from '@chakra-ui/react';
|
import { Box } from '@chakra-ui/react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import styles from './index.module.scss';
|
import styles from './index.module.scss';
|
||||||
import { maxZoom, minZoom } from '..';
|
import { maxZoom, minZoom } from '../index';
|
||||||
|
|
||||||
const FlowController = React.memo(function FlowController() {
|
const FlowController = React.memo(function FlowController() {
|
||||||
const { fitView, zoomIn, zoomOut } = useReactFlow();
|
const { fitView, zoomIn, zoomOut } = useReactFlow();
|
||||||
|
@@ -6,7 +6,7 @@ import { NullPermission } from '@fastgpt/global/support/permission/constant';
|
|||||||
import { i18nT } from '@fastgpt/web/i18n/utils';
|
import { i18nT } from '@fastgpt/web/i18n/utils';
|
||||||
export const defaultApp: AppDetailType = {
|
export const defaultApp: AppDetailType = {
|
||||||
_id: '',
|
_id: '',
|
||||||
name: i18nT('common:core.app.loading'),
|
name: 'AI',
|
||||||
type: AppTypeEnum.simple,
|
type: AppTypeEnum.simple,
|
||||||
avatar: '/icon/logo.svg',
|
avatar: '/icon/logo.svg',
|
||||||
intro: '',
|
intro: '',
|
||||||
|
Reference in New Issue
Block a user