You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
960 B
JavaScript
29 lines
960 B
JavaScript
9 years ago
|
$(function(){
|
||
|
var error = $('<div class="alert alert-danger" role="alert"></div>');
|
||
|
var success = $('<div class="alert alert-success alert-dismissable" role="alert"></div>');
|
||
|
var selected = false;
|
||
|
|
||
|
$('.revoke').click(function () {
|
||
|
selected = $(this).data('name');
|
||
|
|
||
|
$('.revoke-modal').modal('show');
|
||
|
});
|
||
|
|
||
|
$('.revoke-confirm').click(function () {
|
||
|
var selectedSnapshot = selected;
|
||
|
|
||
|
$.post('/panel/certificates/revoke', {
|
||
|
name: selectedSnapshot,
|
||
|
password: $('.revoke-password').val()
|
||
|
}, function(data) {
|
||
|
if (data.success) {
|
||
|
$('#certificates').after(success.text("Successfully revoked '" + selectedSnapshot + "'"));
|
||
|
$('.revoke-modal').modal('hide');
|
||
|
} else {
|
||
|
$('#revoke-put-error-after-me').after(error.text(data.error));
|
||
|
}
|
||
|
});
|
||
|
|
||
|
$('.revoke-password').val('');
|
||
|
});
|
||
|
});
|