diff --git a/app/static/main.js b/app/static/main.js index e227ecc..5edb71a 100644 --- a/app/static/main.js +++ b/app/static/main.js @@ -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); + }, + }); +} diff --git a/app/templates/nodes.html b/app/templates/nodes.html index 3dce487..11840a5 100644 --- a/app/templates/nodes.html +++ b/app/templates/nodes.html @@ -1,7 +1,16 @@ {% extends "base.html" %} {% block content %} -