mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 12:48:14 -05:00
🐛 修复展示对游客隐藏服务器
This commit is contained in:
parent
106d58575b
commit
2df57e6249
@ -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 = ""
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user