From 04ab8e72f634d7c03eb3dbac5f76d8e25f07b02b Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Fri, 10 Feb 2023 18:07:23 +0100 Subject: [PATCH] WebUI: make error messages user dismissible Fixes #1171 Signed-off-by: Nicola Murino --- go.mod | 6 +- go.sum | 12 ++-- internal/vfs/azblobfs.go | 2 +- templates/common/forgot-password.html | 7 +- templates/common/reset-password.html | 7 +- templates/webadmin/admin.html | 7 +- templates/webadmin/admins.html | 15 ++-- templates/webadmin/adminsetup.html | 7 +- templates/webadmin/changepassword.html | 7 +- templates/webadmin/connections.html | 26 +++---- templates/webadmin/defender.html | 15 ++-- templates/webadmin/eventaction.html | 7 +- templates/webadmin/eventactions.html | 18 ++--- templates/webadmin/eventrule.html | 7 +- templates/webadmin/eventrules.html | 18 ++--- templates/webadmin/events.html | 15 ++-- templates/webadmin/folder.html | 7 +- templates/webadmin/folders.html | 23 +++--- templates/webadmin/group.html | 7 +- templates/webadmin/groups.html | 18 ++--- templates/webadmin/iplist.html | 7 +- templates/webadmin/iplists.html | 15 ++-- templates/webadmin/login.html | 7 +- templates/webadmin/maintenance.html | 7 +- templates/webadmin/mfa.html | 75 ++++++++++---------- templates/webadmin/profile.html | 7 +- templates/webadmin/role.html | 7 +- templates/webadmin/roles.html | 18 ++--- templates/webadmin/twofactor-recovery.html | 7 +- templates/webadmin/twofactor.html | 7 +- templates/webadmin/user.html | 7 +- templates/webadmin/users.html | 23 +++--- templates/webclient/changepassword.html | 7 +- templates/webclient/editfile.html | 11 +-- templates/webclient/files.html | 51 ++++++-------- templates/webclient/mfa.html | 77 ++++++++++----------- templates/webclient/profile.html | 7 +- templates/webclient/share.html | 7 +- templates/webclient/sharefiles.html | 43 ++++++------ templates/webclient/shares.html | 26 ++++--- templates/webclient/shareupload.html | 27 ++++---- templates/webclient/twofactor-recovery.html | 7 +- templates/webclient/twofactor.html | 7 +- 43 files changed, 369 insertions(+), 319 deletions(-) diff --git a/go.mod b/go.mod index 65672b99..3f3ce33a 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/eikenb/pipeat v0.0.0-20210730190139-06b3e6902001 github.com/fclairamb/ftpserverlib v0.21.0 github.com/fclairamb/go-log v0.4.1 - github.com/go-acme/lego/v4 v4.9.2-0.20230104103215-fd54758bba4c + github.com/go-acme/lego/v4 v4.10.0 github.com/go-chi/chi/v5 v5.0.8 github.com/go-chi/jwtauth/v5 v5.1.0 github.com/go-chi/render v1.0.2 @@ -154,10 +154,10 @@ require ( go.opencensus.io v0.24.0 // indirect golang.org/x/mod v0.8.0 // indirect golang.org/x/text v0.7.0 // indirect - golang.org/x/tools v0.5.0 // indirect + golang.org/x/tools v0.6.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/appengine v1.6.7 // indirect - google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 // indirect + google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc // indirect google.golang.org/grpc v1.53.0 // indirect google.golang.org/protobuf v1.28.1 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/go.sum b/go.sum index 1b4d0810..a4656802 100644 --- a/go.sum +++ b/go.sum @@ -918,8 +918,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= -github.com/go-acme/lego/v4 v4.9.2-0.20230104103215-fd54758bba4c h1:PDd4Q867Ia2D68T+KglkyxMDoIUEp3sNYVXuN3TXjAE= -github.com/go-acme/lego/v4 v4.9.2-0.20230104103215-fd54758bba4c/go.mod h1:qib35rauo2OW1BzAI0qUfR3xw/JIIuaO0ZA83QIsw0s= +github.com/go-acme/lego/v4 v4.10.0 h1:G4Cgq4lsPxCjqsTKsqhUjRs3oKAGVMFPhvrl6kzzs44= +github.com/go-acme/lego/v4 v4.10.0/go.mod h1:EMbf0Jmqwv94nJ5WL9qWnSXIBZnvsS9gNypansHGc6U= github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0= github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/jwtauth/v5 v5.1.0 h1:wJyf2YZ/ohPvNJBwPOzZaQbyzwgMZZceE1m8FOzXLeA= @@ -2510,8 +2510,8 @@ golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= -golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4= -golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= +golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM= +golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2713,8 +2713,8 @@ google.golang.org/genproto v0.0.0-20221109142239-94d6d90a7d66/go.mod h1:rZS5c/ZV google.golang.org/genproto v0.0.0-20221118155620-16455021b5e6/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201164419-0e50fba7f41c/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= google.golang.org/genproto v0.0.0-20221201204527-e3fa12d562f3/go.mod h1:rZS5c/ZVYMaOGBfO68GWtjOw/eLaZM1X6iVtgjZ+EWg= -google.golang.org/genproto v0.0.0-20230202175211-008b39050e57 h1:vArvWooPH749rNHpBGgVl+U9B9dATjiEhJzcWGlovNs= -google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc h1:ijGwO+0vL2hJt5gaygqP2j6PfflOBrRot0IczKbmtio= +google.golang.org/genproto v0.0.0-20230209215440-0dfe4f8abfcc/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM= google.golang.org/grpc v0.0.0-20160317175043-d3ddb4469d5a/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= diff --git a/internal/vfs/azblobfs.go b/internal/vfs/azblobfs.go index 42866d16..66acc28f 100644 --- a/internal/vfs/azblobfs.go +++ b/internal/vfs/azblobfs.go @@ -1180,7 +1180,7 @@ func getAzContainerClientOptions() *container.ClientOptions { return &container.ClientOptions{ ClientOptions: azcore.ClientOptions{ Telemetry: policy.TelemetryOptions{ - ApplicationID: fmt.Sprintf("SFTPGo-%v_%v", version.Version, version.CommitHash), + ApplicationID: fmt.Sprintf("SFTPGo-%s", version.CommitHash), }, }, } diff --git a/templates/common/forgot-password.html b/templates/common/forgot-password.html index 28f35d5b..e3344e4e 100644 --- a/templates/common/forgot-password.html +++ b/templates/common/forgot-password.html @@ -60,8 +60,11 @@ along with this program. If not, see .

If you have added an email address to your account, we'll email you a code to reset your password. Enter your account username below

{{if .Error}} -
-
{{.Error}}
+ {{end}}
.

Check your email for the confirmation code

{{if .Error}} -
-
{{.Error}}
+ {{end}} .
{{if .Error}} -
-
{{.Error}}
+ {{end}} diff --git a/templates/webadmin/admins.html b/templates/webadmin/admins.html index dad0771d..85d0094d 100644 --- a/templates/webadmin/admins.html +++ b/templates/webadmin/admins.html @@ -28,12 +28,11 @@ along with this program. If not, see . {{define "page_body"}} - - -