mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-15 14:03:02 +00:00
support revoking tokens from token page
This commit is contained in:
@@ -32,5 +32,22 @@ require(["jquery", "jhapi", "moment"], function($, JHAPI, moment) {
|
||||
);
|
||||
return false;
|
||||
});
|
||||
|
||||
function get_token_row(element) {
|
||||
while (!element.hasClass("token-row")) {
|
||||
element = element.parent();
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
$(".revoke-token-btn").click(function() {
|
||||
var el = $(this);
|
||||
var row = get_token_row(el);
|
||||
el.attr("disabled", true);
|
||||
api.revoke_token(user, row.data('token-id'), {
|
||||
success: function(reply) {
|
||||
row.remove();
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user