This commit is contained in:
CalciumIon
2024-12-27 21:59:05 +08:00
parent 1cef91a741
commit 52c023a1dd
2 changed files with 18 additions and 34 deletions

View File

@@ -34,8 +34,9 @@ func UpdateUserUsableGroupsByJSONString(jsonStr string) error {
func GetUserUsableGroups(userGroup string) map[string]string { func GetUserUsableGroups(userGroup string) map[string]string {
groupsCopy := GetUserUsableGroupsCopy() groupsCopy := GetUserUsableGroupsCopy()
if userGroup == "" { if userGroup == "" {
// 如果userGroup为空返回UserUsableGroups if _, ok := groupsCopy["default"]; !ok {
return groupsCopy groupsCopy["default"] = "default"
}
} }
// 如果userGroup不在UserUsableGroups中返回UserUsableGroups + userGroup // 如果userGroup不在UserUsableGroups中返回UserUsableGroups + userGroup
if _, ok := groupsCopy[userGroup]; !ok { if _, ok := groupsCopy[userGroup]; !ok {

View File

@@ -81,41 +81,24 @@ const ModelPricing = () => {
} }
function renderAvailable(available) { function renderAvailable(available) {
return available ? ( return (
<Popover <Popover
content={ content={
<div style={{ padding: 8 }}>{t('您的分组可以使用该模型')}</div> <div style={{ padding: 8 }}>{t('您的分组可以使用该模型')}</div>
} }
position='top' position='top'
key={available} key={available}
style={{ style={{
backgroundColor: 'rgba(var(--semi-blue-4),1)', backgroundColor: 'rgba(var(--semi-blue-4),1)',
borderColor: 'rgba(var(--semi-blue-4),1)', borderColor: 'rgba(var(--semi-blue-4),1)',
color: 'var(--semi-color-white)', color: 'var(--semi-color-white)',
borderWidth: 1, borderWidth: 1,
borderStyle: 'solid', borderStyle: 'solid',
}} }}
> >
<IconVerify style={{ color: 'green' }} size="large" /> <IconVerify style={{ color: 'green' }} size="large" />
</Popover> </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',
}}
>
<IconUploadError style={{ color: '#FFA54F' }} size="large" />
</Popover>
);
} }
const columns = [ const columns = [