Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6198b0ea
authored
Nov 07, 2025
by
Seefs
Committed by
GitHub
Nov 07, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2156 from feitianbubu/pr/fix-tag-whitespace
fix: tag splitting by whitespace
parents
28295e01
92f7cdeb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
web/src/components/table/model-pricing/filter/PricingTags.jsx
+2
-2
web/src/hooks/model-pricing/useModelPricingData.jsx
+1
-1
web/src/hooks/model-pricing/usePricingFilterCounts.js
+1
-1
No files found.
web/src/components/table/model-pricing/filter/PricingTags.jsx
View file @
6198b0ea
...
@@ -44,7 +44,7 @@ const PricingTags = ({
...
@@ -44,7 +44,7 @@ const PricingTags = ({
(
allModels
.
length
>
0
?
allModels
:
models
).
forEach
((
model
)
=>
{
(
allModels
.
length
>
0
?
allModels
:
models
).
forEach
((
model
)
=>
{
if
(
model
.
tags
)
{
if
(
model
.
tags
)
{
model
.
tags
model
.
tags
.
split
(
/
[
,;|
\s]
+/
)
// 逗号、分号、竖线或空白字符
.
split
(
/
[
,;|
]
+/
)
// 逗号、分号或竖线(保留空格,允许多词标签如 "open weights")
.
map
((
tag
)
=>
tag
.
trim
())
.
map
((
tag
)
=>
tag
.
trim
())
.
filter
(
Boolean
)
.
filter
(
Boolean
)
.
forEach
((
tag
)
=>
tagSet
.
add
(
tag
.
toLowerCase
()));
.
forEach
((
tag
)
=>
tagSet
.
add
(
tag
.
toLowerCase
()));
...
@@ -64,7 +64,7 @@ const PricingTags = ({
...
@@ -64,7 +64,7 @@ const PricingTags = ({
if
(
!
model
.
tags
)
return
false
;
if
(
!
model
.
tags
)
return
false
;
return
model
.
tags
return
model
.
tags
.
toLowerCase
()
.
toLowerCase
()
.
split
(
/
[
,;|
\s
]
+/
)
.
split
(
/
[
,;|
]
+/
)
.
map
((
tg
)
=>
tg
.
trim
())
.
map
((
tg
)
=>
tg
.
trim
())
.
includes
(
tagLower
);
.
includes
(
tagLower
);
}).
length
;
}).
length
;
...
...
web/src/hooks/model-pricing/useModelPricingData.jsx
View file @
6198b0ea
...
@@ -128,7 +128,7 @@ export const useModelPricingData = () => {
...
@@ -128,7 +128,7 @@ export const useModelPricingData = () => {
if
(
!
model
.
tags
)
return
false
;
if
(
!
model
.
tags
)
return
false
;
const
tagsArr
=
model
.
tags
const
tagsArr
=
model
.
tags
.
toLowerCase
()
.
toLowerCase
()
.
split
(
/
[
,;|
\s
]
+/
)
.
split
(
/
[
,;|
]
+/
)
.
map
((
tag
)
=>
tag
.
trim
())
.
map
((
tag
)
=>
tag
.
trim
())
.
filter
(
Boolean
);
.
filter
(
Boolean
);
return
tagsArr
.
includes
(
tagLower
);
return
tagsArr
.
includes
(
tagLower
);
...
...
web/src/hooks/model-pricing/usePricingFilterCounts.js
View file @
6198b0ea
...
@@ -23,7 +23,7 @@ import { useMemo } from 'react';
...
@@ -23,7 +23,7 @@ import { useMemo } from 'react';
const
normalizeTags
=
(
tags
=
''
)
=>
const
normalizeTags
=
(
tags
=
''
)
=>
tags
tags
.
toLowerCase
()
.
toLowerCase
()
.
split
(
/
[
,;|
\s
]
+/
)
.
split
(
/
[
,;|
]
+/
)
.
map
((
t
)
=>
t
.
trim
())
.
map
((
t
)
=>
t
.
trim
())
.
filter
(
Boolean
);
.
filter
(
Boolean
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment