From fe41109c76b728bdba0ffb57fa48422ee1ee1a8e Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Thu, 14 Dec 2023 10:36:25 +0100 Subject: [PATCH] WebClient: add toast notifications Signed-off-by: Nicola Murino --- go.mod | 2 +- go.sum | 4 +-- templates/webclient/base.html | 24 +++++++++++++ templates/webclient/files.html | 61 +++++++++++++-------------------- templates/webclient/mfa.html | 30 ++++------------ templates/webclient/shares.html | 8 +---- 6 files changed, 59 insertions(+), 70 deletions(-) diff --git a/go.mod b/go.mod index 6fe50f8b1..e1a2dcd93 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/drakkan/sftpgo/v2 go 1.21 require ( - cloud.google.com/go/storage v1.35.1 + cloud.google.com/go/storage v1.36.0 github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 diff --git a/go.sum b/go.sum index 04e7096c1..f5ec7f15f 100644 --- a/go.sum +++ b/go.sum @@ -9,8 +9,8 @@ cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI= cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8= cloud.google.com/go/kms v1.15.5 h1:pj1sRfut2eRbD9pFRjNnPNg/CzJPuQAzUujMIM1vVeM= cloud.google.com/go/kms v1.15.5/go.mod h1:cU2H5jnp6G2TDpUGZyqTCoy1n16fbubHZjmVXSMtwDI= -cloud.google.com/go/storage v1.35.1 h1:B59ahL//eDfx2IIKFBeT5Atm9wnNmj3+8xG/W4WB//w= -cloud.google.com/go/storage v1.35.1/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= +cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA= diff --git a/templates/webclient/base.html b/templates/webclient/base.html index 02c319b8f..92b8946fc 100644 --- a/templates/webclient/base.html +++ b/templates/webclient/base.html @@ -294,6 +294,25 @@ +
+ +
+ {{- block "modals" .}}{{- end}} @@ -393,6 +412,11 @@ } }(); + function showToast(msg, options) { + const toast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast_container')); + setI18NData($('#toast_msg'), msg, options) + toast.show(); + } function doLogout() { ModalAlert.fire({ diff --git a/templates/webclient/files.html b/templates/webclient/files.html index f61d41c9b..59e1a176f 100644 --- a/templates/webclient/files.html +++ b/templates/webclient/files.html @@ -31,21 +31,21 @@
{{- if .CanCreateDirs}} - {{- end}} {{- if .CanAddFiles}} - {{- end}}
@@ -61,8 +61,8 @@
{{- if or .CanDownload .CanDelete}}
-
diff --git a/templates/webclient/mfa.html b/templates/webclient/mfa.html index 9e2c9148a..5893e3d96 100644 --- a/templates/webclient/mfa.html +++ b/templates/webclient/mfa.html @@ -56,8 +56,6 @@

- {{- template "errmsg" ""}} -
@@ -470,18 +468,13 @@

View and manage shares

- {{- template "errmsg" ""}}
Loading... @@ -107,10 +106,6 @@