Support for policy upload/download

Plus a small bugfix for groups
This commit is contained in:
2024-12-17 12:10:40 +01:00
parent 7fa17adfb1
commit 31910dc034
10 changed files with 646 additions and 508 deletions

View File

@ -64,7 +64,7 @@ a:active {
text-decoration: none;
}
a.nodeco, a.nav-link, a.navbar-brand, a.routeToggle {
a.nodeco, a.nav-link, a.navbar-brand, a.routeToggle, a.plain {
text-decoration-line: none;
text-decoration-style: unset;
}

View File

@ -89,3 +89,39 @@ function backfillips(obj) {
},
});
}
function uploadACL(obj) {
var fd = new FormData();
var files = $("#upload")[0].files[0];
fd.append("file", files);
// When we close the modal, we reload the page
$("#uploadACL").on("hidden.bs.modal", function (event) {
location.reload();
});
$.ajax({
url: "/policy/upload",
type: "POST",
xhrFields: {
withCredentials: true,
},
data: fd,
contentType: false,
processData: false,
success: function (response) {
if (response != 0) {
$("#output").html("acl updated");
} else {
$("#output").html("acl not updated");
}
setTimeout(() => {
$("#uploadACL").modal("hide");
}, 5000);
},
error: function (response) {
console.log(response.responseJSON.message);
$("#output").html(response.responseJSON.message);
},
});
}