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
05e389fe
authored
Dec 27, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix #663
parent
6093ae6f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
34 deletions
+18
-34
setting/user_usable_group.go
+3
-2
web/src/components/ModelPricing.js
+15
-32
No files found.
setting/user_usable_group.go
View file @
05e389fe
...
...
@@ -34,8 +34,9 @@ func UpdateUserUsableGroupsByJSONString(jsonStr string) error {
func
GetUserUsableGroups
(
userGroup
string
)
map
[
string
]
string
{
groupsCopy
:=
GetUserUsableGroupsCopy
()
if
userGroup
==
""
{
// 如果userGroup为空,返回UserUsableGroups
return
groupsCopy
if
_
,
ok
:=
groupsCopy
[
"default"
];
!
ok
{
groupsCopy
[
"default"
]
=
"default"
}
}
// 如果userGroup不在UserUsableGroups中,返回UserUsableGroups + userGroup
if
_
,
ok
:=
groupsCopy
[
userGroup
];
!
ok
{
...
...
web/src/components/ModelPricing.js
View file @
05e389fe
...
...
@@ -81,41 +81,24 @@ const ModelPricing = () => {
}
function
renderAvailable
(
available
)
{
return
available
?
(
return
(
<
Popover
content
=
{
<
div
style
=
{{
padding
:
8
}}
>
{
t
(
'您的分组可以使用该模型'
)}
<
/div
>
}
position
=
'top'
key
=
{
available
}
style
=
{{
backgroundColor
:
'rgba(var(--semi-blue-4),1)'
,
borderColor
:
'rgba(var(--semi-blue-4),1)'
,
color
:
'var(--semi-color-white)'
,
borderWidth
:
1
,
borderStyle
:
'solid'
,
}}
>
<
IconVerify
style
=
{{
color
:
'green'
}}
size
=
"large"
/>
<
/Popover
>
)
:
(
<
Popover
content
=
{
<
div
style
=
{{
padding
:
8
}}
>
{
t
(
'您的分组无权使用该模型'
)}
<
/div
>
}
position
=
'top'
key
=
{
available
}
style
=
{{
backgroundColor
:
'rgba(var(--semi-blue-4),1)'
,
borderColor
:
'rgba(var(--semi-blue-4),1)'
,
color
:
'var(--semi-color-white)'
,
borderWidth
:
1
,
borderStyle
:
'solid'
,
}}
content
=
{
<
div
style
=
{{
padding
:
8
}}
>
{
t
(
'您的分组可以使用该模型'
)}
<
/div
>
}
position
=
'top'
key
=
{
available
}
style
=
{{
backgroundColor
:
'rgba(var(--semi-blue-4),1)'
,
borderColor
:
'rgba(var(--semi-blue-4),1)'
,
color
:
'var(--semi-color-white)'
,
borderWidth
:
1
,
borderStyle
:
'solid'
,
}}
>
<
IconUploadError
style
=
{{
color
:
'#FFA54F
'
}}
size
=
"large"
/>
<
IconVerify
style
=
{{
color
:
'green
'
}}
size
=
"large"
/>
<
/Popover
>
)
;
)
}
const
columns
=
[
...
...
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