diff options
| author | Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-20 18:21:45 +0300 |
|---|---|---|
| committer | Hamidreza Ghavami <70919649+hamid-gh98@users.noreply.github.com> | 2023-05-20 18:21:45 +0300 |
| commit | 9b7cddbec747af9d3a70dddb1179ecb14659d67e (patch) | |
| tree | d41b86baefdde4ede701e96b5b831c7472b1f384 /web/controller/inbound.go | |
| parent | 2bd706aa92c2cbb095ca518cd48a73d4ed5d16cc (diff) | |
update to use WebI18n func
Diffstat (limited to 'web/controller/inbound.go')
| -rw-r--r-- | web/controller/inbound.go | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/web/controller/inbound.go b/web/controller/inbound.go index 8360cf62..d91c6a46 100644 --- a/web/controller/inbound.go +++ b/web/controller/inbound.go @@ -60,7 +60,7 @@ func (a *InboundController) getInbounds(c *gin.Context) { user := session.GetLoginUser(c) inbounds, err := a.inboundService.GetInbounds(user.Id) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.toasts.obtain"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.toasts.obtain"), err) return } jsonObj(c, inbounds, nil) @@ -68,12 +68,12 @@ func (a *InboundController) getInbounds(c *gin.Context) { func (a *InboundController) getInbound(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "get"), err) + jsonMsg(c, WebI18n(c, "get"), err) return } inbound, err := a.inboundService.GetInbound(id) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.toasts.obtain"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.toasts.obtain"), err) return } jsonObj(c, inbound, nil) @@ -93,7 +93,7 @@ func (a *InboundController) addInbound(c *gin.Context) { inbound := &model.Inbound{} err := c.ShouldBind(inbound) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.create"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.create"), err) return } user := session.GetLoginUser(c) @@ -101,7 +101,7 @@ func (a *InboundController) addInbound(c *gin.Context) { inbound.Enable = true inbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port) inbound, err = a.inboundService.AddInbound(inbound) - jsonMsgObj(c, I18n(c, "pages.inbounds.create"), inbound, err) + jsonMsgObj(c, WebI18n(c, "pages.inbounds.create"), inbound, err) if err == nil { a.xrayService.SetToNeedRestart() } @@ -110,11 +110,11 @@ func (a *InboundController) addInbound(c *gin.Context) { func (a *InboundController) delInbound(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "delete"), err) + jsonMsg(c, WebI18n(c, "delete"), err) return } err = a.inboundService.DelInbound(id) - jsonMsgObj(c, I18n(c, "delete"), id, err) + jsonMsgObj(c, WebI18n(c, "delete"), id, err) if err == nil { a.xrayService.SetToNeedRestart() } @@ -123,7 +123,7 @@ func (a *InboundController) delInbound(c *gin.Context) { func (a *InboundController) updateInbound(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } inbound := &model.Inbound{ @@ -131,11 +131,11 @@ func (a *InboundController) updateInbound(c *gin.Context) { } err = c.ShouldBind(inbound) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } inbound, err = a.inboundService.UpdateInbound(inbound) - jsonMsgObj(c, I18n(c, "pages.inbounds.update"), inbound, err) + jsonMsgObj(c, WebI18n(c, "pages.inbounds.update"), inbound, err) if err == nil { a.xrayService.SetToNeedRestart() } @@ -165,7 +165,7 @@ func (a *InboundController) addInboundClient(c *gin.Context) { data := &model.Inbound{} err := c.ShouldBind(data) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } @@ -183,7 +183,7 @@ func (a *InboundController) addInboundClient(c *gin.Context) { func (a *InboundController) delInboundClient(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } clientId := c.Param("clientId") @@ -205,7 +205,7 @@ func (a *InboundController) updateInboundClient(c *gin.Context) { inbound := &model.Inbound{} err := c.ShouldBind(inbound) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } @@ -223,7 +223,7 @@ func (a *InboundController) updateInboundClient(c *gin.Context) { func (a *InboundController) resetClientTraffic(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } email := c.Param("email") @@ -251,7 +251,7 @@ func (a *InboundController) resetAllTraffics(c *gin.Context) { func (a *InboundController) resetAllClientTraffics(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } @@ -266,7 +266,7 @@ func (a *InboundController) resetAllClientTraffics(c *gin.Context) { func (a *InboundController) delDepletedClients(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { - jsonMsg(c, I18n(c, "pages.inbounds.update"), err) + jsonMsg(c, WebI18n(c, "pages.inbounds.update"), err) return } err = a.inboundService.DelDepletedClients(id) |
