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:
authorHamidreza Ghavami <hamid.r.gh.1998@gmail.com>2023-04-18 19:51:09 +0300
committerHamidreza Ghavami <hamid.r.gh.1998@gmail.com>2023-04-18 19:51:09 +0300
commit846efe8eb4f25a6cd34b9c1bf0adcc5df89fa6ed (patch)
treec70ee7f0af1f2ae4910c5364f96bce0c0386d195 /web/controller/setting.go
parent8b79b5a315641293c4fb569816fd711d9572fffa (diff)
add api route setting/getDefaultJsonConfig
Diffstat (limited to 'web/controller/setting.go')
-rw-r--r--web/controller/setting.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/web/controller/setting.go b/web/controller/setting.go
index 261eeec8..1de55ab6 100644
--- a/web/controller/setting.go
+++ b/web/controller/setting.go
@@ -37,6 +37,7 @@ func (a *SettingController) initRouter(g *gin.RouterGroup) {
g.POST("/update", a.updateSetting)
g.POST("/updateUser", a.updateUser)
g.POST("/restartPanel", a.restartPanel)
+ g.GET("/getDefaultJsonConfig", a.getDefaultJsonConfig)
}
func (a *SettingController) getAllSetting(c *gin.Context) {
@@ -48,6 +49,15 @@ func (a *SettingController) getAllSetting(c *gin.Context) {
jsonObj(c, allSetting, nil)
}
+func (a *SettingController) getDefaultJsonConfig(c *gin.Context) {
+ defaultJsonConfig, err := a.settingService.GetDefaultJsonConfig()
+ if err != nil {
+ jsonMsg(c, I18n(c, "pages.setting.toasts.getSetting"), err)
+ return
+ }
+ jsonObj(c, defaultJsonConfig, nil)
+}
+
func (a *SettingController) getDefaultSettings(c *gin.Context) {
expireDiff, err := a.settingService.GetExpireDiff()
if err != nil {