Add disable button

This commit is contained in:
Jeroen Boonstra 2018-03-05 15:26:45 +01:00
parent c8d9f4bf22
commit dcfa98ac59

View File

@ -1,3 +1,5 @@
var dnssecKeyList = []
function applyChanges(data, url, showResult, refreshPage) {
var success = false;
$.ajax({
@ -131,7 +133,7 @@ function enable_dns_sec(url) {
})
}
function getdnssec(url){
function getdnssec(url,domain){
$.getJSON(url, function(data) {
var modal = $("#modal_dnssec_info");
@ -143,10 +145,15 @@ function getdnssec(url){
dnssec_msg = '';
var dnssec = data['dnssec'];
if (dnssec.length == 0 && PDNS_VERSION > 4.1) {
if (dnssec.length == 0 && parseFloat(PDNS_VERSION) > 4.1) {
dnssec_msg = '<h3>Enable DNSSEC?';
modal.find('.modal-body p').html(dnssec_msg);
dnssec_footer = '<button type="button" class="btn btn-flat btn-success button_dnssec_enable pull-left" id="example.com">Enable</button><button type="button" class="btn btn-flat btn-default pull-right" data-dismiss="modal">Cancel</button>';
dnssec_footer = '<button type="button" class="btn btn-flat btn-success button_dnssec_enable pull-left" id="'+domain+'">Enable</button><button type="button" class="btn btn-flat btn-default pull-right" data-dismiss="modal">Cancel</button>';
modal.find('.modal-footer ').html(dnssec_footer);
}
else {
if (parseFloat(PDNS_VERSION) > 4.1) {
dnssec_footer = '<button type="button" class="btn btn-flat btn-danger button_dnssec_disable pull-left" id="'+domain+'">Disable DNSSEC</button><button type="button" class="btn btn-flat btn-default pull-right" data-dismiss="modal">Close</button>';
modal.find('.modal-footer ').html(dnssec_footer);
}
for (var i = 0; i < dnssec.length; i++) {
@ -167,6 +174,7 @@ function getdnssec(url){
dnssec_msg += '</form>';
}
}
}
modal.find('.modal-body p').html(dnssec_msg);
}
modal.modal('show');