Viewing File: /usr/local/cpanel/base/frontend/jupiter/ls_web_cache_manager/static/js/litespeed-custom.min.js

console.log("Entering litespeed-custom.js");let lastElement=window.location.href.split("/").pop().split("?")[0].split("#")[0];console.log("lastElement: "+lastElement);var ls_redis=!1,live_php="./ls_web_cache_manager/ls_web_cache_manager.live.php";lastElement=="ls_redis_cache_manager.html.tt"?(ls_redis=!0,live_php="./ls_web_cache_manager/ls_redis_cache_manager.live.php",console.log("ls_redis: "+ls_redis)):console.log("ls_redis: "+ls_redis),$("#lswsContent").load(live_php+window.location.search);function lswsIsRedis(){return ls_redis}function lswsInitDropdownBoxes(){var e,t=document.getElementsByClassName("accordion");for(e=0;e<t.length;e++)t[e].addEventListener("click",function(){this.classList.toggle("active");var e=this.nextElementSibling;e.style.maxHeight?e.style.maxHeight=null:e.style.maxHeight=e.scrollHeight+"px"})}function lswsCollapseDropdownBox(e){e.classList.remove("active"),e.nextElementSibling.style.maxHeight=null}function lswsWriteToMsgBox(e,t,n){n==null&&(n=!1);var o={succ:"div#succMsgs",err:"div#errMsgs"},s=o[t];return n&&$(s+" ul").empty(),e!==void 0&&e.length!==0&&(e.forEach(function(e){$(s+" ul").append("<li>"+e+"</li>")}),!0)}function flushCache(e,t){t==null&&(t=!0),confirm("Flushing LSCache will remove all cache files under "+e+". Flush LSCache?")&&$.getJSON(live_php+"?do=flush&lsredis="+(ls_redis?"1":"0"),function(e){var n,a,d,h,m,f,s="initial",o="none",i=o,u=o,l=o,p=e.succMsgs,r=e.errMsgs,c=0;lswsWriteToMsgBox(r,"err",t)&&(i=s,c=r.length,u=s),n=$("span#errMsgCnt"),d=t?0:parseInt(n.text()),a=d+c,n.html(a),a==0&&(h=n.closest("button")[0],lswsCollapseDropdownBox(h)),n.closest("button").css("display",u),lswsWriteToMsgBox(p,"succ",t)&&(i=s,l=s),m=$("div#succMsgs"),m.css("display",l),f=$("div#display-msgs"),f.css("display",i)})}function restartPHP(e){e==null&&(e=!0),confirm("Restart all detached PHP processes?")&&$.getJSON(live_php+"?do=restartPHP&lsredis="+(ls_redis?"1":"0"),function(t){var n,a,d,h,m,f,s="initial",o="none",i=o,u=o,l=o,p=t.succMsgs,r=t.errMsgs,c=0;lswsWriteToMsgBox(r,"err",e)&&(i=s,c=r.length,u=s),n=$("span#errMsgCnt"),d=e?0:parseInt(n.text()),a=d+c,n.html(a),a==0&&(h=n.closest("button")[0],lswsCollapseDropdownBox(h)),n.closest("button").css("display",u),lswsWriteToMsgBox(p,"succ",e)&&(i=s,l=s),m=$("div#succMsgs"),m.css("display",l),f=$("div#display-msgs"),f.css("display",i)})}function lscmSaveSettings(e){e==null&&(e=!0);var t=document.getElementById("lscmLogLvl"),n=t.options[t.selectedIndex].value;$.getJSON(live_php+"?do=save_settings&log_file_lvl="+n+"&lsredis="+(ls_redis?"1":"0"),function(t){var n,a,d,h,m,f,s="initial",o="none",i=o,u=o,l=o,p=t.succMsgs,r=t.errMsgs,c=0;lswsWriteToMsgBox(r,"err",e)&&(i=s,c=r.length,u=s),n=$("span#errMsgCnt"),d=e?0:parseInt(n.text()),a=d+c,n.html(a),a==0&&(h=n.closest("button")[0],lswsCollapseDropdownBox(h)),n.closest("button").css("display",u),lswsWriteToMsgBox(p,"succ",e)&&(i=s,l=s),m=$("div#succMsgs"),m.css("display",l),f=$("div#display-msgs"),f.css("display",i)})}function lscwpValidateSelectFormSubmit(e,t){var n,s=!1;$("#lsws-data-table input:checkbox").each(function(){if($(this).prop("checked"))return s=!0,!1}),s?(e!="disable_sel"||confirm("LSCWP configuration may be lost when disabling. Disable anyway?"))&&(n=$('form[name="lswsform"]'),$("<input>",{type:"hidden",name:e,value:t}).appendTo(n),n.submit()):alert("Please select at least one checkbox.")}function ecCertValidateSelectFormSubmit(e,t){var n,s=!1;$("#ec-cert-data-table input:checkbox").each(function(){if($(this).prop("checked"))return s=!0,!1}),s?(n=$('form[name="lswsform"]'),$("<input>",{type:"hidden",name:e,value:t}).appendTo(n),n.submit()):alert("Please select at least one checkbox.")}
Back to Directory File Manager