webadmin: add defender page

This commit is contained in:
Nicola Murino
2021-06-08 13:24:28 +02:00
parent feec2118bb
commit 4be6307d87
15 changed files with 322 additions and 57 deletions

View File

@@ -107,16 +107,18 @@
headers: {'X-CSRF-TOKEN' : '{{.CSRFToken}}'},
timeout: 15000,
success: function (result) {
table.button('delete:name').enable(true);
window.location.href = '{{.AdminsURL}}';
},
error: function ($xhr, textStatus, errorThrown) {
table.button('delete:name').enable(true);
var txt = "Unable to delete the selected admin";
if ($xhr) {
var json = $xhr.responseJSON;
if (json) {
txt += ": " + json.error;
if (json.message){
txt += ": " + json.message;
} else {
txt += ": " + json.error;
}
}
}
$('#errorTxt').text(txt);