feat: sync deployed v1.0.0-rc.38-custom.67
This commit is contained in:
1 parent
d09216bbde
commit
8e6ed0317b
154 files changed
+39540
-20509
No files matched your search
+20
-2
@@ -34,6 +34,20 @@ func GetUserGroups(c *gin.Context) {
|
||||
userGroup := ""
|
||||
userId := c.GetInt("id")
|
||||
userGroup, _ = model.GetUserGroup(userId, false)
|
||||
if err := model.LoadPersonalGroupRatios(c, userId); err != nil {
|
||||
common.ApiError(c, err)
|
||||
return
|
||||
}
|
||||
metadata, err := model.GetGroupMetadata(c.Request.Context())
|
||||
if err != nil {
|
||||
common.ApiError(c, err)
|
||||
return
|
||||
}
|
||||
recent, err := service.RecentDegradedGroups(c.Request.Context())
|
||||
if err != nil {
|
||||
common.ApiError(c, err)
|
||||
return
|
||||
}
|
||||
userUsableGroups := service.GetUserUsableGroups(userGroup)
|
||||
for groupName, _ := range ratio_setting.GetGroupRatioCopy() {
|
||||
if _, ok := enabledGroups[groupName]; !ok {
|
||||
@@ -42,8 +56,12 @@ func GetUserGroups(c *gin.Context) {
|
||||
// UserUsableGroups contains the groups that the user can use
|
||||
if desc, ok := userUsableGroups[groupName]; ok {
|
||||
usableGroups[groupName] = map[string]any{
|
||||
"ratio": service.GetUserGroupRatio(userGroup, groupName),
|
||||
"desc": desc,
|
||||
"ratio": model.EffectiveGroupRatio(c, userGroup, groupName).GroupRatio,
|
||||
"base_ratio": ratio_setting.GetGroupRatio(groupName),
|
||||
"has_personal_ratio": model.HasPersonalGroupRatio(c, groupName),
|
||||
"tags": metadata[groupName].Tags,
|
||||
"recent_degraded": recent[groupName] && !metadata[groupName].HideRecentDegraded,
|
||||
"desc": desc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user