mirror of
https://github.com/alireza0/x-ui.git
synced 2026-03-14 05:23:09 +00:00
update: translate inbound component
This commit is contained in:
@@ -49,7 +49,7 @@ func (a *InboundController) getInbounds(c *gin.Context) {
|
||||
user := session.GetLoginUser(c)
|
||||
inbounds, err := a.inboundService.GetInbounds(user.Id)
|
||||
if err != nil {
|
||||
jsonMsg(c, "获取", err)
|
||||
jsonMsg(c, I18n(c , "pages.inbounds.toasts.obtain"), err)
|
||||
return
|
||||
}
|
||||
jsonObj(c, inbounds, nil)
|
||||
@@ -59,7 +59,7 @@ func (a *InboundController) addInbound(c *gin.Context) {
|
||||
inbound := &model.Inbound{}
|
||||
err := c.ShouldBind(inbound)
|
||||
if err != nil {
|
||||
jsonMsg(c, "添加", err)
|
||||
jsonMsg(c, I18n(c , "pages.inbounds.addTo"), err)
|
||||
return
|
||||
}
|
||||
user := session.GetLoginUser(c)
|
||||
@@ -67,7 +67,7 @@ func (a *InboundController) addInbound(c *gin.Context) {
|
||||
inbound.Enable = true
|
||||
inbound.Tag = fmt.Sprintf("inbound-%v", inbound.Port)
|
||||
err = a.inboundService.AddInbound(inbound)
|
||||
jsonMsg(c, "添加", err)
|
||||
jsonMsg(c, I18n(c , "pages.inbounds.addTo"), err)
|
||||
if err == nil {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
@@ -76,11 +76,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, "删除", err)
|
||||
jsonMsg(c, I18n(c , "delete"), err)
|
||||
return
|
||||
}
|
||||
err = a.inboundService.DelInbound(id)
|
||||
jsonMsg(c, "删除", err)
|
||||
jsonMsg(c, I18n(c , "delete"), err)
|
||||
if err == nil {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
@@ -89,7 +89,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, "修改", err)
|
||||
jsonMsg(c, I18n(c , "pages.inbounds.revise"), err)
|
||||
return
|
||||
}
|
||||
inbound := &model.Inbound{
|
||||
@@ -97,11 +97,11 @@ func (a *InboundController) updateInbound(c *gin.Context) {
|
||||
}
|
||||
err = c.ShouldBind(inbound)
|
||||
if err != nil {
|
||||
jsonMsg(c, "修改", err)
|
||||
jsonMsg(c, I18n(c , "pages.inbounds.revise"), err)
|
||||
return
|
||||
}
|
||||
err = a.inboundService.UpdateInbound(inbound)
|
||||
jsonMsg(c, "修改", err)
|
||||
jsonMsg(c, I18n(c , "pages.inbounds.revise"), err)
|
||||
if err == nil {
|
||||
a.xrayService.SetToNeedRestart()
|
||||
}
|
||||
|
||||
@@ -123,6 +123,9 @@
|
||||
"keyPath" = "key file path"
|
||||
"keyContent" = "key content"
|
||||
|
||||
[pages.inbounds.toasts]
|
||||
"obtain" = "Obtain"
|
||||
|
||||
|
||||
[pages.setting]
|
||||
"title" = "Setting"
|
||||
|
||||
@@ -120,7 +120,8 @@
|
||||
"keyPath" = "密钥文件路径"
|
||||
"keyContent" = "密钥内容"
|
||||
|
||||
|
||||
[pages.inbounds.toasts]
|
||||
"obtain" = "获取"
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user