展示服务器列表

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

@@ -4,7 +4,6 @@ import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/p14yground/nezha/model"
"github.com/p14yground/nezha/pkg/mygin"
"github.com/p14yground/nezha/service/dao"
)
@@ -26,10 +25,10 @@ func (mp *memberPage) serve() {
}
func (mp *memberPage) server(c *gin.Context) {
var servers []model.Server
dao.DB.Find(&servers)
dao.ServerLock.RLock()
defer dao.ServerLock.RUnlock()
c.HTML(http.StatusOK, "page/server", mygin.CommonEnvironment(c, gin.H{
"Title": "服务器管理",
"Servers": servers,
"Servers": dao.ServerList,
}))
}