forked from zer.ooo/web
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.
33 lines
886 B
JavaScript
33 lines
886 B
JavaScript
$(function () {
|
|
var errorDiv = $('<div>').addClass('error-message');
|
|
|
|
function error(msg) {
|
|
$('.title').after(errorDiv.text(msg));
|
|
}
|
|
|
|
$('.actions .certificate-delete').click(function () {
|
|
$(this).parents('.actions').hide().parents('li').first().find('.revoke-q').show();
|
|
});
|
|
|
|
$('.revoke-q .no').click(function () {
|
|
$(this).parents('.revoke-q').hide().parents('li').first().find('.actions').show();
|
|
});
|
|
|
|
$('.revoke-q .yes').click(function () {
|
|
var _this=this;
|
|
|
|
$.post('/panel/certificates/revoke', {
|
|
name: $(_this).data('name')
|
|
}, function (data) {
|
|
if (data.success) {
|
|
$(_this)
|
|
.parents('li')
|
|
.first()
|
|
.remove();
|
|
} else {
|
|
error(data.error);
|
|
}
|
|
});
|
|
});
|
|
});
|