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
a9b366bb
authored
Feb 04, 2026
by
Seefs
Committed by
GitHub
Feb 04, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix(ui): use distinct color palette for group tags"
parent
a8ff74c2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
30 deletions
+2
-30
web/src/helpers/render.jsx
+2
-30
No files found.
web/src/helpers/render.jsx
View file @
a9b366bb
...
...
@@ -178,7 +178,7 @@ export const getModelCategories = (() => {
model
.
model_name
.
toLowerCase
().
includes
(
'text-embedding-004'
)
||
model
.
model_name
.
toLowerCase
().
includes
(
'imagen-4'
)
||
model
.
model_name
.
toLowerCase
().
includes
(
'veo-'
)
||
model
.
model_name
.
toLowerCase
().
includes
(
'aqa'
),
model
.
model_name
.
toLowerCase
().
includes
(
'aqa'
)
,
},
moonshot
:
{
label
:
'Moonshot'
,
...
...
@@ -605,34 +605,6 @@ export function stringToColor(str) {
return
colors
[
i
];
}
// High-contrast color palette for group tags (avoids similar blue/teal shades)
const
groupColors
=
[
'red'
,
'orange'
,
'yellow'
,
'lime'
,
'green'
,
'cyan'
,
'blue'
,
'indigo'
,
'violet'
,
'purple'
,
'pink'
,
'amber'
,
'grey'
,
];
export
function
groupToColor
(
str
)
{
// Use a better hash algorithm for more even distribution
let
hash
=
0
;
for
(
let
i
=
0
;
i
<
str
.
length
;
i
++
)
{
hash
=
(
hash
<<
5
)
-
hash
+
str
.
charCodeAt
(
i
);
hash
=
hash
&
hash
;
}
hash
=
Math
.
abs
(
hash
);
return
groupColors
[
hash
%
groupColors
.
length
];
}
// 渲染带有模型图标的标签
export
function
renderModelTag
(
modelName
,
options
=
{})
{
const
{
...
...
@@ -701,7 +673,7 @@ export function renderGroup(group) {
<
span
key=
{
group
}
>
{
groups
.
map
((
group
)
=>
(
<
Tag
color=
{
tagColors
[
group
]
||
group
ToColor
(
group
)
}
color=
{
tagColors
[
group
]
||
string
ToColor
(
group
)
}
key=
{
group
}
shape=
'circle'
onClick=
{
async
(
event
)
=>
{
...
...
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