Added xray access log viewer (#3309)

* added xray access log viewer

* made modal window width adaptive

* hide logs button if xray logs are disabled
This commit is contained in:
fgsfds
2025-08-04 21:47:48 +05:00
committed by GitHub
parent 05e60af283
commit 957f3dbb54
3 changed files with 151 additions and 2 deletions

View File

@@ -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)
@@ -134,6 +135,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 {