mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-05 14:47:38 +00:00
Add externalfile api params (#2745)
* feat: external dataset api * perf: doc
This commit is contained in:
@@ -35,8 +35,8 @@ const TagsPopOver = ({
|
||||
const tagList = useMemo(
|
||||
() =>
|
||||
(collectionTags
|
||||
?.map((tagId) => {
|
||||
const tagObject = allDatasetTags.find((tag) => tag._id === tagId);
|
||||
?.map((item) => {
|
||||
const tagObject = allDatasetTags.find((tag) => tag.tag === item);
|
||||
return tagObject ? { _id: tagObject._id, tag: tagObject.tag } : null;
|
||||
})
|
||||
.filter((tag) => tag !== null) as {
|
||||
@@ -153,9 +153,9 @@ const TagsPopOver = ({
|
||||
setIsUpdateLoading(true);
|
||||
await putDatasetCollectionById({
|
||||
id: currentCollection._id,
|
||||
tags: checkedTags.map((tag) => tag._id)
|
||||
tags: checkedTags.map((tag) => tag.tag)
|
||||
});
|
||||
setCollectionTags(checkedTags.map((tag) => tag._id));
|
||||
setCollectionTags(checkedTags.map((tag) => tag.tag));
|
||||
setIsUpdateLoading(false);
|
||||
}}
|
||||
display={showTagManage || overflowTags.length > 0 ? 'block' : 'none'}
|
||||
|
@@ -1,10 +1,9 @@
|
||||
import React, { useState, useRef, useMemo } from 'react';
|
||||
import React, { useState, useMemo } from 'react';
|
||||
import { Box, Card, IconButton, Flex, Button, useTheme } from '@chakra-ui/react';
|
||||
import {
|
||||
getDatasetDataList,
|
||||
delOneDatasetDataById,
|
||||
getDatasetCollectionById,
|
||||
putDatasetDataById
|
||||
getDatasetCollectionById
|
||||
} from '@/web/core/dataset/api';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { useToast } from '@fastgpt/web/hooks/useToast';
|
||||
@@ -21,7 +20,6 @@ import { getCollectionSourceData } from '@fastgpt/global/core/dataset/collection
|
||||
import EmptyTip from '@fastgpt/web/components/common/EmptyTip';
|
||||
import { DatasetPageContext } from '@/web/core/dataset/context/datasetPageContext';
|
||||
import { useContextSelector } from 'use-context-selector';
|
||||
import { useRequest2 } from '@fastgpt/web/hooks/useRequest';
|
||||
import MyTag from '@fastgpt/web/components/common/Tag/index';
|
||||
import MyBox from '@fastgpt/web/components/common/MyBox';
|
||||
import { useSystem } from '@fastgpt/web/hooks/useSystem';
|
||||
@@ -96,24 +94,27 @@ const DataCard = () => {
|
||||
<Flex flexDirection={'column'} h={'100%'}>
|
||||
{/* Header */}
|
||||
<Flex alignItems={'center'} px={6}>
|
||||
<Flex className="textEllipsis" flex={'1 0 0'} mr={[3, 5]} alignItems={'center'}>
|
||||
<Box>
|
||||
<Box alignItems={'center'} gap={2} display={isPc ? 'flex' : ''}>
|
||||
{collection?._id && (
|
||||
<RawSourceBox
|
||||
collectionId={collection._id}
|
||||
{...getCollectionSourceData(collection)}
|
||||
fontSize={['sm', 'md']}
|
||||
color={'black'}
|
||||
textDecoration={'none'}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
{feConfigs?.isPlus && !!collection?.tags?.length && (
|
||||
<TagsPopOver currentCollection={collection} />
|
||||
<Box flex={'1 0 0'} mr={[3, 5]} alignItems={'center'}>
|
||||
<Box
|
||||
className="textEllipsis"
|
||||
alignItems={'center'}
|
||||
gap={2}
|
||||
display={isPc ? 'flex' : ''}
|
||||
>
|
||||
{collection?._id && (
|
||||
<RawSourceBox
|
||||
collectionId={collection._id}
|
||||
{...getCollectionSourceData(collection)}
|
||||
fontSize={['sm', 'md']}
|
||||
color={'black'}
|
||||
textDecoration={'none'}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
</Flex>
|
||||
{feConfigs?.isPlus && !!collection?.tags?.length && (
|
||||
<TagsPopOver currentCollection={collection} />
|
||||
)}
|
||||
</Box>
|
||||
{canWrite && (
|
||||
<Box>
|
||||
<Button
|
||||
|
@@ -243,8 +243,9 @@ const Info = ({ datasetId }: { datasetId: string }) => {
|
||||
const vectorModel = vectorModelList.find((item) => item.model === e);
|
||||
if (!vectorModel) return;
|
||||
return onOpenConfirmRebuild(() => {
|
||||
setValue('vectorModel', vectorModel);
|
||||
return onRebuilding(vectorModel);
|
||||
return onRebuilding(vectorModel).then(() => {
|
||||
setValue('vectorModel', vectorModel);
|
||||
});
|
||||
})();
|
||||
}}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user