From 4699504c9f496e60dd3ed824013fc16addaef6a3 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Mon, 11 Mar 2024 08:58:40 +0100 Subject: [PATCH] show goversion and goos/goarch on admin page --- mox-/webappfile.go | 3 ++- webaccount/account.ts | 3 +++ webadmin/admin.js | 2 +- webadmin/admin.ts | 7 ++++++- webmail/webmail.js | 2 +- webmail/webmail.ts | 5 ++++- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mox-/webappfile.go b/mox-/webappfile.go index 42aefaf..f6bebc1 100644 --- a/mox-/webappfile.go +++ b/mox-/webappfile.go @@ -10,6 +10,7 @@ import ( "log/slog" "net/http" "os" + "runtime" "strings" "sync" "time" @@ -124,7 +125,7 @@ func (a *WebappFile) Serve(ctx context.Context, log mlog.Log, w http.ResponseWri } var b bytes.Buffer b.Write(html[:index]) - fmt.Fprintf(&b, "") b.Write(html[index+len(script):]) diff --git a/webaccount/account.ts b/webaccount/account.ts index b3d9a2b..ee5e04d 100644 --- a/webaccount/account.ts +++ b/webaccount/account.ts @@ -3,6 +3,9 @@ // From HTML. declare let page: HTMLElement declare let moxversion: string +declare let moxgoversion: string +declare let moxgoos: string +declare let moxgoarch: string const login = async (reason: string) => { return new Promise((resolve: (v: string) => void, _) => { diff --git a/webadmin/admin.js b/webadmin/admin.js index 9e98649..20f58ef 100644 --- a/webadmin/admin.js +++ b/webadmin/admin.js @@ -1479,7 +1479,7 @@ const crumbs = (...l) => [ dom.br() ]; const errmsg = (err) => '' + (err.message || '(no error message)'); -const footer = dom.div(style({ marginTop: '6ex', opacity: 0.75 }), link('https://www.xmox.nl', 'mox'), ' ', moxversion); +const footer = dom.div(style({ marginTop: '6ex', opacity: 0.75 }), link('https://www.xmox.nl', 'mox'), ' ', moxversion, ' ', moxgoversion, ' ', moxgoos, '/', moxgoarch); const age = (date, future, nowSecs) => { if (!nowSecs) { nowSecs = new Date().getTime() / 1000; diff --git a/webadmin/admin.ts b/webadmin/admin.ts index ccc552c..bd3eb20 100644 --- a/webadmin/admin.ts +++ b/webadmin/admin.ts @@ -3,6 +3,9 @@ // From HTML. declare let page: HTMLElement declare let moxversion: string +declare let moxgoversion: string +declare let moxgoos: string +declare let moxgoarch: string const login = async (reason: string) => { return new Promise((resolve: (v: string) => void, _) => { @@ -120,7 +123,9 @@ const footer = dom.div( style({marginTop: '6ex', opacity: 0.75}), link('https://www.xmox.nl', 'mox'), ' ', - moxversion, + moxversion, ' ', + moxgoversion, ' ', + moxgoos, '/', moxgoarch, ) const age = (date: Date, future: boolean, nowSecs: number) => { diff --git a/webmail/webmail.js b/webmail/webmail.js index e02709b..f42e77a 100644 --- a/webmail/webmail.js +++ b/webmail/webmail.js @@ -2182,7 +2182,7 @@ const cmdHelp = async () => { return; } window.alert('"mailto:" protocol handler unregistered.'); - })), dom.div(style({ marginTop: '2ex' }), 'Mox is open source email server software, this is version ' + moxversion + '. Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new'), '.')))); + })), dom.div(style({ marginTop: '2ex' }), 'Mox is open source email server software, this is version ', moxversion, ', built with ', moxgoversion, '. Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new'), '.')))); }; // Show tooltips for either the focused element, or otherwise for all elements // that aren't reachable with tabindex and aren't marked specially to prevent diff --git a/webmail/webmail.ts b/webmail/webmail.ts index b3f83d5..bd98502 100644 --- a/webmail/webmail.ts +++ b/webmail/webmail.ts @@ -112,6 +112,9 @@ const zindexes = { // From HTML. declare let page: HTMLElement declare let moxversion: string +declare let moxgoversion: string +declare let moxgoos: string +declare let moxgoarch: string // All logging goes through log() instead of console.log, except "should not happen" logging. let log: (...args: any[]) => void = () => {} @@ -1197,7 +1200,7 @@ const cmdHelp = async () => { window.alert('"mailto:" protocol handler unregistered.') }), ), - dom.div(style({marginTop: '2ex'}), 'Mox is open source email server software, this is version '+moxversion+'. Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new'), '.'), + dom.div(style({marginTop: '2ex'}), 'Mox is open source email server software, this is version ', moxversion, ', built with ', moxgoversion, '. Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new'), '.'), ), ), )