diff options
| author | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-07-07 12:55:59 +0300 |
|---|---|---|
| committer | mhsanaei <ho3ein.sanaei@gmail.com> | 2024-07-07 13:10:24 +0300 |
| commit | 7a51d2f2cccbc0add04518808415912a7217bc28 (patch) | |
| tree | cc4bce27d16caec5361d51de676eecd0c628ad0d /web/service | |
| parent | 02ae61fe6beb68ab8e5859a5eaa2b68514c0b454 (diff) | |
Typo fixed
Diffstat (limited to 'web/service')
| -rw-r--r-- | web/service/inbound.go | 2 | ||||
| -rw-r--r-- | web/service/setting.go | 6 | ||||
| -rw-r--r-- | web/service/tgbot.go | 16 | ||||
| -rw-r--r-- | web/service/xray_setting.go | 2 |
4 files changed, 13 insertions, 13 deletions
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 { |
