diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2025-09-20 10:35:50 +0300 |
| commit | 6ced549deaecb42b9bb93ea9efcb4c1bbaabe8a4 (patch) | |
| tree | 28d8d82530476cf607e4d05ca189ae05868711e6 /web/controller/xui.go | |
| parent | f60682a6b7cb749fee403c84e2587c3ad7e7ced0 (diff) | |
docs: add comments for all functions
Diffstat (limited to 'web/controller/xui.go')
| -rw-r--r-- | web/controller/xui.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/controller/xui.go b/web/controller/xui.go index 1afbc427..ba415ac9 100644 --- a/web/controller/xui.go +++ b/web/controller/xui.go @@ -4,6 +4,7 @@ import ( "github.com/gin-gonic/gin" ) +// XUIController is the main controller for the X-UI panel, managing sub-controllers. type XUIController struct { BaseController @@ -13,12 +14,14 @@ type XUIController struct { xraySettingController *XraySettingController } +// NewXUIController creates a new XUIController and initializes its routes. func NewXUIController(g *gin.RouterGroup) *XUIController { a := &XUIController{} a.initRouter(g) return a } +// initRouter sets up the main panel routes and initializes sub-controllers. func (a *XUIController) initRouter(g *gin.RouterGroup) { g = g.Group("/panel") g.Use(a.checkLogin) @@ -34,18 +37,22 @@ func (a *XUIController) initRouter(g *gin.RouterGroup) { a.xraySettingController = NewXraySettingController(g) } +// index renders the main panel index page. func (a *XUIController) index(c *gin.Context) { html(c, "index.html", "pages.index.title", nil) } +// inbounds renders the inbounds management page. func (a *XUIController) inbounds(c *gin.Context) { html(c, "inbounds.html", "pages.inbounds.title", nil) } +// settings renders the settings management page. func (a *XUIController) settings(c *gin.Context) { html(c, "settings.html", "pages.settings.title", nil) } +// xraySettings renders the Xray settings page. func (a *XUIController) xraySettings(c *gin.Context) { html(c, "xray.html", "pages.xray.title", nil) } |
