diff --git a/.gitignore b/.gitignore index 0e82613dfd..38453a6532 100644 --- a/.gitignore +++ b/.gitignore @@ -33,6 +33,7 @@ dex/testing/loadbot/loadbot bin/ bin-v*/ client/webserver/site/template-builder/template-builder +client/webserver/site/webpack-build-id.txt dex/testing/btc/harnesschain.tar.gz client/asset/btc/electrum/example/server/server client/asset/btc/electrum/example/wallet/wallet diff --git a/client/app/config.go b/client/app/config.go index f2aadbc687..8c19be8755 100644 --- a/client/app/config.go +++ b/client/app/config.go @@ -162,7 +162,7 @@ type Config struct { // Web creates a configuration for the webserver. This is a Config method // instead of a WebConfig method because Language is an app-level setting used // by both core and rpcserver. -func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc bool) *webserver.Config { +func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc bool, appVersion string) *webserver.Config { addr := cfg.WebAddr host, _, err := net.SplitHostPort(addr) if err == nil && host != "" { @@ -196,6 +196,7 @@ func (cfg *Config) Web(c *core.Core, mm *mm.MarketMaker, log dex.Logger, utc boo NoEmbed: cfg.NoEmbedSite, HttpProf: cfg.HTTPProfile, Language: cfg.Language, + AppVersion: appVersion, } } @@ -348,6 +349,7 @@ func ResolveConfig(appData string, cfg *Config) error { if cfg.MMConfig.EventLogDBPath == "" { cfg.MMConfig.EventLogDBPath = defaultMMEventLogDBPath } + return nil } diff --git a/client/cmd/bisonw-desktop/app.go b/client/cmd/bisonw-desktop/app.go index 327525e5b3..8efd6fafcd 100644 --- a/client/cmd/bisonw-desktop/app.go +++ b/client/cmd/bisonw-desktop/app.go @@ -222,7 +222,7 @@ func mainCore() error { }() } - webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc)) + webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, app.Version)) if err != nil { return fmt.Errorf("failed creating web server: %w", err) } diff --git a/client/cmd/bisonw/main.go b/client/cmd/bisonw/main.go index 01e7c94065..065160d832 100644 --- a/client/cmd/bisonw/main.go +++ b/client/cmd/bisonw/main.go @@ -154,7 +154,7 @@ func runCore(cfg *app.Config) error { } if !cfg.NoWeb { - webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc)) + webSrv, err := webserver.New(cfg.Web(clientCore, marketMaker, logMaker.Logger("WEB"), utc, app.Version)) if err != nil { return fmt.Errorf("failed creating web server: %w", err) } diff --git a/client/webserver/http.go b/client/webserver/http.go index 45ca372e66..56f533fed0 100644 --- a/client/webserver/http.go +++ b/client/webserver/http.go @@ -260,6 +260,7 @@ func (s *WebServer) handleSettings(w http.ResponseWriter, r *http.Request) { FiatCurrency string Exchanges map[string]*core.Exchange IsInitialized bool + AppVersion string }{ CommonArguments: *common, KnownExchanges: s.knownUnregisteredExchanges(xcs), @@ -267,6 +268,7 @@ func (s *WebServer) handleSettings(w http.ResponseWriter, r *http.Request) { FiatRateSources: s.core.FiatRateSources(), Exchanges: xcs, IsInitialized: s.core.IsInitialized(), + AppVersion: s.appVersion, } s.sendTemplate(w, "settings", data) } diff --git a/client/webserver/locales/ar.go b/client/webserver/locales/ar.go index 27f7c264ac..136dd42e7d 100644 --- a/client/webserver/locales/ar.go +++ b/client/webserver/locales/ar.go @@ -137,7 +137,7 @@ var Ar = map[string]*intl.Translation{ "Export Account": {T: "تصدير الحساب"}, "simultaneous_servers_msg": {T: "يدعم عميل منصة المبادلات اللامركزية لديكريد الاستخدام المتزامن لأي عدد من خوادم منصة المبادلات اللامركزية DEX."}, "Change App Password": {T: "تغيير كلمة مرور التطبيق"}, - "Build ID": {T: "معرف البنية"}, + "Version": {T: "معرف البنية"}, "Connect": {T: "اتصل"}, "Send": {T: "ارسال"}, "Deposit": {T: "إيداع"}, diff --git a/client/webserver/locales/de-de.go b/client/webserver/locales/de-de.go index ecd2becfea..bcf462d8de 100644 --- a/client/webserver/locales/de-de.go +++ b/client/webserver/locales/de-de.go @@ -135,7 +135,7 @@ var DeDE = map[string]*intl.Translation{ "Export Account": {T: "Account exportieren"}, "simultaneous_servers_msg": {T: "Der unterstützt die gleichzeitige Nutzung einer beliebigen Anzahl von DEX-Servern."}, "Change App Password": {T: "App-Passwort ändern"}, - "Build ID": {T: "Build ID"}, + "Version": {T: "Version"}, "Connect": {T: "Verbinden"}, "Send": {T: "Senden"}, "Deposit": {T: "Einzahlen"}, diff --git a/client/webserver/locales/en-us.go b/client/webserver/locales/en-us.go index 8d15eef0cc..799727bfe4 100644 --- a/client/webserver/locales/en-us.go +++ b/client/webserver/locales/en-us.go @@ -167,7 +167,7 @@ var EnUS = map[string]*intl.Translation{ "browser_ntfn_blocked": {T: "Browser notifications are currently blocked. Please unblock this site in your browser to receive notifications."}, "enable_browser_ntfn_info": {T: "Desktop notifications appear even when this window is not active. When you have other applications open this can be helpful as you will be notified on DCRDEX events. Customize below the types of notifications you would like to receive."}, "Save Notifications": {T: "Save Notifications"}, - "Build ID": {T: "Build ID"}, + "Version": {T: "Version"}, "Connect": {T: "Connect"}, "Send": {T: "Send"}, "Deposit": {T: "Deposit"}, // unused diff --git a/client/webserver/locales/pl-pl.go b/client/webserver/locales/pl-pl.go index c1f7be9a99..fa8898c193 100644 --- a/client/webserver/locales/pl-pl.go +++ b/client/webserver/locales/pl-pl.go @@ -133,7 +133,7 @@ var PlPL = map[string]*intl.Translation{ "Export Account": {T: "Eksportuj konto"}, "simultaneous_servers_msg": {T: "Klient Decred DEX wspiera jednoczesne korzystanie z wielu serwerów DEX."}, "Change App Password": {T: "Zmień hasło aplikacji"}, - "Build ID": {T: "ID builda"}, + "Version": {T: "Wersja"}, "Connect": {T: "Połącz"}, "Withdraw": {T: "Wypłać"}, "Deposit": {T: "Zdeponuj"}, diff --git a/client/webserver/locales/pt-br.go b/client/webserver/locales/pt-br.go index 38187ed0b2..cb9c96c6e5 100644 --- a/client/webserver/locales/pt-br.go +++ b/client/webserver/locales/pt-br.go @@ -133,7 +133,7 @@ var PtBr = map[string]*intl.Translation{ "Export Account": {T: "Exportar Conta"}, "simultaneous_servers_msg": {T: "O cliente da DEX suporta simultâneos números de servidores DEX."}, "Change App Password": {T: "Trocar Senha do aplicativo"}, - "Build ID": {T: "ID da Build"}, + "Version": {T: "Versão"}, "Connect": {T: "Conectar"}, "Withdraw": {T: "Retirar"}, "Deposit": {T: "Depositar"}, diff --git a/client/webserver/locales/zh-cn.go b/client/webserver/locales/zh-cn.go index 0b68f012b7..01194cf367 100644 --- a/client/webserver/locales/zh-cn.go +++ b/client/webserver/locales/zh-cn.go @@ -135,7 +135,7 @@ var ZhCN = map[string]*intl.Translation{ "Export Account": {T: "退出账户"}, "simultaneous_servers_msg": {T: "Decred DEX 客户端支持同时使用任意数量的 DEX 服务器。"}, "Change App Password": {T: "更改应用程序密码"}, - "Build ID": {T: "构建 ID"}, + "Version": {T: "版本"}, "Connect": {T: "连接"}, "Send": {T: "发送"}, "Deposit": {T: "存款"}, diff --git a/client/webserver/site/src/html/bodybuilder.tmpl b/client/webserver/site/src/html/bodybuilder.tmpl index fb0fca5e3d..8fa851e01a 100644 --- a/client/webserver/site/src/html/bodybuilder.tmpl +++ b/client/webserver/site/src/html/bodybuilder.tmpl @@ -9,7 +9,7 @@