mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
添加服务器 & 展示服务器
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package controller
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
type memberPage struct {
|
||||
@@ -18,4 +22,14 @@ func (mp *memberPage) serve() {
|
||||
Btn: "点此登录",
|
||||
Redirect: "/login",
|
||||
}))
|
||||
mr.GET("/server", mp.server)
|
||||
}
|
||||
|
||||
func (mp *memberPage) server(c *gin.Context) {
|
||||
var servers []model.Server
|
||||
dao.DB.Find(&servers)
|
||||
c.HTML(http.StatusOK, "page/server", mygin.CommonEnvironment(c, gin.H{
|
||||
"Title": "服务器管理",
|
||||
"Servers": servers,
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user