Files
trihuy-russian/web/controller/xui.go
T

52 lines
1.2 KiB
Go
Raw Normal View History

2023-02-09 22:48:06 +03:30
package controller
import (
"github.com/gin-gonic/gin"
)
type XUIController struct {
BaseController
2023-12-04 19:20:46 +01:00
inboundController *InboundController
2025-09-09 01:22:43 +02:00
serverController *ServerController
2023-12-04 19:20:46 +01:00
settingController *SettingController
xraySettingController *XraySettingController
2023-02-09 22:48:06 +03:30
}
func NewXUIController(g *gin.RouterGroup) *XUIController {
a := &XUIController{}
a.initRouter(g)
return a
}
func (a *XUIController) initRouter(g *gin.RouterGroup) {
2023-05-12 22:36:05 +04:30
g = g.Group("/panel")
2023-02-09 22:48:06 +03:30
g.Use(a.checkLogin)
g.GET("/", a.index)
g.GET("/inbounds", a.inbounds)
g.GET("/settings", a.settings)
2023-12-04 19:20:46 +01:00
g.GET("/xray", a.xraySettings)
2023-02-09 22:48:06 +03:30
a.inboundController = NewInboundController(g)
2025-09-09 01:22:43 +02:00
a.serverController = NewServerController(g)
2023-02-09 22:48:06 +03:30
a.settingController = NewSettingController(g)
2023-12-04 19:20:46 +01:00
a.xraySettingController = NewXraySettingController(g)
2023-02-09 22:48:06 +03:30
}
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)
}
func (a *XUIController) settings(c *gin.Context) {
2023-05-04 22:22:54 +04:30
html(c, "settings.html", "pages.settings.title", nil)
2023-02-09 22:48:06 +03:30
}
2023-12-04 19:20:46 +01:00
func (a *XUIController) xraySettings(c *gin.Context) {
html(c, "xray.html", "pages.xray.title", nil)
}