Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMHSanaei <mc.sanaei@gmail.com>2023-02-09 22:18:06 +0300
committerMHSanaei <mc.sanaei@gmail.com>2023-02-09 22:18:06 +0300
commitb73e4173a3c1e69e02ad6b4e3b43e425e57a5be9 (patch)
treed95d2f5e903d97082e11eb9f9023c165b1bde388 /web/controller/xui.go
3x-ui
Diffstat (limited to 'web/controller/xui.go')
-rw-r--r--web/controller/xui.go42
1 files changed, 42 insertions, 0 deletions
diff --git a/web/controller/xui.go b/web/controller/xui.go
new file mode 100644
index 00000000..5832be84
--- /dev/null
+++ b/web/controller/xui.go
@@ -0,0 +1,42 @@
+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) {
+ g = g.Group("/xui")
+ g.Use(a.checkLogin)
+
+ g.GET("/", a.index)
+ g.GET("/inbounds", a.inbounds)
+ g.GET("/setting", a.setting)
+
+ 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)
+}
+
+func (a *XUIController) setting(c *gin.Context) {
+ html(c, "setting.html", "pages.setting.title", nil)
+}