This commit is contained in:
Archer
2023-10-30 13:26:42 +08:00
committed by GitHub
parent 008d0af010
commit 60ee160131
216 changed files with 4429 additions and 2229 deletions

View File

@@ -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';
}