mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 04:06:18 +00:00
feat: sync api collection will refresh title;perf: invite link ux (#4237)
* update queue * feat: sync api collection will refresh title * sync collection * remove lock * perf: invite link ux
This commit is contained in:
@@ -56,7 +56,7 @@ export const replaceSensitiveText = (text: string) => {
|
||||
};
|
||||
|
||||
/* Make sure the first letter is definitely lowercase */
|
||||
export const getNanoid = (size = 12) => {
|
||||
export const getNanoid = (size = 16) => {
|
||||
const firstChar = customAlphabet('abcdefghijklmnopqrstuvwxyz', 1)();
|
||||
|
||||
if (size === 1) return firstChar;
|
||||
|
8
packages/global/core/dataset/apiDataset.d.ts
vendored
8
packages/global/core/dataset/apiDataset.d.ts
vendored
@@ -1,3 +1,5 @@
|
||||
import { RequireOnlyOne } from '../../common/type/utils';
|
||||
|
||||
export type APIFileItem = {
|
||||
id: string;
|
||||
parentId: string | null;
|
||||
@@ -15,9 +17,9 @@ export type APIFileServer = {
|
||||
|
||||
export type APIFileListResponse = APIFileItem[];
|
||||
|
||||
export type APIFileContentResponse = {
|
||||
content?: string;
|
||||
previewUrl?: string;
|
||||
export type ApiFileReadContentResponse = {
|
||||
title?: string;
|
||||
rawText: string;
|
||||
};
|
||||
|
||||
export type APIFileReadResponse = {
|
||||
|
@@ -16,3 +16,7 @@ export const getCollectionSourceData = (collection?: DatasetCollectionSchemaType
|
||||
export const checkCollectionIsFolder = (type: DatasetCollectionTypeEnum) => {
|
||||
return type === DatasetCollectionTypeEnum.folder || type === DatasetCollectionTypeEnum.virtual;
|
||||
};
|
||||
|
||||
export const collectionCanSync = (type: DatasetCollectionTypeEnum) => {
|
||||
return [DatasetCollectionTypeEnum.link, DatasetCollectionTypeEnum.apiFile].includes(type);
|
||||
};
|
||||
|
@@ -13,38 +13,38 @@ export enum DatasetTypeEnum {
|
||||
export const DatasetTypeMap = {
|
||||
[DatasetTypeEnum.folder]: {
|
||||
icon: 'common/folderFill',
|
||||
label: 'folder_dataset',
|
||||
collectionLabel: 'common.Folder'
|
||||
label: i18nT('dataset:folder_dataset'),
|
||||
collectionLabel: i18nT('common:Folder')
|
||||
},
|
||||
[DatasetTypeEnum.dataset]: {
|
||||
icon: 'core/dataset/commonDatasetOutline',
|
||||
label: 'common_dataset',
|
||||
collectionLabel: 'common.File'
|
||||
label: i18nT('dataset:common_dataset'),
|
||||
collectionLabel: i18nT('common:common.File')
|
||||
},
|
||||
[DatasetTypeEnum.websiteDataset]: {
|
||||
icon: 'core/dataset/websiteDatasetOutline',
|
||||
label: 'website_dataset',
|
||||
collectionLabel: 'common.Website'
|
||||
label: i18nT('dataset:website_dataset'),
|
||||
collectionLabel: i18nT('common:common.Website')
|
||||
},
|
||||
[DatasetTypeEnum.externalFile]: {
|
||||
icon: 'core/dataset/externalDatasetOutline',
|
||||
label: 'external_file',
|
||||
collectionLabel: 'common.File'
|
||||
label: i18nT('dataset:external_file'),
|
||||
collectionLabel: i18nT('common:common.File')
|
||||
},
|
||||
[DatasetTypeEnum.apiDataset]: {
|
||||
icon: 'core/dataset/externalDatasetOutline',
|
||||
label: 'api_file',
|
||||
collectionLabel: 'common.File'
|
||||
label: i18nT('dataset:api_file'),
|
||||
collectionLabel: i18nT('common:common.File')
|
||||
},
|
||||
[DatasetTypeEnum.feishu]: {
|
||||
icon: 'core/dataset/feishuDatasetOutline',
|
||||
label: 'feishu_dataset',
|
||||
collectionLabel: 'common.File'
|
||||
label: i18nT('dataset:feishu_dataset'),
|
||||
collectionLabel: i18nT('common:common.File')
|
||||
},
|
||||
[DatasetTypeEnum.yuque]: {
|
||||
icon: 'core/dataset/yuqueDatasetOutline',
|
||||
label: 'yuque_dataset',
|
||||
collectionLabel: 'common.File'
|
||||
label: i18nT('dataset:yuque_dataset'),
|
||||
collectionLabel: i18nT('common:common.File')
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user