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:
authorShishkevich D. <135337715+shishkevichd@users.noreply.github.com>2025-05-06 19:10:58 +0300
committerGitHub <noreply@github.com>2025-05-06 19:10:58 +0300
commit1aed2d8cdcd7b971d3bc055d428a7958a71c9226 (patch)
treed70860e2eb0e5ddd85dcf69839c547cddb78af76 /web/controller/server.go
parentc3084aaecea6e2ddc309c899a5def77244b901f1 (diff)
feat: implement geofiles update in panel (#2971)
solves #2672 Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
Diffstat (limited to 'web/controller/server.go')
-rw-r--r--web/controller/server.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/controller/server.go b/web/controller/server.go
index fc7756ba..5d89e356 100644
--- a/web/controller/server.go
+++ b/web/controller/server.go
@@ -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) {