mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-22 07:30:25 +00:00
WebUI: make error messages user dismissible
Fixes #1171 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
e0c3a13ac5
commit
04ab8e72f6
43 changed files with 369 additions and 319 deletions
6
go.mod
6
go.mod
|
@ -24,7 +24,7 @@ require (
|
||||||
github.com/eikenb/pipeat v0.0.0-20210730190139-06b3e6902001
|
github.com/eikenb/pipeat v0.0.0-20210730190139-06b3e6902001
|
||||||
github.com/fclairamb/ftpserverlib v0.21.0
|
github.com/fclairamb/ftpserverlib v0.21.0
|
||||||
github.com/fclairamb/go-log v0.4.1
|
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/chi/v5 v5.0.8
|
||||||
github.com/go-chi/jwtauth/v5 v5.1.0
|
github.com/go-chi/jwtauth/v5 v5.1.0
|
||||||
github.com/go-chi/render v1.0.2
|
github.com/go-chi/render v1.0.2
|
||||||
|
@ -154,10 +154,10 @@ require (
|
||||||
go.opencensus.io v0.24.0 // indirect
|
go.opencensus.io v0.24.0 // indirect
|
||||||
golang.org/x/mod v0.8.0 // indirect
|
golang.org/x/mod v0.8.0 // indirect
|
||||||
golang.org/x/text v0.7.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
|
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
|
||||||
google.golang.org/appengine v1.6.7 // 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/grpc v1.53.0 // indirect
|
||||||
google.golang.org/protobuf v1.28.1 // indirect
|
google.golang.org/protobuf v1.28.1 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
|
|
12
go.sum
12
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-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.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
|
||||||
github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U=
|
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.10.0 h1:G4Cgq4lsPxCjqsTKsqhUjRs3oKAGVMFPhvrl6kzzs44=
|
||||||
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/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 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0=
|
||||||
github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
|
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=
|
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.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.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.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
|
||||||
golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=
|
golang.org/x/tools v0.6.0 h1:BOw41kyTf3PuCW1pVQf8+Cyg8pMlkYB1oo9iJ6D/lKM=
|
||||||
golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k=
|
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-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-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/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-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-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-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-20230209215440-0dfe4f8abfcc h1:ijGwO+0vL2hJt5gaygqP2j6PfflOBrRot0IczKbmtio=
|
||||||
google.golang.org/genproto v0.0.0-20230202175211-008b39050e57/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
|
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 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.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
|
|
|
@ -1180,7 +1180,7 @@ func getAzContainerClientOptions() *container.ClientOptions {
|
||||||
return &container.ClientOptions{
|
return &container.ClientOptions{
|
||||||
ClientOptions: azcore.ClientOptions{
|
ClientOptions: azcore.ClientOptions{
|
||||||
Telemetry: policy.TelemetryOptions{
|
Telemetry: policy.TelemetryOptions{
|
||||||
ApplicationID: fmt.Sprintf("SFTPGo-%v_%v", version.Version, version.CommitHash),
|
ApplicationID: fmt.Sprintf("SFTPGo-%s", version.CommitHash),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,8 +60,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<p class="mb-4">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</p>
|
<p class="mb-4">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</p>
|
||||||
</div>
|
</div>
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="forgot_password_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="forgot_password_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
|
@ -60,8 +60,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<p class="mb-4">Check your email for the confirmation code</p>
|
<p class="mb-4">Check your email for the confirmation code</p>
|
||||||
</div>
|
</div>
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="forgot_password_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="forgot_password_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
|
@ -28,8 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="admin_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="admin_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -28,12 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
|
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
</div>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
</button>
|
||||||
<div id="successTxt" class="card-body"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
|
@ -130,6 +129,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
var username = table.row({ selected: true }).data()[1];
|
var username = table.row({ selected: true }).data()[1];
|
||||||
var path = '{{.AdminURL}}' + "/" + fixedEncodeURIComponent(username);
|
var path = '{{.AdminURL}}' + "/" + fixedEncodeURIComponent(username);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -153,9 +153,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<h1 class="h5 text-gray-900 mb-4">To start using SFTPGo you need to create an admin user</h1>
|
<h1 class="h5 text-gray-900 mb-4">To start using SFTPGo you need to create an admin user</h1>
|
||||||
</div>
|
</div>
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
|
@ -25,8 +25,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="user_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="user_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
|
@ -105,13 +108,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function disconnectAction() {
|
function disconnectAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('disconnect:name').enable(false);
|
table.button('disconnect:name').enable(false);
|
||||||
var selectedData = table.row({ selected: true }).data()
|
let selectedData = table.row({ selected: true }).data()
|
||||||
var connectionID = selectedData[0];
|
let connectionID = selectedData[0];
|
||||||
var nodeID = selectedData[1];
|
let nodeID = selectedData[1];
|
||||||
var path = '{{.ConnectionsURL}}' + "/" + fixedEncodeURIComponent(connectionID)+"?node="+encodeURIComponent(nodeID);
|
let path = '{{.ConnectionsURL}}' + "/" + fixedEncodeURIComponent(connectionID)+"?node="+encodeURIComponent(nodeID);
|
||||||
$('#disconnectModal').modal('hide');
|
$('#disconnectModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -119,9 +124,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
headers: {'X-CSRF-TOKEN' : '{{.CSRFToken}}'},
|
headers: {'X-CSRF-TOKEN' : '{{.CSRFToken}}'},
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
setTimeout(function () {
|
window.location.href = '{{.ConnectionsURL}}';
|
||||||
window.location.href = '{{.ConnectionsURL}}';
|
|
||||||
}, 1000);
|
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Failed to close the selected connection";
|
var txt = "Failed to close the selected connection";
|
||||||
|
@ -137,9 +140,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
<div class="card-header py-3">
|
<div class="card-header py-3">
|
||||||
|
@ -94,6 +97,8 @@ function deleteAction() {
|
||||||
let id = table.row({ selected: true }).data()["id"];
|
let id = table.row({ selected: true }).data()["id"];
|
||||||
let path = '{{.DefenderHostsURL}}' + "/" + fixedEncodeURIComponent(id);
|
let path = '{{.DefenderHostsURL}}' + "/" + fixedEncodeURIComponent(id);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -117,9 +122,6 @@ function deleteAction() {
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -163,9 +165,6 @@ function deleteAction() {
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deferRender": true,
|
"deferRender": true,
|
||||||
|
|
|
@ -39,8 +39,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="eventaction_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="eventaction_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
<div class="card-header py-3">
|
<div class="card-header py-3">
|
||||||
|
@ -101,11 +104,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function deleteAction() {
|
function deleteAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('delete:name').enable(false);
|
table.button('delete:name').enable(false);
|
||||||
var name = table.row({ selected: true }).data()[0];
|
let name = table.row({ selected: true }).data()[0];
|
||||||
var path = '{{.EventActionURL}}' + "/" + fixedEncodeURIComponent(name);
|
let path = '{{.EventActionURL}}' + "/" + fixedEncodeURIComponent(name);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -129,9 +134,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="eventrule_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="eventrule_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
<div id="successTxt" class="card-body"></div>
|
<div id="successTxt" class="card-body"></div>
|
||||||
|
@ -138,6 +141,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
let name = table.row({ selected: true }).data()[1];
|
let name = table.row({ selected: true }).data()[1];
|
||||||
let path = '{{.EventRuleURL}}' + "/run/" + fixedEncodeURIComponent(name);
|
let path = '{{.EventRuleURL}}' + "/run/" + fixedEncodeURIComponent(name);
|
||||||
$('#runModal').modal('hide');
|
$('#runModal').modal('hide');
|
||||||
|
$('#successMsg').hide();
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -165,9 +171,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -178,6 +181,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
let name = table.row({ selected: true }).data()[1];
|
let name = table.row({ selected: true }).data()[1];
|
||||||
let path = '{{.EventRuleURL}}' + "/" + fixedEncodeURIComponent(name);
|
let path = '{{.EventRuleURL}}' + "/" + fixedEncodeURIComponent(name);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -201,9 +206,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
<div class="card-header py-3">
|
<div class="card-header py-3">
|
||||||
|
@ -332,6 +335,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
|
|
||||||
function initProviderDatatable(){
|
function initProviderDatatable(){
|
||||||
|
$('#errorMsg').hide();
|
||||||
let tableProvider = $('#dataTableProvider').DataTable({
|
let tableProvider = $('#dataTableProvider').DataTable({
|
||||||
"ajax": {
|
"ajax": {
|
||||||
"url": getSearchURL(false),
|
"url": getSearchURL(false),
|
||||||
|
@ -351,9 +355,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deferRender": true,
|
"deferRender": true,
|
||||||
|
@ -417,6 +418,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
|
|
||||||
function initFsDatatable(){
|
function initFsDatatable(){
|
||||||
|
$('#errorMsg').hide();
|
||||||
let tableFs = $('#dataTableFs').DataTable({
|
let tableFs = $('#dataTableFs').DataTable({
|
||||||
"ajax": {
|
"ajax": {
|
||||||
"url": getSearchURL(false),
|
"url": getSearchURL(false),
|
||||||
|
@ -436,9 +438,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deferRender": true,
|
"deferRender": true,
|
||||||
|
|
|
@ -28,8 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if eq .Mode 3}}
|
{{if eq .Mode 3}}
|
||||||
|
|
|
@ -27,8 +27,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
|
@ -115,11 +118,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function deleteAction() {
|
function deleteAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('delete:name').enable(false);
|
table.button('delete:name').enable(false);
|
||||||
var folderName = table.row({ selected: true }).data()[1];
|
let folderName = table.row({ selected: true }).data()[1];
|
||||||
var path = '{{.FolderURL}}' + "/" + fixedEncodeURIComponent(folderName);
|
let path = '{{.FolderURL}}' + "/" + fixedEncodeURIComponent(folderName);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -143,9 +148,6 @@ function deleteAction() {
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -217,7 +219,7 @@ function deleteAction() {
|
||||||
$('#successMsg').show();
|
$('#successMsg').show();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('#successMsg').hide();
|
$('#successMsg').hide();
|
||||||
}, 5000);
|
}, 15000);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
dt.button('quota_scan:name').enable(true);
|
dt.button('quota_scan:name').enable(true);
|
||||||
|
@ -234,9 +236,6 @@ function deleteAction() {
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -29,8 +29,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="card mb-4 border-left-info">
|
<div class="card mb-4 border-left-info">
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
|
@ -100,11 +103,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function deleteAction() {
|
function deleteAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('delete:name').enable(false);
|
table.button('delete:name').enable(false);
|
||||||
var groupName = table.row({ selected: true }).data()[0];
|
let groupName = table.row({ selected: true }).data()[0];
|
||||||
var path = '{{.GroupURL}}' + "/" + fixedEncodeURIComponent(groupName);
|
let path = '{{.GroupURL}}' + "/" + fixedEncodeURIComponent(groupName);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -128,9 +133,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="iplist_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="iplist_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -27,8 +27,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
<div class="card-header py-3">
|
<div class="card-header py-3">
|
||||||
|
@ -260,6 +263,8 @@ function deleteAction() {
|
||||||
let selectedRow = table.row({ selected: true }).data();
|
let selectedRow = table.row({ selected: true }).data();
|
||||||
let path = '{{.IPListURL}}' + "/" + fixedEncodeURIComponent(selectedRow["type"])+"/"+ fixedEncodeURIComponent(selectedRow["ipornet"]);
|
let path = '{{.IPListURL}}' + "/" + fixedEncodeURIComponent(selectedRow["type"])+"/"+ fixedEncodeURIComponent(selectedRow["ipornet"]);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -283,9 +288,6 @@ function deleteAction() {
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -406,9 +408,6 @@ $(document).ready(function () {
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deferRender": true,
|
"deferRender": true,
|
||||||
|
|
|
@ -22,8 +22,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<h1 class="h4 text-gray-900 mb-4">{{.Branding.ShortName}} - {{.Version}}</h1>
|
<h1 class="h4 text-gray-900 mb-4">{{.Branding.ShortName}} - {{.Version}}</h1>
|
||||||
</div>
|
</div>
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="login_form" action="{{.CurrentURL}}" method="POST"
|
<form id="login_form" action="{{.CurrentURL}}" method="POST"
|
||||||
|
|
|
@ -24,8 +24,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="restore_form" enctype="multipart/form-data" action="{{.RestorePath}}" method="POST">
|
<form id="restore_form" enctype="multipart/form-data" action="{{.RestorePath}}" method="POST">
|
||||||
|
|
|
@ -31,8 +31,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<div id="successTOTPMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successTOTPMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
<div id="successTOTPTxt" class="card-body"></div>
|
<div id="successTOTPTxt" class="card-body"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="errorTOTPMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorTOTPMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTOTPTxt" class="card-body text-form-error"></div>
|
<span id="errorTOTPTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>Status: {{if .TOTPConfig.Enabled }}"Enabled". Current configuration: "{{.TOTPConfig.ConfigName}}"{{else}}"Disabled"{{end}}</p>
|
<p>Status: {{if .TOTPConfig.Enabled }}"Enabled". Current configuration: "{{.TOTPConfig.ConfigName}}"{{else}}"Disabled"{{end}}</p>
|
||||||
|
@ -90,8 +93,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<div id="successRecCodesMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successRecCodesMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
<div id="successRecCodesTxt" class="card-body"></div>
|
<div id="successRecCodesTxt" class="card-body"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="errorRecCodesMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorRecCodesMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorRecCodesTxt" class="card-body text-form-error"></div>
|
<span id="errorRecCodesTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>Recovery codes are a set of one time use codes that can be used in place of the TOTP to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate TOTP configuration.</p>
|
<p>Recovery codes are a set of one time use codes that can be used in place of the TOTP to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate TOTP configuration.</p>
|
||||||
|
@ -152,7 +158,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function totpGenerate() {
|
function totpGenerate() {
|
||||||
var path = "{{.GenerateTOTPURL}}";
|
$('#errorTOTPMsg').hide();
|
||||||
|
let path = "{{.GenerateTOTPURL}}";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -170,9 +177,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
window.scrollTo(0, $("#idTOTPDetails").offset().top);
|
window.scrollTo(0, $("#idTOTPDetails").offset().top);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Failed to generate a new TOTP secret";
|
let txt = "Failed to generate a new TOTP secret";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -183,21 +190,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function totpValidate() {
|
function totpValidate() {
|
||||||
var passcode = $('#idPasscode').val();
|
$('#errorTOTPMsg').hide();
|
||||||
|
let passcode = $('#idPasscode').val();
|
||||||
if (passcode == "") {
|
if (passcode == "") {
|
||||||
$('#errorTOTPTxt').text("The verification code is required");
|
$('#errorTOTPTxt').text("The verification code is required");
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var path = "{{.ValidateTOTPURL}}";
|
var path = "{{.ValidateTOTPURL}}";
|
||||||
|
@ -226,15 +228,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function totpSave() {
|
function totpSave() {
|
||||||
var path = "{{.SaveTOTPURL}}";
|
let path = "{{.SaveTOTPURL}}";
|
||||||
|
$('#errorTOTPMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -251,9 +252,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}, 3000);
|
}, 3000);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Failed to save the new configuration";
|
let txt = "Failed to save the new configuration";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -264,9 +265,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -277,7 +275,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
function totpDisable() {
|
function totpDisable() {
|
||||||
$('#disableTOTPModal').modal('hide');
|
$('#disableTOTPModal').modal('hide');
|
||||||
var path = "{{.SaveTOTPURL}}";
|
$('#errorTOTPMsg').hide();
|
||||||
|
let path = "{{.SaveTOTPURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -303,15 +303,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRecoveryCodes() {
|
function getRecoveryCodes() {
|
||||||
var path = "{{.RecCodesURL}}";
|
$('#errorRecCodesMsg').hide();
|
||||||
|
let path = "{{.RecCodesURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -331,9 +330,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
window.scrollTo(0, $("#idRecoveryCodesCard").offset().top);
|
window.scrollTo(0, $("#idRecoveryCodesCard").offset().top);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Failed to get your recovery codes";
|
let txt = "Failed to get your recovery codes";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -344,15 +343,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorRecCodesTxt').text(txt);
|
$('#errorRecCodesTxt').text(txt);
|
||||||
$('#errorRecCodesMsg').show();
|
$('#errorRecCodesMsg').show();
|
||||||
setTimeout(function () {
|
window.scrollTo(0, $("#idRecoveryCodesCard").offset().top);
|
||||||
$('#errorRecCodesMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateRecoveryCodes() {
|
function generateRecoveryCodes() {
|
||||||
var path = "{{.RecCodesURL}}";
|
$('#errorRecCodesMsg').hide();
|
||||||
|
let path = "{{.RecCodesURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -375,9 +374,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}, 5000);
|
}, 5000);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Failed to generate new recovery codes";
|
let txt = "Failed to generate new recovery codes";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -388,9 +387,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorRecCodesTxt').text(txt);
|
$('#errorRecCodesTxt').text(txt);
|
||||||
$('#errorRecCodesMsg').show();
|
$('#errorRecCodesMsg').show();
|
||||||
setTimeout(function () {
|
window.scrollTo(0, $("#idRecoveryCodesCard").offset().top);
|
||||||
$('#errorRecCodesMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="profile_form" action="{{.CurrentURL}}" method="POST">
|
<form id="profile_form" action="{{.CurrentURL}}" method="POST">
|
||||||
|
|
|
@ -25,8 +25,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="role_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="role_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
|
@ -100,11 +103,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function deleteAction() {
|
function deleteAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('delete:name').enable(false);
|
table.button('delete:name').enable(false);
|
||||||
var roleName = table.row({ selected: true }).data()[0];
|
let roleName = table.row({ selected: true }).data()[0];
|
||||||
var path = '{{.RoleURL}}' + "/" + fixedEncodeURIComponent(roleName);
|
let path = '{{.RoleURL}}' + "/" + fixedEncodeURIComponent(roleName);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -128,9 +133,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<h1 class="h4 text-gray-900 mb-4">{{.Branding.Name}} - {{.Version}}</h1>
|
<h1 class="h4 text-gray-900 mb-4">{{.Branding.Name}} - {{.Version}}</h1>
|
||||||
</div>
|
</div>
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
|
@ -22,8 +22,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<h1 class="h4 text-gray-900 mb-4">{{.Branding.Name}} - {{.Version}}</h1>
|
<h1 class="h4 text-gray-900 mb-4">{{.Branding.Name}} - {{.Version}}</h1>
|
||||||
</div>
|
</div>
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
|
@ -31,8 +31,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if eq .Mode 3}}
|
{{if eq .Mode 3}}
|
||||||
|
|
|
@ -28,8 +28,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
|
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
|
@ -130,11 +133,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function deleteAction() {
|
function deleteAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('delete:name').enable(false);
|
table.button('delete:name').enable(false);
|
||||||
var username = table.row({ selected: true }).data()[1];
|
let username = table.row({ selected: true }).data()[1];
|
||||||
var path = '{{.UserURL}}' + "/" + fixedEncodeURIComponent(username);
|
let path = '{{.UserURL}}' + "/" + fixedEncodeURIComponent(username);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -158,9 +163,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -237,7 +239,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
$('#successMsg').show();
|
$('#successMsg').show();
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
$('#successMsg').hide();
|
$('#successMsg').hide();
|
||||||
}, 5000);
|
}, 15000);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
dt.button('quota_scan:name').enable(true);
|
dt.button('quota_scan:name').enable(true);
|
||||||
|
@ -254,9 +256,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -25,8 +25,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="user_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="user_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -42,8 +42,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
|
@ -150,6 +153,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{if not .ReadOnly}}
|
{{if not .ReadOnly}}
|
||||||
function saveFile() {
|
function saveFile() {
|
||||||
$('#idSave').addClass("disabled");
|
$('#idSave').addClass("disabled");
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
async function uploadFile() {
|
async function uploadFile() {
|
||||||
var errorMessage = "Error saving file";
|
var errorMessage = "Error saving file";
|
||||||
|
@ -193,9 +197,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
$('#idSave').removeClass("disabled");
|
$('#idSave').removeClass("disabled");
|
||||||
$('#errorTxt').text(error.message);
|
$('#errorTxt').text(error.message);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -35,8 +35,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
|
@ -45,8 +48,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div id="tableContainer" class="table-responsive">
|
<div id="tableContainer" class="table-responsive">
|
||||||
|
@ -280,6 +286,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
const childProps = new Map();
|
const childProps = new Map();
|
||||||
|
|
||||||
function openExternalURL(url, fileLink, fileName){
|
function openExternalURL(url, fileLink, fileName){
|
||||||
|
$('#errorMsg').hide();
|
||||||
if (childReference == null || childReference.closed) {
|
if (childReference == null || childReference.closed) {
|
||||||
childProps.set('link', fileLink);
|
childProps.set('link', fileLink);
|
||||||
childProps.set('url', url);
|
childProps.set('url', url);
|
||||||
|
@ -293,9 +300,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
} else {
|
} else {
|
||||||
$('#errorTxt').text('An external window is already open, please close it before trying to open a new one');
|
$('#errorTxt').text('An external window is already open, please close it before trying to open a new one');
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,13 +399,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#errorMsg').hide();
|
||||||
downloadFileAsBlob().catch(function(error){
|
downloadFileAsBlob().catch(function(error){
|
||||||
notifyBlobDownloadError(error.message);
|
notifyBlobDownloadError(error.message);
|
||||||
$('#errorTxt').text(error.message);
|
$('#errorTxt').text(error.message);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'saveBlob':
|
case 'saveBlob':
|
||||||
|
@ -448,14 +450,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#errorMsg').hide();
|
||||||
saveBlob().catch(function(error){
|
saveBlob().catch(function(error){
|
||||||
$('#spinnerModal').modal('hide');
|
$('#spinnerModal').modal('hide');
|
||||||
notifySave("KO", error.message);
|
notifySave("KO", error.message);
|
||||||
$('#errorTxt').text(error.message);
|
$('#errorTxt').text(error.message);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -623,6 +623,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
$('#spinnerModal').modal('show');
|
$('#spinnerModal').modal('show');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
function deleteItem() {
|
function deleteItem() {
|
||||||
if (index >= selectedItems.length || has_errors){
|
if (index >= selectedItems.length || has_errors){
|
||||||
|
@ -679,9 +680,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
deleteItem();
|
deleteItem();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -789,6 +787,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
$("#create_dir_form").submit(function (event) {
|
$("#create_dir_form").submit(function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$('#createDirModal').modal('hide');
|
$('#createDirModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
let dirName = replaceSlash($("#directory_name").val());
|
let dirName = replaceSlash($("#directory_name").val());
|
||||||
let path = '{{.DirsURL}}?path={{.CurrentDir}}' + encodeURIComponent("/"+dirName);
|
let path = '{{.DirsURL}}?path={{.CurrentDir}}' + encodeURIComponent("/"+dirName);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
|
@ -815,9 +814,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -835,6 +831,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
$('#uploadFilesModal').modal('hide');
|
$('#uploadFilesModal').modal('hide');
|
||||||
$('#spinnerModal').modal('show');
|
$('#spinnerModal').modal('show');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
function uploadFile() {
|
function uploadFile() {
|
||||||
if (index >= files.length || has_errors){
|
if (index >= files.length || has_errors){
|
||||||
|
@ -901,9 +898,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
$('#errorTxt').text(error.message);
|
$('#errorTxt').text(error.message);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
uploadFile();
|
uploadFile();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -930,6 +924,8 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
let path = '{{.FileActionsURL}}/move';
|
let path = '{{.FileActionsURL}}/move';
|
||||||
path+='?path={{.CurrentDir}}'+encodeURIComponent("/"+itemName)+'&target='+targetDir+encodeURIComponent("/"+targetName);
|
path+='?path={{.CurrentDir}}'+encodeURIComponent("/"+itemName)+'&target='+targetDir+encodeURIComponent("/"+targetName);
|
||||||
$('#renameModal').modal('hide');
|
$('#renameModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -954,9 +950,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
let selectedItems = table.column(0).checkboxes.selected().length;
|
let selectedItems = table.column(0).checkboxes.selected().length;
|
||||||
table.button('rename:name').enable(selectedItems == 1);
|
table.button('rename:name').enable(selectedItems == 1);
|
||||||
}
|
}
|
||||||
|
@ -985,6 +978,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
spinnerDone = false;
|
spinnerDone = false;
|
||||||
$('#copyModal').modal('hide');
|
$('#copyModal').modal('hide');
|
||||||
$('#spinnerModal').modal('show');
|
$('#spinnerModal').modal('show');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
|
@ -1012,9 +1006,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
$('#spinnerModal').modal('hide');
|
$('#spinnerModal').modal('hide');
|
||||||
spinnerDone = true;
|
spinnerDone = true;
|
||||||
let selectedItems = table.column(0).checkboxes.selected().length;
|
let selectedItems = table.column(0).checkboxes.selected().length;
|
||||||
|
@ -1149,11 +1140,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$('#errorMsg').hide();
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deferRender": true,
|
"deferRender": true,
|
||||||
|
|
|
@ -31,8 +31,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<div id="successTOTPMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successTOTPMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
<div id="successTOTPTxt" class="card-body"></div>
|
<div id="successTOTPTxt" class="card-body"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="errorTOTPMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorTOTPMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTOTPTxt" class="card-body text-form-error"></div>
|
<span id="errorTOTPTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>Status: {{if .TOTPConfig.Enabled }}"Enabled". Current configuration: "{{.TOTPConfig.ConfigName}}"{{else}}"Disabled"{{end}}</p>
|
<p>Status: {{if .TOTPConfig.Enabled }}"Enabled". Current configuration: "{{.TOTPConfig.ConfigName}}"{{else}}"Disabled"{{end}}</p>
|
||||||
|
@ -115,8 +118,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<div id="successRecCodesMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successRecCodesMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
<div id="successRecCodesTxt" class="card-body"></div>
|
<div id="successRecCodesTxt" class="card-body"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="errorRecCodesMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorRecCodesMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorRecCodesTxt" class="card-body text-form-error"></div>
|
<span id="errorRecCodesTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<p>Recovery codes are a set of one time use codes that can be used in place of the TOTP to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate TOTP configuration.</p>
|
<p>Recovery codes are a set of one time use codes that can be used in place of the TOTP to login to the web UI. You can use them if you lose access to your phone to login to your account and disable or regenerate TOTP configuration.</p>
|
||||||
|
@ -177,7 +183,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function totpGenerate() {
|
function totpGenerate() {
|
||||||
var path = "{{.GenerateTOTPURL}}";
|
$('#errorTOTPMsg').hide();
|
||||||
|
let path = "{{.GenerateTOTPURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -209,24 +217,19 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function totpValidate() {
|
function totpValidate() {
|
||||||
var passcode = $('#idPasscode').val();
|
$('#errorTOTPMsg').hide();
|
||||||
|
let passcode = $('#idPasscode').val();
|
||||||
if (passcode == "") {
|
if (passcode == "") {
|
||||||
$('#errorTOTPTxt').text("The verification code is required");
|
$('#errorTOTPTxt').text("The verification code is required");
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var path = "{{.ValidateTOTPURL}}";
|
let path = "{{.ValidateTOTPURL}}";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -252,19 +255,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function totpSave() {
|
function totpSave() {
|
||||||
var path = "{{.SaveTOTPURL}}";
|
let path = "{{.SaveTOTPURL}}";
|
||||||
var protocolsArray = [];
|
let protocolsArray = [];
|
||||||
$('#idProtocols').find('option:selected').each(function(){
|
$('#idProtocols').find('option:selected').each(function(){
|
||||||
protocolsArray.push($(this).val());
|
protocolsArray.push($(this).val());
|
||||||
});
|
});
|
||||||
|
$('#errorTOTPMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -294,9 +296,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -306,11 +305,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
|
|
||||||
function totpUpdateProtocols() {
|
function totpUpdateProtocols() {
|
||||||
var path = "{{.SaveTOTPURL}}";
|
let path = "{{.SaveTOTPURL}}";
|
||||||
var protocolsArray = [];
|
let protocolsArray = [];
|
||||||
$('#idProtocols').find('option:selected').each(function(){
|
$('#idProtocols').find('option:selected').each(function(){
|
||||||
protocolsArray.push($(this).val());
|
protocolsArray.push($(this).val());
|
||||||
});
|
});
|
||||||
|
$('#errorTOTPMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -340,16 +341,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function totpDisable() {
|
function totpDisable() {
|
||||||
$('#disableTOTPModal').modal('hide');
|
$('#disableTOTPModal').modal('hide');
|
||||||
var path = "{{.SaveTOTPURL}}";
|
$('#errorTOTPMsg').hide();
|
||||||
|
let path = "{{.SaveTOTPURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -375,15 +375,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTOTPTxt').text(txt);
|
$('#errorTOTPTxt').text(txt);
|
||||||
$('#errorTOTPMsg').show();
|
$('#errorTOTPMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorTOTPMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRecoveryCodes() {
|
function getRecoveryCodes() {
|
||||||
var path = "{{.RecCodesURL}}";
|
$('#errorRecCodesMsg').hide();
|
||||||
|
let path = "{{.RecCodesURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
|
@ -416,15 +415,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorRecCodesTxt').text(txt);
|
$('#errorRecCodesTxt').text(txt);
|
||||||
$('#errorRecCodesMsg').show();
|
$('#errorRecCodesMsg').show();
|
||||||
setTimeout(function () {
|
window.scrollTo(0, $("#idRecoveryCodesCard").offset().top);
|
||||||
$('#errorRecCodesMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateRecoveryCodes() {
|
function generateRecoveryCodes() {
|
||||||
var path = "{{.RecCodesURL}}";
|
$('#errorRecCodesMsg').hide();
|
||||||
|
let path = "{{.RecCodesURL}}";
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
@ -447,9 +446,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}, 5000);
|
}, 5000);
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Failed to generate new recovery codes";
|
let txt = "Failed to generate new recovery codes";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -460,9 +459,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorRecCodesTxt').text(txt);
|
$('#errorRecCodesTxt').text(txt);
|
||||||
$('#errorRecCodesMsg').show();
|
$('#errorRecCodesMsg').show();
|
||||||
setTimeout(function () {
|
window.scrollTo(0, $("#idRecoveryCodesCard").offset().top);
|
||||||
$('#errorRecCodesMsg').hide();
|
|
||||||
}, 8000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,8 +25,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="profile_form" action="{{.CurrentURL}}" method="POST">
|
<form id="profile_form" action="{{.CurrentURL}}" method="POST">
|
||||||
|
|
|
@ -29,8 +29,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="share_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
<form id="share_form" action="{{.CurrentURL}}" method="POST" autocomplete="off">
|
||||||
|
|
|
@ -39,12 +39,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="tableContainer" class="table-responsive">
|
<div id="tableContainer" class="table-responsive">
|
||||||
<table class="table table-hover nowrap" id="dataTable" width="100%" cellspacing="0">
|
<table class="table table-hover nowrap" id="dataTable" width="100%" cellspacing="0">
|
||||||
|
@ -307,14 +313,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
$("#upload_files_form").submit(function (event){
|
$("#upload_files_form").submit(function (event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var files = FilePond.find(document.getElementById("files_name")).getFiles();
|
let files = FilePond.find(document.getElementById("files_name")).getFiles();
|
||||||
var has_errors = false;
|
let has_errors = false;
|
||||||
var index = 0;
|
let index = 0;
|
||||||
var success = 0;
|
let success = 0;
|
||||||
spinnerDone = false;
|
spinnerDone = false;
|
||||||
|
|
||||||
$('#uploadFilesModal').modal('hide');
|
$('#uploadFilesModal').modal('hide');
|
||||||
$('#spinnerModal').modal('show');
|
$('#spinnerModal').modal('show');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
function uploadFile() {
|
function uploadFile() {
|
||||||
if (index >= files.length || has_errors){
|
if (index >= files.length || has_errors){
|
||||||
|
@ -327,12 +334,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveFile() {
|
async function saveFile() {
|
||||||
var errorMessage = "Error uploading files";
|
let errorMessage = "Error uploading files";
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
var f = files[index].file;
|
let f = files[index].file;
|
||||||
var uploadPath = '{{.UploadBaseURL}}'+fixedEncodeURIComponent("/"+escapeHTML(f.name));
|
let uploadPath = '{{.UploadBaseURL}}'+fixedEncodeURIComponent("/"+escapeHTML(f.name));
|
||||||
var lastModified;
|
let lastModified;
|
||||||
try {
|
try {
|
||||||
lastModified = f.lastModified;
|
lastModified = f.lastModified;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -377,9 +384,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
$('#errorTxt').text(error.message);
|
$('#errorTxt').text(error.message);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
uploadFile();
|
uploadFile();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -426,15 +430,15 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
enabled: true
|
enabled: true
|
||||||
};
|
};
|
||||||
|
|
||||||
var table = $('#dataTable').DataTable({
|
let table = $('#dataTable').DataTable({
|
||||||
"ajax": {
|
"ajax": {
|
||||||
"url": "{{.DirsURL}}?path={{.CurrentDir}}",
|
"url": "{{.DirsURL}}?path={{.CurrentDir}}",
|
||||||
"dataSrc": "",
|
"dataSrc": "",
|
||||||
"error": function ($xhr, textStatus, errorThrown) {
|
"error": function ($xhr, textStatus, errorThrown) {
|
||||||
$(".dataTables_processing").hide();
|
$(".dataTables_processing").hide();
|
||||||
var txt = "Failed to get directory listing";
|
let txt = "Failed to get directory listing";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -445,9 +449,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"deferRender": true,
|
"deferRender": true,
|
||||||
|
|
|
@ -26,12 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "page_body"}}
|
{{define "page_body"}}
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
</div>
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
</button>
|
||||||
<div id="successTxt" class="card-body"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card shadow mb-4">
|
<div class="card shadow mb-4">
|
||||||
|
@ -153,11 +152,13 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
function deleteAction() {
|
function deleteAction() {
|
||||||
var table = $('#dataTable').DataTable();
|
let table = $('#dataTable').DataTable();
|
||||||
table.button('delete:name').enable(false);
|
table.button('delete:name').enable(false);
|
||||||
var shareID = table.row({ selected: true }).data()[0];
|
let shareID = table.row({ selected: true }).data()[0];
|
||||||
var path = '{{.ShareURL}}' + "/" + fixedEncodeURIComponent(shareID);
|
let path = '{{.ShareURL}}' + "/" + fixedEncodeURIComponent(shareID);
|
||||||
$('#deleteModal').modal('hide');
|
$('#deleteModal').modal('hide');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: path,
|
url: path,
|
||||||
type: 'DELETE',
|
type: 'DELETE',
|
||||||
|
@ -168,9 +169,9 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
window.location.href = '{{.SharesURL}}';
|
window.location.href = '{{.SharesURL}}';
|
||||||
},
|
},
|
||||||
error: function ($xhr, textStatus, errorThrown) {
|
error: function ($xhr, textStatus, errorThrown) {
|
||||||
var txt = "Unable to delete the selected share";
|
let txt = "Unable to delete the selected share";
|
||||||
if ($xhr) {
|
if ($xhr) {
|
||||||
var json = $xhr.responseJSON;
|
let json = $xhr.responseJSON;
|
||||||
if (json) {
|
if (json) {
|
||||||
if (json.message){
|
if (json.message){
|
||||||
txt += ": " + json.message;
|
txt += ": " + json.message;
|
||||||
|
@ -181,9 +182,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
$('#errorTxt').text(txt);
|
$('#errorTxt').text(txt);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 5000);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
<h6 id="success_title" class="m-0 font-weight-bold text-primary" style="display: none;">Upload completed to share "{{.Share.Name}}", user "{{.Share.Username}}"</h6>
|
<h6 id="success_title" class="m-0 font-weight-bold text-primary" style="display: none;">Upload completed to share "{{.Share.Name}}", user "{{.Share.Username}}"</h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div id="errorMsg" class="card mb-4 border-left-warning" style="display: none;">
|
<div id="errorMsg" class="alert alert-warning alert-dismissible fade show" style="display: none;" role="alert">
|
||||||
<div id="errorTxt" class="card-body text-form-error"></div>
|
<span id="errorTxt"></span>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
<div id="successMsg" class="card mb-4 border-left-success" style="display: none;">
|
||||||
<div id="successTxt" class="card-body">
|
<div id="successTxt" class="card-body">
|
||||||
|
@ -72,13 +75,14 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
$("#upload_files_form").submit(function (event){
|
$("#upload_files_form").submit(function (event){
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var files = $("#files_name")[0].files;
|
let files = $("#files_name")[0].files;
|
||||||
var has_errors = false;
|
let has_errors = false;
|
||||||
var index = 0;
|
let index = 0;
|
||||||
var success = 0;
|
let success = 0;
|
||||||
spinnerDone = false;
|
spinnerDone = false;
|
||||||
|
|
||||||
$('#spinnerModal').modal('show');
|
$('#spinnerModal').modal('show');
|
||||||
|
$('#errorMsg').hide();
|
||||||
|
|
||||||
function uploadFile() {
|
function uploadFile() {
|
||||||
if (index >= files.length || has_errors){
|
if (index >= files.length || has_errors){
|
||||||
|
@ -95,12 +99,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveFile() {
|
async function saveFile() {
|
||||||
var errorMessage = "Error uploading files";
|
let errorMessage = "Error uploading files";
|
||||||
let response;
|
let response;
|
||||||
try {
|
try {
|
||||||
var f = files[index];
|
let f = files[index];
|
||||||
var uploadPath = '{{.UploadBasePath}}/'+fixedEncodeURIComponent(escapeHTML(f.name));
|
let uploadPath = '{{.UploadBasePath}}/'+fixedEncodeURIComponent(escapeHTML(f.name));
|
||||||
var lastModified;
|
let lastModified;
|
||||||
try {
|
try {
|
||||||
lastModified = f.lastModified;
|
lastModified = f.lastModified;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -145,9 +149,6 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
has_errors = true;
|
has_errors = true;
|
||||||
$('#errorTxt').text(error.message);
|
$('#errorTxt').text(error.message);
|
||||||
$('#errorMsg').show();
|
$('#errorMsg').show();
|
||||||
setTimeout(function () {
|
|
||||||
$('#errorMsg').hide();
|
|
||||||
}, 10000);
|
|
||||||
uploadFile();
|
uploadFile();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
|
@ -19,8 +19,11 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="card mb-4 border-left-warning">
|
<div class="alert alert-warning alert-dismissible fade show" role="alert">
|
||||||
<div class="card-body text-form-error">{{.Error}}</div>
|
{{.Error}}
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
<form id="login_form" action="{{.CurrentURL}}" method="POST" autocomplete="off"
|
||||||
|
|
Loading…
Reference in a new issue