2023-02-09 22:18:06 +03:00
|
|
|
package controller
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
)
|
|
|
|
|
|
|
|
type XUIController struct {
|
|
|
|
BaseController
|
|
|
|
|
|
|
|
inboundController *InboundController
|
|
|
|
settingController *SettingController
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewXUIController(g *gin.RouterGroup) *XUIController {
|
|
|
|
a := &XUIController{}
|
|
|
|
a.initRouter(g)
|
|
|
|
return a
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *XUIController) initRouter(g *gin.RouterGroup) {
|
2023-05-12 21:06:05 +03:00
|
|
|
g = g.Group("/panel")
|
2023-02-09 22:18:06 +03:00
|
|
|
g.Use(a.checkLogin)
|
|
|
|
|
|
|
|
g.GET("/", a.index)
|
|
|
|
g.GET("/inbounds", a.inbounds)
|
2023-05-04 19:39:08 +03:00
|
|
|
g.GET("/settings", a.settings)
|
2023-02-09 22:18:06 +03:00
|
|
|
|
|
|
|
a.inboundController = NewInboundController(g)
|
|
|
|
a.settingController = NewSettingController(g)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *XUIController) index(c *gin.Context) {
|
|
|
|
html(c, "index.html", "pages.index.title", nil)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (a *XUIController) inbounds(c *gin.Context) {
|
|
|
|
html(c, "inbounds.html", "pages.inbounds.title", nil)
|
|
|
|
}
|
|
|
|
|
2023-05-04 19:39:08 +03:00
|
|
|
func (a *XUIController) settings(c *gin.Context) {
|
2023-05-04 20:52:54 +03:00
|
|
|
html(c, "settings.html", "pages.settings.title", nil)
|
2023-02-09 22:18:06 +03:00
|
|
|
}
|