展示服务器列表

This commit is contained in:
奶爸
2019-12-09 18:14:31 +08:00
parent 58277ba0b6
commit bfe6d48927
18 changed files with 173 additions and 77 deletions

View File

@@ -26,10 +26,10 @@ func (cp *commonPage) home(c *gin.Context) {
if ok && isLogin.(bool) {
admin = dao.Admin
}
var servers []model.Server
dao.DB.Find(&servers)
dao.ServerLock.RLock()
defer dao.ServerLock.RUnlock()
c.HTML(http.StatusOK, "page/home", mygin.CommonEnvironment(c, gin.H{
"Admin": admin,
"Servers": servers,
"Servers": dao.ServerList,
}))
}