fix: api dataset reference tag preview (#3600)

This commit is contained in:
heheer
2025-01-15 14:47:09 +08:00
committed by archer
parent 80e670600b
commit 2d82db01a9
3 changed files with 3 additions and 7 deletions

View File

@@ -284,7 +284,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
{ {
_id: { $in: collectionIdList } _id: { $in: collectionIdList }
}, },
'_id name fileId rawLink externalFileId externalFileUrl', '_id name fileId rawLink apiFileId externalFileId externalFileUrl',
{ ...readFromSecondary } { ...readFromSecondary }
).lean() ).lean()
]); ]);
@@ -525,7 +525,7 @@ export async function searchDatasetData(props: SearchDatasetDataProps) {
{ {
_id: { $in: searchResults.map((item) => item.collectionId) } _id: { $in: searchResults.map((item) => item.collectionId) }
}, },
'_id name fileId rawLink externalFileId externalFileUrl', '_id name fileId rawLink apiFileId externalFileId externalFileUrl',
{ ...readFromSecondary } { ...readFromSecondary }
).lean() ).lean()
]); ]);

View File

@@ -5,7 +5,6 @@ import { useTranslation } from 'next-i18next';
import { getCollectionSourceAndOpen } from '@/web/core/dataset/hooks/readCollectionSource'; import { getCollectionSourceAndOpen } from '@/web/core/dataset/hooks/readCollectionSource';
import { getSourceNameIcon } from '@fastgpt/global/core/dataset/utils'; import { getSourceNameIcon } from '@fastgpt/global/core/dataset/utils';
import MyIcon from '@fastgpt/web/components/common/Icon'; import MyIcon from '@fastgpt/web/components/common/Icon';
import { useI18n } from '@/web/context/I18n';
import type { readCollectionSourceBody } from '@/pages/api/core/dataset/collection/read'; import type { readCollectionSourceBody } from '@/pages/api/core/dataset/collection/read';
type Props = BoxProps & type Props = BoxProps &
@@ -33,7 +32,6 @@ const RawSourceBox = ({
...props ...props
}: Props) => { }: Props) => {
const { t } = useTranslation(); const { t } = useTranslation();
const { fileT } = useI18n();
const canPreview = !!sourceId && canView; const canPreview = !!sourceId && canView;
@@ -51,7 +49,7 @@ const RawSourceBox = ({
return ( return (
<MyTooltip <MyTooltip
label={canPreview ? fileT('click_to_view_raw_source') : ''} label={canPreview ? t('file:click_to_view_raw_source') : ''}
shouldWrapChildren={false} shouldWrapChildren={false}
> >
<Box <Box

View File

@@ -153,8 +153,6 @@ export const SwitchAuthTmb = React.memo(function SwitchAuthTmb({
[inputs] [inputs]
); );
console.log(authTmbIdInput, '--');
return authTmbIdInput ? ( return authTmbIdInput ? (
<Flex alignItems={'center'}> <Flex alignItems={'center'}>
<Box fontSize={'sm'}>{t('workflow:auth_tmb_id')}</Box> <Box fontSize={'sm'}>{t('workflow:auth_tmb_id')}</Box>