mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00
v4.5.2 (#439)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { DatasetCollectionTypeEnum } from './constant';
|
||||
import { getFileIcon } from '../../common/file/icon';
|
||||
import { strIsLink } from '../../common/string/tools';
|
||||
|
||||
export function getCollectionIcon(
|
||||
type: `${DatasetCollectionTypeEnum}` = DatasetCollectionTypeEnum.file,
|
||||
@@ -7,9 +8,11 @@ export function getCollectionIcon(
|
||||
) {
|
||||
if (type === DatasetCollectionTypeEnum.folder) {
|
||||
return '/imgs/files/folder.svg';
|
||||
} else if (type === DatasetCollectionTypeEnum.link) {
|
||||
}
|
||||
if (type === DatasetCollectionTypeEnum.link) {
|
||||
return '/imgs/files/link.svg';
|
||||
} else if (type === DatasetCollectionTypeEnum.virtual) {
|
||||
}
|
||||
if (type === DatasetCollectionTypeEnum.virtual) {
|
||||
if (name === '手动录入') {
|
||||
return '/imgs/files/manual.svg';
|
||||
} else if (name === '手动标注') {
|
||||
@@ -19,3 +22,25 @@ export function getCollectionIcon(
|
||||
}
|
||||
return getFileIcon(name);
|
||||
}
|
||||
export function getSourceNameIcon({
|
||||
sourceName,
|
||||
sourceId
|
||||
}: {
|
||||
sourceName: string;
|
||||
sourceId?: string;
|
||||
}) {
|
||||
if (strIsLink(sourceId)) {
|
||||
return '/imgs/files/link.svg';
|
||||
}
|
||||
const fileIcon = getFileIcon(sourceName, '');
|
||||
if (fileIcon) {
|
||||
return fileIcon;
|
||||
}
|
||||
|
||||
if (sourceName === '手动录入') {
|
||||
return '/imgs/files/manual.svg';
|
||||
} else if (sourceName === '手动标注') {
|
||||
return '/imgs/files/mark.svg';
|
||||
}
|
||||
return '/imgs/files/collection.svg';
|
||||
}
|
||||
|
Reference in New Issue
Block a user