diff --git a/web/controller/server.go b/web/controller/server.go index 22f89f2f..9e167153 100644 --- a/web/controller/server.go +++ b/web/controller/server.go @@ -46,6 +46,7 @@ func (a *ServerController) initRouter(g *gin.RouterGroup) { g.POST("/installXray/:version", a.installXray) g.POST("/updateGeofile/:fileName", a.updateGeofile) g.POST("/logs/:count", a.getLogs) + g.POST("/xraylogs/:count", a.getXrayLogs) g.POST("/getConfigJson", a.getConfigJson) g.GET("/getDb", a.getDb) g.POST("/importDB", a.importDB) @@ -133,6 +134,12 @@ func (a *ServerController) getLogs(c *gin.Context) { jsonObj(c, logs, nil) } +func (a *ServerController) getXrayLogs(c *gin.Context) { + count := c.Param("count") + logs := a.serverService.GetXrayLogs(count) + jsonObj(c, logs, nil) +} + func (a *ServerController) getConfigJson(c *gin.Context) { configJson, err := a.serverService.GetConfigJson() if err != nil { diff --git a/web/html/index.html b/web/html/index.html index db678cd6..b60ebf7b 100644 --- a/web/html/index.html +++ b/web/html/index.html @@ -167,7 +167,10 @@ {{ i18n "pages.index.xrayErrorPopoverTitle" }} - + + + + @@ -179,6 +182,10 @@