feat: implement geofiles update in panel (#2971)

solves #2672

Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
Shishkevich D.
2025-05-06 23:10:58 +07:00
committed by GitHub
parent c3084aaece
commit 1aed2d8cdc
16 changed files with 186 additions and 38 deletions

View File

@@ -44,6 +44,7 @@ func (a *ServerController) initRouter(g *gin.RouterGroup) {
g.POST("/stopXrayService", a.stopXrayService)
g.POST("/restartXrayService", a.restartXrayService)
g.POST("/installXray/:version", a.installXray)
g.POST("/updateGeofile/:fileName", a.updateGeofile)
g.POST("/logs/:count", a.getLogs)
g.POST("/getConfigJson", a.getConfigJson)
g.GET("/getDb", a.getDb)
@@ -95,7 +96,13 @@ func (a *ServerController) getXrayVersion(c *gin.Context) {
func (a *ServerController) installXray(c *gin.Context) {
version := c.Param("version")
err := a.serverService.UpdateXray(version)
jsonMsg(c, I18nWeb(c, "install")+" xray", err)
jsonMsg(c, I18nWeb(c, "pages.index.xraySwitchVersionPopover"), err)
}
func (a *ServerController) updateGeofile(c *gin.Context) {
fileName := c.Param("fileName")
err := a.serverService.UpdateGeofile(fileName)
jsonMsg(c, I18nWeb(c, "pages.index.geofileUpdatePopover"), err)
}
func (a *ServerController) stopXrayService(c *gin.Context) {