var dnssecKeyList = [] function applyChanges(data, url, showResult, refreshPage) { $.ajax({ type : "POST", url : url, data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { console.log("Applied changes successfully."); console.log(data); if (showResult) { var modal = $("#modal_success"); if (data['msg']) { modal.find('.modal-body p').text(data['msg']); } else { modal.find('.modal-body p').text("Applied changes successfully"); } modal.modal('show'); } if (refreshPage) { location.reload(true); } }, error : function(jqXHR, status) { console.log(jqXHR); var modal = $("#modal_error"); var responseJson = jQuery.parseJSON(jqXHR.responseText); modal.find('.modal-body p').text(responseJson['msg']); modal.modal('show'); } }); } function applyRecordChanges(data, domain) { $.ajax({ type : "POST", url : $SCRIPT_ROOT + '/domain/' + domain + '/apply', data : JSON.stringify(data),// now data come in this function contentType : "application/json; charset=utf-8", crossDomain : true, dataType : "json", success : function(data, status, jqXHR) { // update Apply button value $.getJSON($SCRIPT_ROOT + '/domain/' + domain + '/info', function(data) { $(".button_apply_changes").val(data['serial']); }); console.log("Applied changes successfully.") var modal = $("#modal_success"); modal.find('.modal-body p').text("Applied changes successfully"); modal.modal('show'); setTimeout(() => {window.location.reload()}, 2000); }, error : function(jqXHR, status) { console.log(jqXHR); var modal = $("#modal_error"); var responseJson = jQuery.parseJSON(jqXHR.responseText); modal.find('.modal-body p').text(responseJson['msg']); modal.modal('show'); } }); } function getTableData(table) { // reformat - pretty format var records = [] table.rows().every(function() { var r = this.data(); var record = {} record["record_name"] = r[0].trim(); record["record_type"] = r[1].trim(); record["record_status"] = r[2].trim(); record["record_ttl"] = r[3].trim(); record["record_data"] = convertHTMLEntityToText(r[4].trim()); record["record_comment"] = convertHTMLEntityToText(r[5].trim()); records.push(record); }); return records } function convertHTMLEntityToText(htmlEntity) { return $('