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) { showSuccessModal(data['msg'] || "Applied changes successfully"); } if (refreshPage) { location.reload(true); } }, error : function(jqXHR, status) { console.log(jqXHR); var responseJson = jQuery.parseJSON(jqXHR.responseText); showErrorModal(responseJson['msg']); } }); } 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.") showSuccessModal("Applied changes successfully"); setTimeout(() => {window.location.reload()}, 2000); }, error : function(jqXHR, status) { console.log(jqXHR); var responseJson = jQuery.parseJSON(jqXHR.responseText); showErrorModal(responseJson['msg']); } }); } 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 $('