🐛 修复展示对游客隐藏服务器

This commit is contained in:
naiba 2024-09-28 01:19:02 +08:00
parent 106d58575b
commit 2df57e6249

View File

@ -217,13 +217,16 @@ func (cp *commonPage) getServerStat(c *gin.Context, withPublicNote bool) ([]byte
singleton.SortedServerLock.RLock()
defer singleton.SortedServerLock.RUnlock()
var servers []*model.Server
var serverList []*model.Server
if authorized {
serverList = singleton.SortedServerList
} else {
serverList = singleton.SortedServerListForGuest
}
for _, server := range singleton.SortedServerListForGuest {
var servers []*model.Server
for _, server := range serverList {
item := *server
if item.HideForGuest && !authorized {
continue
}
if !withPublicNote {
item.PublicNote = ""
}