Add support for backfillips

This commit is contained in:
2024-09-10 11:51:53 +02:00
parent 4fb45c41bd
commit bdba6db42d
5 changed files with 48 additions and 7 deletions

View File

@ -14,12 +14,10 @@ function renameNode(nodeId) {
}
function createPKA(username) {
console.log(username);
var url = `${username}/pakcreate`;
var ephemereal = $("#ephemereal").is(":checked");
var reusable = $("#reusable").is(":checked");
var expiration = $("#expiration").val();
console.log(expiration);
$.ajax({
url: url,
method: "POST",
@ -65,3 +63,29 @@ function toggleExpired(obj) {
$(".pka-expired").addClass("pka-hide");
}
}
function backfillips(obj) {
var url = "backfillips";
var button = $(obj);
var original = button.html();
$.ajax({
url: url,
method: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
xhrFields: {
withCredentials: true,
},
data: {},
success: function (data) {
if (data.length) {
button.html("Updated");
} else {
button.html("Done");
}
setTimeout(function () {
button.html(original);
}, 500);
},
});
}