feat: seed default dataset sources
This commit is contained in:
@@ -35,6 +35,7 @@ type SourceDraft = {
|
||||
name: string
|
||||
kind: DatasetSourceKind
|
||||
url: string
|
||||
iconUrl: string
|
||||
description: string
|
||||
enabled: boolean
|
||||
}
|
||||
@@ -43,6 +44,7 @@ const EMPTY_SOURCE_DRAFT: SourceDraft = {
|
||||
name: '',
|
||||
kind: 'link',
|
||||
url: '',
|
||||
iconUrl: '',
|
||||
description: '',
|
||||
enabled: true,
|
||||
}
|
||||
@@ -105,6 +107,7 @@ export function WorkspaceExplorePage({
|
||||
name: '全部',
|
||||
kind: 'manual',
|
||||
url: '',
|
||||
iconUrl: '',
|
||||
description: '全部探索内容',
|
||||
enabled: true,
|
||||
lastSyncedAt: null,
|
||||
@@ -118,7 +121,9 @@ export function WorkspaceExplorePage({
|
||||
allSource,
|
||||
...sourceRecords.map((source) => ({
|
||||
...source,
|
||||
icon: sourceIcon(source.kind),
|
||||
icon: source.iconUrl
|
||||
? <img className="explore-source-image" src={source.iconUrl} alt="" />
|
||||
: sourceIcon(source.kind),
|
||||
color: sourceColor(source.kind),
|
||||
})),
|
||||
]
|
||||
@@ -156,6 +161,7 @@ export function WorkspaceExplorePage({
|
||||
name: source.name,
|
||||
kind: source.kind,
|
||||
url: source.url,
|
||||
iconUrl: source.iconUrl,
|
||||
description: source.description,
|
||||
enabled: source.enabled,
|
||||
})
|
||||
@@ -168,6 +174,7 @@ export function WorkspaceExplorePage({
|
||||
name: sourceDraft.name.trim(),
|
||||
kind: sourceDraft.kind,
|
||||
url: sourceDraft.url.trim(),
|
||||
iconUrl: sourceDraft.iconUrl,
|
||||
description: sourceDraft.description.trim(),
|
||||
enabled: sourceDraft.enabled,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user