forked from zer.ooo/web
reset interface before opening revoke modal and remove certificate row afterwards
This commit is contained in:
parent
c4d99ba46c
commit
3e01b5f353
1 changed files with 7 additions and 4 deletions
|
@ -4,23 +4,26 @@ $(function(){
|
|||
var selected = false;
|
||||
|
||||
$('.revoke').click(function () {
|
||||
selected = $(this).data('name');
|
||||
selected = $(this);
|
||||
|
||||
$('.revoke-modal').modal('show');
|
||||
error.hide();
|
||||
});
|
||||
|
||||
$('.revoke-confirm').click(function () {
|
||||
var selectedSnapshot = selected;
|
||||
error.hide();
|
||||
|
||||
$.post('/panel/certificates/revoke', {
|
||||
name: selectedSnapshot,
|
||||
name: selectedSnapshot.data('name'),
|
||||
password: $('.revoke-password').val()
|
||||
}, function(data) {
|
||||
if (data.success) {
|
||||
$('#certificates').after(success.text("Successfully revoked '" + selectedSnapshot + "'"));
|
||||
$('#certificates').after(success.text("Successfully revoked '" + selectedSnapshot.data('name') + "'").delay(3000).hide(0));
|
||||
$('.revoke-modal').modal('hide');
|
||||
$(selectedSnapshot).parents('tr').first().remove();
|
||||
} else {
|
||||
$('#revoke-put-error-after-me').after(error.text(data.error));
|
||||
$('#revoke-put-error-after-me').after(error.text(data.error).show());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue