From aac81ed92fe0ce8d2368dc7081e16b930d91ff8a Mon Sep 17 00:00:00 2001 From: DaleBinghamSoteriaSoft Date: Sun, 5 Nov 2023 12:00:42 -0500 Subject: [PATCH] updated minification of JS --- js/openrmf.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/openrmf.min.js b/js/openrmf.min.js index 27b5e7e..55cb0f1 100644 --- a/js/openrmf.min.js +++ b/js/openrmf.min.js @@ -1 +1 @@ -function setupOpenRMFUI(e){$("#main").show(),"undefined"!=typeof keycloak&&(setupTimers(),$("#includeAutoLogin").load("/includes/modalLogout.html")),$("#includeNavBarLink").load("/includes/navbar.html"),$("#includeSidebarLink").load("/includes/sidebarmenu.html"),$("#includeFooterLink").load("/includes/footertext.html")}function menuMetricsLink(){urlMetricsMenuLink?window.open(urlMetricsMenuLink,"openrmf-metrics"):alert("The Metrics menu has not been configured yet.")}function menuKeycloakLink(){urlKeycloakMenuLink?window.open(urlKeycloakMenuLink,"openrmf-users"):alert("The Users menu has not been configured yet.")}var warningTimerID,timeoutTimerID,keycloakTimerID,warningTimeout=84e4,timeoutNow=6e4,keycloakTimeout=295e3,bWarningAutoLogout=!1;function startLogoutTimer(){warningTimerID=window.setTimeout(warningInactive,warningTimeout)}function startKeycloakUpdateTimer(){keycloakTimerID=window.setTimeout(updateKeycloakToken,keycloakTimeout)}function warningInactive(){bWarningAutoLogout=!0,window.clearTimeout(warningTimerID),timeoutTimerID=window.setTimeout(IdleTimeout,timeoutNow),$("#modalAutoLogout").modal("show")}function resetLogoutTimer(){bWarningAutoLogout||(window.clearTimeout(timeoutTimerID),window.clearTimeout(warningTimerID),startLogoutTimer())}function updateKeycloakToken(){keycloak.updateToken(300).success((()=>{window.clearTimeout(keycloakTimerID),startKeycloakUpdateTimer()})).error((()=>{console.log("Keycloak token refresh unsuccessful")}))}function IdleTimeout(){autoLogout()}function setupTimers(){document.addEventListener("mousemove",resetLogoutTimer,!1),document.addEventListener("mousedown",resetLogoutTimer,!1),document.addEventListener("keypress",resetLogoutTimer,!1),document.addEventListener("touchmove",resetLogoutTimer,!1),document.addEventListener("onscroll",resetLogoutTimer,!1),startLogoutTimer(),startKeycloakUpdateTimer()}function logout(){var e={redirectUri:document.location.protocol+"//"+document.location.host+"/logout.html"};keycloak.logout(e).then((e=>{console.log("--\x3e log: logout success ",e)})).catch((e=>{console.log("--\x3e log: logout error ",e)}))}function autoLogout(){var e={redirectUri:document.location.protocol+"//"+document.location.host+"/logout.html?autologout=true"};keycloak.logout(e).then((e=>{console.log("--\x3e log: logout success ",e)})).catch((e=>{console.log("--\x3e log: logout error ",e)}))}function openProfile(){location.href=keycloak.createAccountUrl()}async function getSystemTotalCount(){let e=await fetch(readAPI+"count/systems",{headers:{Authorization:"Bearer "+keycloak.token}});if(e.ok){var t=await e.json();$("#numberSystemsTotal").html(t),$("#numberNewSystemsTotal").text(t)}else $("#numberSystemsTotal").html("error"),$("#numberNewSystemsTotal").text("error"),401==e.status?swal("There is an Authentication problem. Please logout and log back in. And have the application administrator verify your API's authentication settings.","Click OK to continue!","error"):401==e.status&&swal("There is an application problem. Please have the application administrator verify your system is 100% healthy and running correctly.","Click OK to continue!","error")}async function getChecklistTotalCount(){let e=await fetch(readAPI+"count/artifacts",{headers:{Authorization:"Bearer "+keycloak.token}});if(e.ok){var t=await e.json();$("#numberChecklistsTotal").html(t),$("#numberNewChecklistsTotal").text(t)}else $("#numberChecklistsTotal").html("error"),$("#numberNewChecklistsTotal").text("error"),401==e.status?swal("There is an Authentication problem. Please logout and log back in. And have the application administrator verify your API's authentication settings.","Click OK to continue!","error"):401==e.status&&swal("There is an application problem. Please have the application administrator verify your system is 100% healthy and running correctly.","Click OK to continue!","error")}async function getTemplateTotalCount(){let e=await fetch(templateAPI+"count/templates",{headers:{Authorization:"Bearer "+keycloak.token}});if(e.ok){var t=await e.json();$("#numberTemplatesTotal").html(t),$("#numberNewTemplatesTotal").text(t)}else $("#numberTemplatesTotal").html("error"),$("#numberNewTemplatesTotal").text("error"),401==e.status?swal("There is an Authentication problem. Please logout and log back in. And have the application administrator verify your API's authentication settings.","Click OK to continue!","error"):401==e.status&&swal("There is an application problem. Please have the application administrator verify your system is 100% healthy and running correctly.","Click OK to continue!","error")}async function getSystemsForDashboard(){sessionStorage.removeItem("checklistSystems"),$("#checklistSystem").children().remove().end(),$("#checklistSystem").append(''),$("#checklistACASSystem").children().remove().end(),$("#checklistACASSystem").append('');var e=await getChecklistSystems();e&&$.each(e,(function(e,t){optionString='",$("#checklistSystem").append(optionString),$("#checklistACASSystem").append(optionString)}))}async function getSystemOpenItemsForDashboard(){var e=$("#checklistSystem").val();if(e){$("#divSystemCategoryDashboard").show();var t=await getScoreForSystemChecklistListing(e);t&&($("#numberCAT1Open").html(t.totalCat1Open),$("#numberCAT1OpenItems").text(t.totalCat1Open),$("#numberCAT2Open").html(t.totalCat2Open),$("#numberCAT2OpenItems").text(t.totalCat2Open),$("#numberCAT3Open").html(t.totalCat3Open),$("#numberCAT3OpenItems").text(t.totalCat3Open))}else $("#divSystemCategoryDashboard").hide()}function loadSystemFromDashboardCategory(e){var t=$("#checklistSystem").val();t&&(location.href="checklists.html?id="+t+"&category="+e)}async function getSystemACASItemsForDashboard(){var e=$("#checklistACASSystem").val();if(e){var t=await getNessusFileSummaryData(e);t?($("#divSystemACASPatchListing").show(),$("#divNessusStatus").hide(),$("#numberCriticalOpen").html(t.totalCriticalOpen),$("#numberHighOpen").html(t.totalHighOpen),$("#numberMediumOpen").html(t.totalMediumOpen),$("#numberLowOpen").html(t.totalLowOpen)):($("#divSystemACASPatchListing").hide(),$("#divNessusStatus").html("There is no current Nessus patch file loaded for this system."),$("#divNessusStatus").show())}else $("#divSystemACASPatchListing").hide(),$("#divNessusStatus").html("There is no current valid Nessus patch file loaded for this system."),$("#divNessusStatus").show()}async function getTemplates(e){$.blockUI({message:"Updating the template listing...please wait",css:{padding:"15px"}});var t=templateAPI;let a=await fetch(t,{headers:{Authorization:"Bearer "+keycloak.token}});if(!a.ok)throw $.unblockUI(),401==a.status?swal("There is an Authentication problem. Please logout and log back in. And have the application administrator verify your API's authentication settings.","Click OK to continue!","error"):401==a.status&&swal("There is an application problem. Please have the application administrator verify your system is 100% healthy and running correctly.","Click OK to continue!","error"),new Error(a.status);var s=await a.json(),o=$("#tblChecklistListing").DataTable();o.clear().draw();var n="";if(0==s.length){$.unblockUI();'',$("#divMessaging").html('There are no Checklist templates uploaded. Please go to the Upload page to add your first.'),$("#divMessaging").show()}else{$("#divMessaging").html(""),$("#divMessaging").hide();for(const e of s)if(n='',n+=e.fullTitle,n+='
last updated on ',e.updatedOn?n+=moment(e.updatedOn).format("MM/DD/YYYY h:mm a"):n+=moment(e.created).format("MM/DD/YYYY h:mm a"),n+="","SYSTEM"==e.templateType)o.row.add({title:n,totalNaF:0,totalNA:0,totalOpen:0,totalNR:0,totalNaFCat1:0,totalNACat1:0,totalOpenCat1:0,totalNRCat1:0,totalNaFCat2:0,totalNACat2:0,totalOpenCat2:0,totalNRCat2:0,totalNaFCat3:0,totalNACat3:0,totalOpenCat3:0,totalNRCat3:0}).draw();else{var i=null,l=new FormData;l.append("rawChecklist",e.rawChecklist),$.ajax({url:scoreAPI,data:l,async:!1,type:"POST",processData:!1,contentType:!1,beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+keycloak.token)},success:function(e){(i=e)?o.row.add({title:n,totalNaF:i.totalNotAFinding,totalNA:i.totalNotApplicable,totalOpen:i.totalOpen,totalNR:i.totalNotReviewed,totalNaFCat1:i.totalCat1NotAFinding,totalNACat1:i.totalCat1NotApplicable,totalOpenCat1:i.totalCat1Open,totalNRCat1:i.totalCat1NotReviewed,totalNaFCat2:i.totalCat2NotAFinding,totalNACat2:i.totalCat2NotApplicable,totalOpenCat2:i.totalCat2Open,totalNRCat2:i.totalCat2NotReviewed,totalNaFCat3:i.totalCat3NotAFinding,totalNACat3:i.totalCat3NotApplicable,totalOpenCat3:intOpenCat2=i.totalCat3Open,totalNRCat3:i.totalCat3NotReviewed}).draw():o.row.add({title:n,totalNaF:0,totalNA:0,totalOpen:0,totalNR:0,totalNaFCat1:0,totalNACat1:0,totalOpenCat1:0,totalNRCat1:0,totalNaFCat2:0,totalNACat2:0,totalOpenCat2:0,totalNRCat2:0,totalNaFCat3:0,totalNACat3:0,totalOpenCat3:0,totalNRCat3:0}).draw(),$.unblockUI()},error:function(){o.row.add({title:n,totalNaF:0,totalNA:0,totalOpen:0,totalNR:0,totalNaFCat1:0,totalNACat1:0,totalOpenCat1:0,totalNRCat1:0,totalNaFCat2:0,totalNACat2:0,totalOpenCat2:0,totalNRCat2:0,totalNaFCat3:0,totalNACat3:0,totalOpenCat3:0,totalNRCat3:0}).draw(),$.unblockUI()}})}$.unblockUI()}}async function getScoreForTemplateListing(e){var t=new FormData;t.append("rawChecklist",e),$.ajax({url:scoreAPI,data:t,type:"POST",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+keycloak.token)},processData:!1,contentType:!1,success:function(e){displayChecklistScores(e)}})}async function deleteTemplate(e){e&&e.length>10&&swal({title:"Delete this Template?",text:"Are you sure you wish to delete this template?",icon:"warning",buttons:!0,dangerMode:!0}).then((t=>{t?$.ajax({url:templateAPI+e,type:"DELETE",beforeSend:function(e){e.setRequestHeader("Authorization","Bearer "+keycloak.token)},success:function(e){swal("Your Template was deleted successfully!","Click OK to continue!","success").then((e=>{location.href="templates.html"}))},error:function(e){swal("There was a Problem. Your Template was not deleted successfully! Please check with the Application Admin.","Click OK to continue!","error")}}):swal("Canceled the Deletion.")}))}async function getChecklistSystemsForChecklistCreation(){var e=await getChecklistSystems();e&&$.each(e,(function(e,t){$("#checklistSystemPackage").append($("