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:
-rw-r--r--main.go6
-rw-r--r--web/controller/inbound.go14
-rw-r--r--web/controller/server.go2
-rw-r--r--web/controller/xray_setting.go2
-rw-r--r--web/html/common/qrcode_modal.html8
-rw-r--r--web/html/xui/inbound_info_modal.html4
-rw-r--r--web/service/inbound.go2
-rw-r--r--web/service/setting.go6
-rw-r--r--web/service/tgbot.go16
-rw-r--r--web/service/xray_setting.go2
-rw-r--r--web/translation/translate.en_US.toml2
-rw-r--r--web/web.go4
12 files changed, 33 insertions, 35 deletions
diff --git a/main.go b/main.go
index 42514127..cc58d07b 100644
--- a/main.go
+++ b/main.go
@@ -159,19 +159,19 @@ func showSetting(show bool) {
func updateTgbotEnableSts(status bool) {
settingService := service.SettingService{}
- currentTgSts, err := settingService.GetTgbotenabled()
+ currentTgSts, err := settingService.GetTgbotEnabled()
if err != nil {
fmt.Println(err)
return
}
logger.Infof("current enabletgbot status[%v],need update to status[%v]", currentTgSts, status)
if currentTgSts != status {
- err := settingService.SetTgbotenabled(status)
+ err := settingService.SetTgbotEnabled(status)
if err != nil {
fmt.Println(err)
return
} else {
- logger.Infof("SetTgbotenabled[%v] success", status)
+ logger.Infof("SetTgbotEnabled[%v] success", status)
}
}
}
diff --git a/web/controller/inbound.go b/web/controller/inbound.go
index 511afd64..cc34d1d8 100644
--- a/web/controller/inbound.go
+++ b/web/controller/inbound.go
@@ -232,14 +232,12 @@ func (a *InboundController) resetClientTraffic(c *gin.Context) {
}
email := c.Param("email")
- needRestart := true
-
- needRestart, err = a.inboundService.ResetClientTraffic(id, email)
+ needRestart, err := a.inboundService.ResetClientTraffic(id, email)
if err != nil {
jsonMsg(c, "Something went wrong!", err)
return
}
- jsonMsg(c, "traffic reseted", nil)
+ jsonMsg(c, "Traffic has been reset", nil)
if needRestart {
a.xrayService.SetToNeedRestart()
}
@@ -253,7 +251,7 @@ func (a *InboundController) resetAllTraffics(c *gin.Context) {
} else {
a.xrayService.SetToNeedRestart()
}
- jsonMsg(c, "All traffics reseted", nil)
+ jsonMsg(c, "all traffic has been reset", nil)
}
func (a *InboundController) resetAllClientTraffics(c *gin.Context) {
@@ -270,7 +268,7 @@ func (a *InboundController) resetAllClientTraffics(c *gin.Context) {
} else {
a.xrayService.SetToNeedRestart()
}
- jsonMsg(c, "All traffics of client reseted", nil)
+ jsonMsg(c, "All traffic from the client has been reset.", nil)
}
func (a *InboundController) importInbound(c *gin.Context) {
@@ -313,9 +311,9 @@ func (a *InboundController) delDepletedClients(c *gin.Context) {
jsonMsg(c, "Something went wrong!", err)
return
}
- jsonMsg(c, "All delpeted clients are deleted", nil)
+ jsonMsg(c, "All depleted clients are deleted", nil)
}
func (a *InboundController) onlines(c *gin.Context) {
- jsonObj(c, a.inboundService.GetOnlineClinets(), nil)
+ jsonObj(c, a.inboundService.GetOnlineClients(), nil)
}
diff --git a/web/controller/server.go b/web/controller/server.go
index 0eeca71c..fc7756ba 100644
--- a/web/controller/server.go
+++ b/web/controller/server.go
@@ -105,7 +105,7 @@ func (a *ServerController) stopXrayService(c *gin.Context) {
jsonMsg(c, "", err)
return
}
- jsonMsg(c, "Xray stoped", err)
+ jsonMsg(c, "Xray stopped", err)
}
func (a *ServerController) restartXrayService(c *gin.Context) {
diff --git a/web/controller/xray_setting.go b/web/controller/xray_setting.go
index 2dddb44b..d0fe9ca3 100644
--- a/web/controller/xray_setting.go
+++ b/web/controller/xray_setting.go
@@ -81,7 +81,7 @@ func (a *XraySettingController) warp(c *gin.Context) {
resp, err = a.XraySettingService.RegWarp(skey, pkey)
case "license":
license := c.PostForm("license")
- resp, err = a.XraySettingService.SetWarpLicence(license)
+ resp, err = a.XraySettingService.SetWarpLicense(license)
}
jsonObj(c, resp, err)
diff --git a/web/html/common/qrcode_modal.html b/web/html/common/qrcode_modal.html
index fd5a17b7..94e750c7 100644
--- a/web/html/common/qrcode_modal.html
+++ b/web/html/common/qrcode_modal.html
@@ -79,8 +79,8 @@
qrModal: qrModal,
},
methods: {
- copyToClipboard(elmentId, content) {
- this.qrModal.clipboard = new ClipboardJS('#' + elmentId, {
+ copyToClipboard(elementId, content) {
+ this.qrModal.clipboard = new ClipboardJS('#' + elementId, {
text: () => content,
});
this.qrModal.clipboard.on('success', () => {
@@ -88,9 +88,9 @@
this.qrModal.clipboard.destroy();
});
},
- setQrCode(elmentId, content) {
+ setQrCode(elementId, content) {
new QRious({
- element: document.querySelector('#' + elmentId),
+ element: document.querySelector('#' + elementId),
size: 400,
value: content,
background: 'white',
diff --git a/web/html/xui/inbound_info_modal.html b/web/html/xui/inbound_info_modal.html
index a6f34001..82c9cf62 100644
--- a/web/html/xui/inbound_info_modal.html
+++ b/web/html/xui/inbound_info_modal.html
@@ -494,8 +494,8 @@
},
},
methods: {
- copyToClipboard(elmentId, content) {
- this.infoModal.clipboard = new ClipboardJS('#' + elmentId, {
+ copyToClipboard(elementId, content) {
+ this.infoModal.clipboard = new ClipboardJS('#' + elementId, {
text: () => content,
});
this.infoModal.clipboard.on('success', () => {
diff --git a/web/service/inbound.go b/web/service/inbound.go
index a1d00ad9..d82bfa9c 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -1947,6 +1947,6 @@ func (s *InboundService) MigrateDB() {
s.MigrationRemoveOrphanedTraffics()
}
-func (s *InboundService) GetOnlineClinets() []string {
+func (s *InboundService) GetOnlineClients() []string {
return p.GetOnlineClients()
}
diff --git a/web/service/setting.go b/web/service/setting.go
index 31fc1429..74755b86 100644
--- a/web/service/setting.go
+++ b/web/service/setting.go
@@ -269,11 +269,11 @@ func (s *SettingService) SetTgBotChatId(chatIds string) error {
return s.setString("tgBotChatId", chatIds)
}
-func (s *SettingService) GetTgbotenabled() (bool, error) {
+func (s *SettingService) GetTgbotEnabled() (bool, error) {
return s.getBool("tgBotEnable")
}
-func (s *SettingService) SetTgbotenabled(value bool) error {
+func (s *SettingService) SetTgbotEnabled(value bool) error {
return s.setBool("tgBotEnable", value)
}
@@ -524,7 +524,7 @@ func (s *SettingService) GetDefaultSettings(host string) (interface{}, error) {
"pageSize": func() (interface{}, error) { return s.GetPageSize() },
"defaultCert": func() (interface{}, error) { return s.GetCertFile() },
"defaultKey": func() (interface{}, error) { return s.GetKeyFile() },
- "tgBotEnable": func() (interface{}, error) { return s.GetTgbotenabled() },
+ "tgBotEnable": func() (interface{}, error) { return s.GetTgbotEnabled() },
"subEnable": func() (interface{}, error) { return s.GetSubEnable() },
"subURI": func() (interface{}, error) { return s.GetSubURI() },
"subJsonURI": func() (interface{}, error) { return s.GetSubJsonURI() },
diff --git a/web/service/tgbot.go b/web/service/tgbot.go
index c1fd79fe..eecea078 100644
--- a/web/service/tgbot.go
+++ b/web/service/tgbot.go
@@ -201,7 +201,7 @@ func (t *Tgbot) OnReceive() {
}, th.AnyCommand())
botHandler.HandleCallbackQuery(func(_ *telego.Bot, query telego.CallbackQuery) {
- t.asnwerCallback(&query, checkAdmin(query.From.ID))
+ t.answerCallback(&query, checkAdmin(query.From.ID))
}, th.AnyCallbackQueryWithMessage())
botHandler.HandleMessage(func(_ *telego.Bot, message telego.Message) {
@@ -286,7 +286,7 @@ func (t *Tgbot) answerCommand(message *telego.Message, chatId int64, isAdmin boo
}
}
-func (t *Tgbot) asnwerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool) {
+func (t *Tgbot) answerCallback(callbackQuery *telego.CallbackQuery, isAdmin bool) {
chatId := callbackQuery.Message.GetChat().ID
if isAdmin {
@@ -964,7 +964,7 @@ func (t *Tgbot) getServerUsage(chatId int64, messageID ...int) string {
return info
}
-// Send server usage without an inline keyborad
+// Send server usage without an inline keyboard
func (t *Tgbot) sendServerUsage() string {
info := t.prepareServerUsageInfo()
return info
@@ -1052,14 +1052,14 @@ func (t *Tgbot) UserLoginNotify(username string, password string, ip string, tim
func (t *Tgbot) getInboundUsages() string {
info := ""
// get traffic
- inbouds, err := t.inboundService.GetAllInbounds()
+ inbounds, err := t.inboundService.GetAllInbounds()
if err != nil {
logger.Warning("GetAllInbounds run failed:", err)
info += t.I18nBot("tgbot.answers.getInboundsFailed")
} else {
// NOTE:If there no any sessions here,need to notify here
// TODO:Sub-node push, automatic conversion format
- for _, inbound := range inbouds {
+ for _, inbound := range inbounds {
info += t.I18nBot("tgbot.messages.inbound", "Remark=="+inbound.Remark)
info += t.I18nBot("tgbot.messages.port", "Port=="+strconv.Itoa(inbound.Port))
info += t.I18nBot("tgbot.messages.traffic", "Total=="+common.FormatTraffic((inbound.Up+inbound.Down)), "Upload=="+common.FormatTraffic(inbound.Up), "Download=="+common.FormatTraffic(inbound.Down))
@@ -1332,20 +1332,20 @@ func (t *Tgbot) searchClient(chatId int64, email string, messageID ...int) {
}
func (t *Tgbot) searchInbound(chatId int64, remark string) {
- inbouds, err := t.inboundService.SearchInbounds(remark)
+ inbounds, err := t.inboundService.SearchInbounds(remark)
if err != nil {
logger.Warning(err)
msg := t.I18nBot("tgbot.wentWrong")
t.SendMsgToTgbot(chatId, msg)
return
}
- if len(inbouds) == 0 {
+ if len(inbounds) == 0 {
msg := t.I18nBot("tgbot.noInbounds")
t.SendMsgToTgbot(chatId, msg)
return
}
- for _, inbound := range inbouds {
+ for _, inbound := range inbounds {
info := ""
info += t.I18nBot("tgbot.messages.inbound", "Remark=="+inbound.Remark)
info += t.I18nBot("tgbot.messages.port", "Port=="+strconv.Itoa(inbound.Port))
diff --git a/web/service/xray_setting.go b/web/service/xray_setting.go
index a203e649..43d143db 100644
--- a/web/service/xray_setting.go
+++ b/web/service/xray_setting.go
@@ -128,7 +128,7 @@ func (s *XraySettingService) RegWarp(secretKey string, publicKey string) (string
return result, nil
}
-func (s *XraySettingService) SetWarpLicence(license string) (string, error) {
+func (s *XraySettingService) SetWarpLicense(license string) (string, error) {
var warpData map[string]string
warp, err := s.SettingService.GetWarp()
if err != nil {
diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml
index 54bd4e9a..34e3d00e 100644
--- a/web/translation/translate.en_US.toml
+++ b/web/translation/translate.en_US.toml
@@ -44,7 +44,7 @@
"monitor" = "Listen IP"
"certificate" = "Digital Certificate"
"fail" = " Failed"
-"success" = " Successful"
+"success" = " Successfully"
"getVersion" = "Get Version"
"install" = "Install"
"clients" = "Clients"
diff --git a/web/web.go b/web/web.go
index dadbfda1..5850e85d 100644
--- a/web/web.go
+++ b/web/web.go
@@ -268,7 +268,7 @@ func (s *Server) startTask() {
// Make a traffic condition every day, 8:30
var entry cron.EntryID
- isTgbotenabled, err := s.settingService.GetTgbotenabled()
+ isTgbotenabled, err := s.settingService.GetTgbotEnabled()
if (err == nil) && (isTgbotenabled) {
runtime, err := s.settingService.GetTgbotRuntime()
if err != nil || runtime == "" {
@@ -364,7 +364,7 @@ func (s *Server) Start() (err error) {
s.startTask()
- isTgbotenabled, err := s.settingService.GetTgbotenabled()
+ isTgbotenabled, err := s.settingService.GetTgbotEnabled()
if (err == nil) && (isTgbotenabled) {
tgBot := s.tgbotService.NewTgbot()
tgBot.Start(i18nFS)