Finished up with IP-Ban functionality on the back-end. Just need to finish up with UI.

This commit is contained in:
rainbow napkin 2025-01-01 17:36:43 -05:00
parent 756c42ceaa
commit 977e8e1e2e
16 changed files with 284 additions and 67 deletions

View file

@ -139,7 +139,7 @@ class canopyAdminUtils{
}
}
async banUser(user, permanent, expirationDays){
async banUser(user, permanent, ipBan, expirationDays){
var response = await fetch(`/api/admin/ban`,{
method: "POST",
headers: {
@ -147,7 +147,7 @@ class canopyAdminUtils{
"x-csrf-token": utils.ajax.getCSRFToken()
},
//Unfortunately JSON doesn't natively handle ES6 maps, and god forbid someone update the standard in a way that's backwards compatible...
body: JSON.stringify({user, permanent, expirationDays})
body: JSON.stringify({user, permanent, ipBan, expirationDays})
});
if(response.status == 200){

View file

@ -234,6 +234,7 @@ class canopyUXUtils{
this.contentDiv.innerHTML = await utils.ajax.getPopup(this.content);
}else{
this.contentDiv.innerHTML = this.content;
this.contentDiv.classList.add('popup-plaintext-content');
}
//display popup nodes