fix(admin): 模型导入 - 按上游模型 ID 去重
This commit is contained in:
1 parent
c7370b1d0f
commit
81162f9138
2 files changed
+4
-3
No files matched your search
@@ -231,7 +231,7 @@ export function ChannelModelManager({ channel, onClose, onChanged }: { channel:
|
||||
return true;
|
||||
});
|
||||
const pagedItems = filteredItems.slice((page - 1) * pageSize, page * pageSize);
|
||||
const existingFetchModelKeys = new Set(items.map((item) => normalizeFetchModelKey(item.modelKey)));
|
||||
const existingFetchModelKeys = new Set(items.flatMap((item) => [item.modelKey, item.providerModelKey].filter(Boolean).map(normalizeFetchModelKey)));
|
||||
const selectedNewFetchModels = selectedFetchModels.filter((name) => !existingFetchModelKeys.has(normalizeFetchModelKey(name)));
|
||||
const selectedExistingFetchCount = selectedFetchModels.length - selectedNewFetchModels.length;
|
||||
const allFetchModelsSelected = fetchPreviewModels.length > 0 && fetchPreviewModels.every((name) => selectedFetchModels.includes(name));
|
||||
|
||||
Reference in new issue
Block a user