mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
refac: dedup tags
This commit is contained in:
parent
cde4b93fa6
commit
314cac0113
1 changed files with 8 additions and 3 deletions
|
|
@ -121,7 +121,10 @@
|
|||
if (selectedTag === '') {
|
||||
return true;
|
||||
}
|
||||
return (item.model?.tags ?? []).map((tag) => tag.name).includes(selectedTag);
|
||||
|
||||
return (item.model?.tags ?? [])
|
||||
.map((tag) => tag.name.toLowerCase())
|
||||
.includes(selectedTag.toLowerCase());
|
||||
})
|
||||
.filter((item) => {
|
||||
if (selectedConnectionType === '') {
|
||||
|
|
@ -139,7 +142,9 @@
|
|||
if (selectedTag === '') {
|
||||
return true;
|
||||
}
|
||||
return (item.model?.tags ?? []).map((tag) => tag.name).includes(selectedTag);
|
||||
return (item.model?.tags ?? [])
|
||||
.map((tag) => tag.name.toLowerCase())
|
||||
.includes(selectedTag.toLowerCase());
|
||||
})
|
||||
.filter((item) => {
|
||||
if (selectedConnectionType === '') {
|
||||
|
|
@ -315,7 +320,7 @@
|
|||
tags = items
|
||||
.filter((item) => !(item.model?.info?.meta?.hidden ?? false))
|
||||
.flatMap((item) => item.model?.tags ?? [])
|
||||
.map((tag) => tag.name);
|
||||
.map((tag) => tag.name.toLowerCase());
|
||||
// Remove duplicates and sort
|
||||
tags = Array.from(new Set(tags)).sort((a, b) => a.localeCompare(b));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue