From f0597d0a9a88c134fdef8908b30fba2281a9a83b Mon Sep 17 00:00:00 2001 From: Martinski4GitHub <119833648+Martinski4GitHub@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:52:50 -0700 Subject: [PATCH] Fixed misspelling Just fixing a misspelling. --- scmerlin.sh | 2 +- scmerlin_www.asp | 2 +- scmerlin_www.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scmerlin.sh b/scmerlin.sh index 65e8cc0..e81b4d4 100644 --- a/scmerlin.sh +++ b/scmerlin.sh @@ -34,7 +34,7 @@ readonly SCRIPT_NAME="scMerlin" readonly SCRIPT_NAME_LOWER="$(echo "$SCRIPT_NAME" | tr 'A-Z' 'a-z' | sed 's/d//')" readonly SCM_VERSION="v2.5.48" readonly SCRIPT_VERSION="v2.5.48" -readonly SCRIPT_VERSTAG="26031509" +readonly SCRIPT_VERSTAG="26031520" SCRIPT_BRANCH="develop" SCRIPT_REPO="https://raw.githubusercontent.com/AMTM-OSR/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME_LOWER.d" diff --git a/scmerlin_www.asp b/scmerlin_www.asp index 1992dd9..1a85271 100644 --- a/scmerlin_www.asp +++ b/scmerlin_www.asp @@ -545,7 +545,7 @@ function update_temperatures() } /* End firmware functions */ -var arrayproclistlines=[],sortnameproc="CPU%",sortdirproc="desc",arraycronjobs=[],sortnamecron="Name",sortdircron="asc",tmout=null;function SetCurrentPage(){document.form.next_page.value=window.location.pathname.substring(1),document.form.current_page.value=window.location.pathname.substring(1)}Chart.defaults.global.defaultFontColor="#CCC",Chart.Tooltip.positioners.cursor=function(e,t){return t};var srvnamelist=["dnsmasq","wan","httpd","wireless","vsftpd","samba","ddns","ntpd/chronyd"],srvdesclist=["DNS/DHCP Server","Internet Connection","Web Interface","WiFi","FTP Server","Samba","DDNS client","Timeserver"],srvnamevisiblelist=[!0,!1,!0,!1,!0,!1,!1,!0],sortedAddonPages=[];function initial(){SetCurrentPage(),LoadCustomSettings(),show_menu(),Draw_Chart_NoData("nvramUsage","Data loading..."),Draw_Chart_NoData("jffsUsage","Data loading..."),Draw_Chart_NoData("MemoryUsage","Data loading..."),Draw_Chart_NoData("SwapUsage","No swap file configured"),$("#sortTableCron").empty(),$("#sortTableCron").append(BuildSortTableHtmlNoData()),$("#sortTableProcesses").empty(),$("#sortTableProcesses").append(BuildSortTableHtmlNoData());let e="",t="";if(isWireGuard_Supported){e+=Build_WireGuardServer_Table(1),$("#table_config").after(e);for(var r=1;r<6;r++)t+=Build_WireGuardClient_Table(r);$("#table_config").after(t)}let s="";for(r=1;r<3;r++)s+=Build_OpenVPNServer_Table(r);$("#table_config").after(s);let a="";for(r=1;r<6;r++)a+=Build_OpenVPNClient_Table(r);$("#table_config").after(a);let n="";for(var o=0;o",'',"Data loading...","","","",'
Data loading...
'}function BuildSortTableHtml(e){var t='';if("sortTableProcesses"==e){t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+='';for(var r=0;r',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+=""}else if("sortTableCron"==e){t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+='';for(r=0;r',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+=""}return t+="",t+="
PIDPPIDUSERSTATVSZVSZ%CPUCPU%COMMAND
"+arrayproclistlines[r].PID+""+arrayproclistlines[r].PPID+""+arrayproclistlines[r].USER+""+arrayproclistlines[r].STAT+""+arrayproclistlines[r].VSZ+""+arrayproclistlines[r].VSZP+""+arrayproclistlines[r].CPU+""+arrayproclistlines[r].CPUP+""+arrayproclistlines[r].COMMAND+"
NameMinHourDayMMonthDayWCommand
"+arraycronjobs[r].Name+""+arraycronjobs[r].Min+""+arraycronjobs[r].Hour+""+arraycronjobs[r].DayM+""+arraycronjobs[r].Month+""+arraycronjobs[r].DayW+""+arraycronjobs[r].Command+"
"}function Get_NTPWatchdogEnabled_File(){$.ajax({url:"/ext/scmerlin/watchdogenabled.htm",dataType:"text",error:function(e){document.form.scMerlin_NTPwatchdog.value="Disable",$("#scMerlin_NTPwatchdog_Status").text("Currently: DISABLED")},success:function(e){document.form.scMerlin_NTPwatchdog.value="Enable",$("#scMerlin_NTPwatchdog_Status").text("Currently: ENABLED")}})}function Save_NTPWatchdog(){document.form.action_script.value="start_scmerlin_NTPwatchdog"+document.form.scMerlin_NTPwatchdog.value,document.form.action_wait.value=4,$("#auto_refresh").prop("checked",!1),null!=tmout&&clearTimeout(tmout),showLoading(),document.form.submit(),setTimeout(Get_NTPWatchdogEnabled_File,4e3)}function Get_DNSmasqWatchdogEnabled_File(){$.ajax({url:"/ext/scmerlin/tailtaintdnsenabled.htm",dataType:"text",error:function(e){document.form.scMerlin_DNSmasqWatchdog.value="Disable",$("#scMerlin_DNSmasqWatchdog_Status").text("Currently: DISABLED")},success:function(e){document.form.scMerlin_DNSmasqWatchdog.value="Enable",$("#scMerlin_DNSmasqWatchdog_Status").text("Currently: ENABLED")}})}function Get_WebUIModsEnabled_File(){$.ajax({url:"/ext/scmerlin/webuimodsenabled.htm",dataType:"text",cache:!1,error:function(){document.form.scMerlin_WebUIMods.value="Disable",$("#scMerlin_WebUIMods_Status").text("Currently: DISABLED")},success:function(){document.form.scMerlin_WebUIMods.value="Enable",$("#scMerlin_WebUIMods_Status").text("Currently: ENABLED")}})}function Save_WebUIMods(){$("#auto_refresh").prop("checked",!1),null!=tmout&&clearTimeout(tmout),void 0!==WaitMsgPopupBox&&WaitMsgPopupBox.CloseMsg(),window._scmPauseAjax=!0,document.form.action_script.value="start_scmerlin_WebUIMods"+document.form.scMerlin_WebUIMods.value,document.form.action_wait.value=8,showLoading(),document.form.submit()}function Save_DNSmasqWatchdog(){document.form.action_script.value="start_scmerlin_DNSmasqWatchdog"+document.form.scMerlin_DNSmasqWatchdog.value,document.form.action_wait.value=4,$("#auto_refresh").prop("checked",!1),null!=tmout&&clearTimeout(tmout),showLoading(),document.form.submit(),setTimeout(Get_DNSmasqWatchdogEnabled_File,4e3)}const enableWebUIModsHint="This option handles WebUI modifications to enable or disable the Sitemap page and the pop-up menus on the left-hand-side vertical menu bar. These changes requires logging you out of the WebUI to restart the web server.";function ShowHintMsg(e){let t;switch(e.name){case"ENABLE_WEBUI_MODS":t=enableWebUIModsHint;break;default:t="";break}if(t.length>0)return $(e)[0].onmouseout=nd,overlib(t,0,0)}const WaitMsgPopupBox={waitCounter:0,waitMaxSecs:0,waitTimerOn:!1,waitTimerID:null,waitMsgBox:null,waitMsgTemp:"",waitMsgBoxID:"myWaitMsgPopupBoxID",CloseMsg:function(){this.waitTimerOn=!1,this.waitCounter=0,this.waitMaxSecs=0,this.waitMsgTemp="",null!=this.waitTimerID&&(clearTimeout(this.waitTimerID),this.waitTimerID=null),null!=this.waitMsgBox&&this.waitMsgBox.close()},StartMsg:function(e,t,r){this.waitTimerOn||(this.waitTimerOn=!0,this.waitCounter=0,this.waitMsgTemp="",this.waitMaxSecs=Math.round(t/1e3),this.ShowTimedMsg(e,r))},ShowTimedMsg:function(e,t){if(this.waitCounter>this.waitMaxSecs)return void this.CloseMsg();if(!this.waitTimerOn)return;this.waitMsgBox=document.getElementById(this.waitMsgBoxID),null==this.waitMsgBox&&(this.waitMsgBox=document.body.appendChild(document.createElement("dialog")),this.waitMsgBox.setAttribute("id",this.waitMsgBoxID));let r=this.waitCounter+1;0==this.waitCounter&&this.waitMsgBox.close(),t?t&&(this.waitMsgBox.innerText=e+` [${r}]`):(0==this.waitCounter?this.waitMsgTemp=e+"\n >":this.waitMsgTemp=this.waitMsgTemp+">",this.waitMsgBox.innerText=this.waitMsgTemp),0==this.waitCounter&&this.waitMsgBox.showModal(),this.waitCounter=r,this.waitTimerID=setTimeout((function(){WaitMsgPopupBox.ShowTimedMsg(e,t)}),1e3)},ShowMsg:function(e,t){this.waitMsgBox=document.getElementById(this.waitMsgBoxID),null==this.waitMsgBox&&(this.waitMsgBox=document.body.appendChild(document.createElement("dialog")),this.waitMsgBox.setAttribute("id",this.waitMsgBoxID)),this.waitMsgBox.close(),this.waitMsgBox.innerText=e,this.waitMsgBox.showModal(),setTimeout((function(){WaitMsgPopupBox.waitMsgBox.close()}),t)}},AlertMsgBox={alertMsgBox:null,alertMsgBoxID:"myAlertMsgPopupBoxID",BuildAlertBox:function(e){let t;const r=e.split("\n");t='
';for(var s=0;s"+r[s]+"

";return t+='
',t},CloseAlert:function(){null!=this.alertMsgBox&&this.alertMsgBox.close()},ShowAlert:function(e){this.alertMsgBox=document.getElementById(this.alertMsgBoxID),null==this.alertMsgBox&&(this.alertMsgBox=document.body.appendChild(document.createElement("dialog")),this.alertMsgBox.setAttribute("id",this.alertMsgBoxID)),this.alertMsgBox.close(),this.alertMsgBox.innerHTML=this.BuildAlertBox(e),this.alertMsgBox.showModal()}};var theButtonBackStyle=null;function SetButtonGenState(e,t,r){t?(document.getElementById(e).disabled=!1,document.getElementById(e).title=r,null!=theButtonBackStyle&&(document.getElementById(e).style.background=theButtonBackStyle)):(0==document.getElementById(e).disabled&&(theButtonBackStyle=document.getElementById(e).style.background),document.getElementById(e).disabled=!0,document.getElementById(e).title=r,document.getElementById(e).style.background="grey")}function SetNTPReadyCheckButtonState(e,t){let r;r=e?NTPReadyCheck.buttonHintMsg:t,SetButtonGenState("btnSaveNTPcheck",e,r)}function Get_NTPReadyCheck_Option(){$.ajax({url:"/ext/scmerlin/NTP_Ready_Config.htm",dataType:"text",error:function(e){document.form.scMerlin_NTPcheck.value="Disable",NTPReadyCheck.prevOptionValue="DISABLED",WaitMsgPopupBox.CloseMsg(),SetNTPReadyCheckButtonState(!0,null),$("#scMerlin_NTPcheck_Status").text("Currently: DISABLED")},success:function(e){let t=e.split("\n");t=t.filter(Boolean);let r,s,a,n,o,i=t.length,l="";for(var c=0;c (a."+sortfield+".toLowerCase() > b."+sortfield+".toLowerCase()) ? 1 : ((b."+sortfield+".toLowerCase() > a."+sortfield+".toLowerCase()) ? -1 : 0));"),window[sortdir]="asc"):(eval(arrayid+" = "+arrayid+".sort((a,b) => (a."+sortfield+".toLowerCase() < b."+sortfield+".toLowerCase()) ? 1 : ((b."+sortfield+".toLowerCase() < a."+sortfield+".toLowerCase()) ? -1 : 0));"),window[sortdir]="desc"):"number"==sorttype&&(-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval(arrayid+" = "+arrayid+".sort((a,b) => parseFloat(getNum(a."+sortfield+'.replace("m","000"))) - parseFloat(getNum(b.'+sortfield+'.replace("m","000"))));'),window[sortdir]="asc"):(eval(arrayid+" = "+arrayid+".sort((a,b) => parseFloat(getNum(b."+sortfield+'.replace("m","000"))) - parseFloat(getNum(a.'+sortfield+'.replace("m","000"))));'),window[sortdir]="desc")),$("#"+tableid).empty(),$("#"+tableid).append(BuildSortTableHtml(tableid)),$("#"+tableid).find(".sortable").each((function(e,t){t.innerHTML==window[sortname]&&("asc"==window[sortdir]?t.innerHTML=window[sortname]+" ↑":t.innerHTML=window[sortname]+" ↓")}))}function getNum(e){if(isNaN(e)){if("*"==e)return-10;if(-1!=e.indexOf("*/"))return-5;if(-1!=e.indexOf("/"))return e.split("/")[0];if("Sun"==e)return 0;if("Mon"==e)return 1;if("Tue"==e)return 2;if("Wed"==e)return 3;if("Thu"==e)return 4;if("Fri"==e)return 5;if("Sat"==e)return 6}return e}function ToggleRefresh(){1==$("#auto_refresh").prop("checked")?get_proclist_file():null!=tmout&&clearTimeout(tmout)}function BuildAddonPageTable(e,t,r){var s="";if(0==r&&(s+='
 
',s+='',s+='',s+='',s+=""),0!=r&&r%4!=0||(s+=""),s+='",r>0&&(r+1)%4==0&&(s+=""),r==sortedAddonPages.length-1){if(sortedAddonPages.length%4!=0){for(var a=4-sortedAddonPages.length%4,n=0;n';s+=""}s+="
WebUI Addons (click to expand/collapse)
'+e+'
'+t.substring(t.lastIndexOf("/")+1)+"
"}return s}function BuildServiceTable(e,t,r,s){var a="";return 0==s&&(a+='
 
',a+='',a+='',a+='',a+=""),0!=s&&s%2!=0||(a+=""),a+=r?'":'",a+='",s>0&&(s+1)%2==0&&(a+=""),s==srvnamelist.length-1&&(a+="
Services (click to expand/collapse)
'+t+' ('+e+")'+t+"',a+='',a+='',a+='',a+='',a+="
"),a}function Build_OpenVPNClient_Table(theIndex){let vpnClientHTML="",vpnClientName="vpnclient"+theIndex,vpnClientDesc=eval("document.form.vpnc"+theIndex+"_desc").value;return 1==theIndex&&(vpnClientHTML+='
 
',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+=""),1!=theIndex&&(theIndex+1)%2!=0||(vpnClientHTML+=""),vpnClientHTML+='",vpnClientHTML+='",5==theIndex&&(vpnClientHTML+=''),theIndex>1&&theIndex%2==0&&(vpnClientHTML+=""),5==theIndex&&(vpnClientHTML+="
OpenVPN Clients (click to expand/collapse)
OpenVPN Client '+theIndex,vpnClientHTML+='
('+vpnClientDesc+")
',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+="
"),vpnClientHTML}function Build_OpenVPNServer_Table(e){let t="",r="vpnserver"+e;return 1==e&&(t+='
 
',t+='',t+='',t+='',t+="",t+=""),t+='",t+='",2==e&&(t+="",t+="
OpenVPN Servers (click to expand/collapse)
OpenVPN Server '+e+"',t+='',t+='',t+='',t+='',t+="
"),t}function Build_WireGuardServer_Table(e){let t="",r="wgServer"+e;return 1==e&&(t+='
 
',t+='',t+='',t+='',t+="",t+=""),t+='",t+='",1==e&&(t+='',t+="
WireGuard Server (click to expand/collapse)
WireGuard Server '+e+"',t+='',t+='',t+='',t+='',t+="
"),t}function Build_WireGuardClient_Table(theIndex){let wgClientHTML="",wgClientName="wgClient"+theIndex,wgClientDesc=eval("document.form.wrgc"+theIndex+"_desc").value;return null!==wgClientDesc&&""!==wgClientDesc||(wgClientDesc="No description"),1==theIndex&&(wgClientHTML+='
 
',wgClientHTML+='',wgClientHTML+='',wgClientHTML+='',wgClientHTML+=""),1!=theIndex&&(theIndex+1)%2!=0||(wgClientHTML+=""),wgClientHTML+='",wgClientHTML+='",5==theIndex&&(wgClientHTML+=''),theIndex>1&&theIndex%2==0&&(wgClientHTML+=""),5==theIndex&&(wgClientHTML+="
WireGuard Clients (click to expand/collapse)
WireGuard Client '+theIndex,wgClientHTML+='
('+wgClientDesc+")
',wgClientHTML+='',wgClientHTML+='',wgClientHTML+='',wgClientHTML+='',wgClientHTML+="
"),wgClientHTML}function round(e,t){return Number(Math.round(e+"e"+t)+"e-"+t)}function Draw_Chart_NoData(e,t){document.getElementById("canvasChart"+e).width="265",document.getElementById("canvasChart"+e).height="250",document.getElementById("canvasChart"+e).style.width="265px",document.getElementById("canvasChart"+e).style.height="250px";var r=document.getElementById("canvasChart"+e).getContext("2d");r.save(),r.textAlign="center",r.textBaseline="middle",r.font="normal normal bolder 22px Arial",r.fillStyle="white",r.fillText(t,135,125),r.restore()}function Draw_Chart(e){var t=[],r=[],s=[],a="",n="";"MemoryUsage"==e?(t=[1*mem_stats_arr[0]-1*mem_stats_arr[1]-1*mem_stats_arr[2]-1*mem_stats_arr[3],mem_stats_arr[1],mem_stats_arr[2],mem_stats_arr[3]],r=["Used","Free","Buffers","Cache"],s=["#5eaec0","#12cf80","#ceca09","#9d12c4"],a="Memory Usage",n="MB"):"SwapUsage"==e?(t=[mem_stats_arr[4],1*mem_stats_arr[5]-1*mem_stats_arr[4]],r=["Used","Free"],s=["#135fee","#1aa658"],a="Swap Usage",n="MB"):"nvramUsage"==e?(t=[round(mem_stats_arr[6]/1024,2).toFixed(2),round(1*nvramtotal-1*mem_stats_arr[6]/1024,2).toFixed(2)],r=["Used","Free"],s=["#5eaec0","#12cf80"],a="NVRAM Usage",n="KB"):"jffsUsage"==e&&(t=[jffs_Used,jffs_Free],r=["Used","Free"],s=["#135fee","#1aa658"],a="JFFS Usage",n="MB");var o=window["Chart"+e];null!=o&&o.destroy();var i=document.getElementById("canvasChart"+e).getContext("2d");o=new Chart(i,{type:"pie",options:{segmentShowStroke:!1,segmentStrokeColor:"#000",maintainAspectRatio:!1,animation:{duration:0},hover:{animationDuration:0},responsiveAnimationDuration:0,legend:{onClick:null,display:!0,position:"left",labels:{fontColor:"#ffffff"}},title:{display:!0,text:a,position:"top"},tooltips:{callbacks:{title:function(e,t){return t.labels[e[0].index]},label:function(e,t){return round(t.datasets[e.datasetIndex].data[e.index],2).toFixed(2)+" "+n}},mode:"point",position:"cursor",intersect:!0},scales:{xAxes:[{display:!1,gridLines:{display:!1},scaleLabel:{display:!1},ticks:{display:!1}}],yAxes:[{display:!1,gridLines:{display:!1},scaleLabel:{display:!1},ticks:{display:!1}}]}},data:{labels:r,datasets:[{data:t,borderWidth:1,backgroundColor:s,borderColor:"#000000"}]}}),window["Chart"+e]=o} +var arrayproclistlines=[],sortnameproc="CPU%",sortdirproc="desc",arraycronjobs=[],sortnamecron="Name",sortdircron="asc",tmout=null;function SetCurrentPage(){document.form.next_page.value=window.location.pathname.substring(1),document.form.current_page.value=window.location.pathname.substring(1)}Chart.defaults.global.defaultFontColor="#CCC",Chart.Tooltip.positioners.cursor=function(e,t){return t};var srvnamelist=["dnsmasq","wan","httpd","wireless","vsftpd","samba","ddns","ntpd/chronyd"],srvdesclist=["DNS/DHCP Server","Internet Connection","Web Interface","WiFi","FTP Server","Samba","DDNS client","Timeserver"],srvnamevisiblelist=[!0,!1,!0,!1,!0,!1,!1,!0],sortedAddonPages=[];function initial(){SetCurrentPage(),LoadCustomSettings(),show_menu(),Draw_Chart_NoData("nvramUsage","Data loading..."),Draw_Chart_NoData("jffsUsage","Data loading..."),Draw_Chart_NoData("MemoryUsage","Data loading..."),Draw_Chart_NoData("SwapUsage","No swap file configured"),$("#sortTableCron").empty(),$("#sortTableCron").append(BuildSortTableHtmlNoData()),$("#sortTableProcesses").empty(),$("#sortTableProcesses").append(BuildSortTableHtmlNoData());let e="",t="";if(isWireGuard_Supported){e+=Build_WireGuardServer_Table(1),$("#table_config").after(e);for(var r=1;r<6;r++)t+=Build_WireGuardClient_Table(r);$("#table_config").after(t)}let s="";for(r=1;r<3;r++)s+=Build_OpenVPNServer_Table(r);$("#table_config").after(s);let a="";for(r=1;r<6;r++)a+=Build_OpenVPNClient_Table(r);$("#table_config").after(a);let n="";for(var o=0;o",'',"Data loading...","","","",'
Data loading...
'}function BuildSortTableHtml(e){var t='';if("sortTableProcesses"==e){t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+='';for(var r=0;r',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+=""}else if("sortTableCron"==e){t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+='',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+='';for(r=0;r',t+="",t+="",t+="",t+="",t+="",t+="",t+="",t+=""}return t+="",t+="
PIDPPIDUSERSTATVSZVSZ%CPUCPU%COMMAND
"+arrayproclistlines[r].PID+""+arrayproclistlines[r].PPID+""+arrayproclistlines[r].USER+""+arrayproclistlines[r].STAT+""+arrayproclistlines[r].VSZ+""+arrayproclistlines[r].VSZP+""+arrayproclistlines[r].CPU+""+arrayproclistlines[r].CPUP+""+arrayproclistlines[r].COMMAND+"
NameMinHourDayMMonthDayWCommand
"+arraycronjobs[r].Name+""+arraycronjobs[r].Min+""+arraycronjobs[r].Hour+""+arraycronjobs[r].DayM+""+arraycronjobs[r].Month+""+arraycronjobs[r].DayW+""+arraycronjobs[r].Command+"
"}function Get_NTPWatchdogEnabled_File(){$.ajax({url:"/ext/scmerlin/watchdogenabled.htm",dataType:"text",error:function(e){document.form.scMerlin_NTPwatchdog.value="Disable",$("#scMerlin_NTPwatchdog_Status").text("Currently: DISABLED")},success:function(e){document.form.scMerlin_NTPwatchdog.value="Enable",$("#scMerlin_NTPwatchdog_Status").text("Currently: ENABLED")}})}function Save_NTPWatchdog(){document.form.action_script.value="start_scmerlin_NTPwatchdog"+document.form.scMerlin_NTPwatchdog.value,document.form.action_wait.value=4,$("#auto_refresh").prop("checked",!1),null!=tmout&&clearTimeout(tmout),showLoading(),document.form.submit(),setTimeout(Get_NTPWatchdogEnabled_File,4e3)}function Get_DNSmasqWatchdogEnabled_File(){$.ajax({url:"/ext/scmerlin/tailtaintdnsenabled.htm",dataType:"text",error:function(e){document.form.scMerlin_DNSmasqWatchdog.value="Disable",$("#scMerlin_DNSmasqWatchdog_Status").text("Currently: DISABLED")},success:function(e){document.form.scMerlin_DNSmasqWatchdog.value="Enable",$("#scMerlin_DNSmasqWatchdog_Status").text("Currently: ENABLED")}})}function Get_WebUIModsEnabled_File(){$.ajax({url:"/ext/scmerlin/webuimodsenabled.htm",dataType:"text",cache:!1,error:function(){document.form.scMerlin_WebUIMods.value="Disable",$("#scMerlin_WebUIMods_Status").text("Currently: DISABLED")},success:function(){document.form.scMerlin_WebUIMods.value="Enable",$("#scMerlin_WebUIMods_Status").text("Currently: ENABLED")}})}function Save_WebUIMods(){$("#auto_refresh").prop("checked",!1),null!=tmout&&clearTimeout(tmout),void 0!==WaitMsgPopupBox&&WaitMsgPopupBox.CloseMsg(),window._scmPauseAjax=!0,document.form.action_script.value="start_scmerlin_WebUIMods"+document.form.scMerlin_WebUIMods.value,document.form.action_wait.value=8,showLoading(),document.form.submit()}function Save_DNSmasqWatchdog(){document.form.action_script.value="start_scmerlin_DNSmasqWatchdog"+document.form.scMerlin_DNSmasqWatchdog.value,document.form.action_wait.value=4,$("#auto_refresh").prop("checked",!1),null!=tmout&&clearTimeout(tmout),showLoading(),document.form.submit(),setTimeout(Get_DNSmasqWatchdogEnabled_File,4e3)}const enableWebUIModsHint="This option handles WebUI modifications to enable or disable the Sitemap page and the pop-up menus on the left-hand-side vertical menu bar. These changes require logging you out of the WebUI to restart the web server.";function ShowHintMsg(e){let t;switch(e.name){case"ENABLE_WEBUI_MODS":t=enableWebUIModsHint;break;default:t="";break}if(t.length>0)return $(e)[0].onmouseout=nd,overlib(t,0,0)}const WaitMsgPopupBox={waitCounter:0,waitMaxSecs:0,waitTimerOn:!1,waitTimerID:null,waitMsgBox:null,waitMsgTemp:"",waitMsgBoxID:"myWaitMsgPopupBoxID",CloseMsg:function(){this.waitTimerOn=!1,this.waitCounter=0,this.waitMaxSecs=0,this.waitMsgTemp="",null!=this.waitTimerID&&(clearTimeout(this.waitTimerID),this.waitTimerID=null),null!=this.waitMsgBox&&this.waitMsgBox.close()},StartMsg:function(e,t,r){this.waitTimerOn||(this.waitTimerOn=!0,this.waitCounter=0,this.waitMsgTemp="",this.waitMaxSecs=Math.round(t/1e3),this.ShowTimedMsg(e,r))},ShowTimedMsg:function(e,t){if(this.waitCounter>this.waitMaxSecs)return void this.CloseMsg();if(!this.waitTimerOn)return;this.waitMsgBox=document.getElementById(this.waitMsgBoxID),null==this.waitMsgBox&&(this.waitMsgBox=document.body.appendChild(document.createElement("dialog")),this.waitMsgBox.setAttribute("id",this.waitMsgBoxID));let r=this.waitCounter+1;0==this.waitCounter&&this.waitMsgBox.close(),t?t&&(this.waitMsgBox.innerText=e+` [${r}]`):(0==this.waitCounter?this.waitMsgTemp=e+"\n >":this.waitMsgTemp=this.waitMsgTemp+">",this.waitMsgBox.innerText=this.waitMsgTemp),0==this.waitCounter&&this.waitMsgBox.showModal(),this.waitCounter=r,this.waitTimerID=setTimeout((function(){WaitMsgPopupBox.ShowTimedMsg(e,t)}),1e3)},ShowMsg:function(e,t){this.waitMsgBox=document.getElementById(this.waitMsgBoxID),null==this.waitMsgBox&&(this.waitMsgBox=document.body.appendChild(document.createElement("dialog")),this.waitMsgBox.setAttribute("id",this.waitMsgBoxID)),this.waitMsgBox.close(),this.waitMsgBox.innerText=e,this.waitMsgBox.showModal(),setTimeout((function(){WaitMsgPopupBox.waitMsgBox.close()}),t)}},AlertMsgBox={alertMsgBox:null,alertMsgBoxID:"myAlertMsgPopupBoxID",BuildAlertBox:function(e){let t;const r=e.split("\n");t='
';for(var s=0;s"+r[s]+"

";return t+='
',t},CloseAlert:function(){null!=this.alertMsgBox&&this.alertMsgBox.close()},ShowAlert:function(e){this.alertMsgBox=document.getElementById(this.alertMsgBoxID),null==this.alertMsgBox&&(this.alertMsgBox=document.body.appendChild(document.createElement("dialog")),this.alertMsgBox.setAttribute("id",this.alertMsgBoxID)),this.alertMsgBox.close(),this.alertMsgBox.innerHTML=this.BuildAlertBox(e),this.alertMsgBox.showModal()}};var theButtonBackStyle=null;function SetButtonGenState(e,t,r){t?(document.getElementById(e).disabled=!1,document.getElementById(e).title=r,null!=theButtonBackStyle&&(document.getElementById(e).style.background=theButtonBackStyle)):(0==document.getElementById(e).disabled&&(theButtonBackStyle=document.getElementById(e).style.background),document.getElementById(e).disabled=!0,document.getElementById(e).title=r,document.getElementById(e).style.background="grey")}function SetNTPReadyCheckButtonState(e,t){let r;r=e?NTPReadyCheck.buttonHintMsg:t,SetButtonGenState("btnSaveNTPcheck",e,r)}function Get_NTPReadyCheck_Option(){$.ajax({url:"/ext/scmerlin/NTP_Ready_Config.htm",dataType:"text",error:function(e){document.form.scMerlin_NTPcheck.value="Disable",NTPReadyCheck.prevOptionValue="DISABLED",WaitMsgPopupBox.CloseMsg(),SetNTPReadyCheckButtonState(!0,null),$("#scMerlin_NTPcheck_Status").text("Currently: DISABLED")},success:function(e){let t=e.split("\n");t=t.filter(Boolean);let r,s,a,n,o,i=t.length,l="";for(var c=0;c (a."+sortfield+".toLowerCase() > b."+sortfield+".toLowerCase()) ? 1 : ((b."+sortfield+".toLowerCase() > a."+sortfield+".toLowerCase()) ? -1 : 0));"),window[sortdir]="asc"):(eval(arrayid+" = "+arrayid+".sort((a,b) => (a."+sortfield+".toLowerCase() < b."+sortfield+".toLowerCase()) ? 1 : ((b."+sortfield+".toLowerCase() < a."+sortfield+".toLowerCase()) ? -1 : 0));"),window[sortdir]="desc"):"number"==sorttype&&(-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval(arrayid+" = "+arrayid+".sort((a,b) => parseFloat(getNum(a."+sortfield+'.replace("m","000"))) - parseFloat(getNum(b.'+sortfield+'.replace("m","000"))));'),window[sortdir]="asc"):(eval(arrayid+" = "+arrayid+".sort((a,b) => parseFloat(getNum(b."+sortfield+'.replace("m","000"))) - parseFloat(getNum(a.'+sortfield+'.replace("m","000"))));'),window[sortdir]="desc")),$("#"+tableid).empty(),$("#"+tableid).append(BuildSortTableHtml(tableid)),$("#"+tableid).find(".sortable").each((function(e,t){t.innerHTML==window[sortname]&&("asc"==window[sortdir]?t.innerHTML=window[sortname]+" ↑":t.innerHTML=window[sortname]+" ↓")}))}function getNum(e){if(isNaN(e)){if("*"==e)return-10;if(-1!=e.indexOf("*/"))return-5;if(-1!=e.indexOf("/"))return e.split("/")[0];if("Sun"==e)return 0;if("Mon"==e)return 1;if("Tue"==e)return 2;if("Wed"==e)return 3;if("Thu"==e)return 4;if("Fri"==e)return 5;if("Sat"==e)return 6}return e}function ToggleRefresh(){1==$("#auto_refresh").prop("checked")?get_proclist_file():null!=tmout&&clearTimeout(tmout)}function BuildAddonPageTable(e,t,r){var s="";if(0==r&&(s+='
 
',s+='',s+='',s+='',s+=""),0!=r&&r%4!=0||(s+=""),s+='",r>0&&(r+1)%4==0&&(s+=""),r==sortedAddonPages.length-1){if(sortedAddonPages.length%4!=0){for(var a=4-sortedAddonPages.length%4,n=0;n';s+=""}s+="
WebUI Addons (click to expand/collapse)
'+e+'
'+t.substring(t.lastIndexOf("/")+1)+"
"}return s}function BuildServiceTable(e,t,r,s){var a="";return 0==s&&(a+='
 
',a+='',a+='',a+='',a+=""),0!=s&&s%2!=0||(a+=""),a+=r?'":'",a+='",s>0&&(s+1)%2==0&&(a+=""),s==srvnamelist.length-1&&(a+="
Services (click to expand/collapse)
'+t+' ('+e+")'+t+"',a+='',a+='',a+='',a+='',a+="
"),a}function Build_OpenVPNClient_Table(theIndex){let vpnClientHTML="",vpnClientName="vpnclient"+theIndex,vpnClientDesc=eval("document.form.vpnc"+theIndex+"_desc").value;return 1==theIndex&&(vpnClientHTML+='
 
',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+=""),1!=theIndex&&(theIndex+1)%2!=0||(vpnClientHTML+=""),vpnClientHTML+='",vpnClientHTML+='",5==theIndex&&(vpnClientHTML+=''),theIndex>1&&theIndex%2==0&&(vpnClientHTML+=""),5==theIndex&&(vpnClientHTML+="
OpenVPN Clients (click to expand/collapse)
OpenVPN Client '+theIndex,vpnClientHTML+='
('+vpnClientDesc+")
',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+='',vpnClientHTML+="
"),vpnClientHTML}function Build_OpenVPNServer_Table(e){let t="",r="vpnserver"+e;return 1==e&&(t+='
 
',t+='',t+='',t+='',t+="",t+=""),t+='",t+='",2==e&&(t+="",t+="
OpenVPN Servers (click to expand/collapse)
OpenVPN Server '+e+"',t+='',t+='',t+='',t+='',t+="
"),t}function Build_WireGuardServer_Table(e){let t="",r="wgServer"+e;return 1==e&&(t+='
 
',t+='',t+='',t+='',t+="",t+=""),t+='",t+='",1==e&&(t+='',t+="
WireGuard Server (click to expand/collapse)
WireGuard Server '+e+"',t+='',t+='',t+='',t+='',t+="
"),t}function Build_WireGuardClient_Table(theIndex){let wgClientHTML="",wgClientName="wgClient"+theIndex,wgClientDesc=eval("document.form.wrgc"+theIndex+"_desc").value;return null!==wgClientDesc&&""!==wgClientDesc||(wgClientDesc="No description"),1==theIndex&&(wgClientHTML+='
 
',wgClientHTML+='',wgClientHTML+='',wgClientHTML+='',wgClientHTML+=""),1!=theIndex&&(theIndex+1)%2!=0||(wgClientHTML+=""),wgClientHTML+='",wgClientHTML+='",5==theIndex&&(wgClientHTML+=''),theIndex>1&&theIndex%2==0&&(wgClientHTML+=""),5==theIndex&&(wgClientHTML+="
WireGuard Clients (click to expand/collapse)
WireGuard Client '+theIndex,wgClientHTML+='
('+wgClientDesc+")
',wgClientHTML+='',wgClientHTML+='',wgClientHTML+='',wgClientHTML+='',wgClientHTML+="
"),wgClientHTML}function round(e,t){return Number(Math.round(e+"e"+t)+"e-"+t)}function Draw_Chart_NoData(e,t){document.getElementById("canvasChart"+e).width="265",document.getElementById("canvasChart"+e).height="250",document.getElementById("canvasChart"+e).style.width="265px",document.getElementById("canvasChart"+e).style.height="250px";var r=document.getElementById("canvasChart"+e).getContext("2d");r.save(),r.textAlign="center",r.textBaseline="middle",r.font="normal normal bolder 22px Arial",r.fillStyle="white",r.fillText(t,135,125),r.restore()}function Draw_Chart(e){var t=[],r=[],s=[],a="",n="";"MemoryUsage"==e?(t=[1*mem_stats_arr[0]-1*mem_stats_arr[1]-1*mem_stats_arr[2]-1*mem_stats_arr[3],mem_stats_arr[1],mem_stats_arr[2],mem_stats_arr[3]],r=["Used","Free","Buffers","Cache"],s=["#5eaec0","#12cf80","#ceca09","#9d12c4"],a="Memory Usage",n="MB"):"SwapUsage"==e?(t=[mem_stats_arr[4],1*mem_stats_arr[5]-1*mem_stats_arr[4]],r=["Used","Free"],s=["#135fee","#1aa658"],a="Swap Usage",n="MB"):"nvramUsage"==e?(t=[round(mem_stats_arr[6]/1024,2).toFixed(2),round(1*nvramtotal-1*mem_stats_arr[6]/1024,2).toFixed(2)],r=["Used","Free"],s=["#5eaec0","#12cf80"],a="NVRAM Usage",n="KB"):"jffsUsage"==e&&(t=[jffs_Used,jffs_Free],r=["Used","Free"],s=["#135fee","#1aa658"],a="JFFS Usage",n="MB");var o=window["Chart"+e];null!=o&&o.destroy();var i=document.getElementById("canvasChart"+e).getContext("2d");o=new Chart(i,{type:"pie",options:{segmentShowStroke:!1,segmentStrokeColor:"#000",maintainAspectRatio:!1,animation:{duration:0},hover:{animationDuration:0},responsiveAnimationDuration:0,legend:{onClick:null,display:!0,position:"left",labels:{fontColor:"#ffffff"}},title:{display:!0,text:a,position:"top"},tooltips:{callbacks:{title:function(e,t){return t.labels[e[0].index]},label:function(e,t){return round(t.datasets[e.datasetIndex].data[e.index],2).toFixed(2)+" "+n}},mode:"point",position:"cursor",intersect:!0},scales:{xAxes:[{display:!1,gridLines:{display:!1},scaleLabel:{display:!1},ticks:{display:!1}}],yAxes:[{display:!1,gridLines:{display:!1},scaleLabel:{display:!1},ticks:{display:!1}}]}},data:{labels:r,datasets:[{data:t,borderWidth:1,backgroundColor:s,borderColor:"#000000"}]}}),window["Chart"+e]=o} diff --git a/scmerlin_www.js b/scmerlin_www.js index eec0155..0c0a989 100644 --- a/scmerlin_www.js +++ b/scmerlin_www.js @@ -431,7 +431,7 @@ function Save_DNSmasqWatchdog() setTimeout(Get_DNSmasqWatchdogEnabled_File, 4000); } -const enableWebUIModsHint = 'This option handles WebUI modifications to enable or disable the Sitemap page and the pop-up menus on the left-hand-side vertical menu bar. These changes requires logging you out of the WebUI to restart the web server.'; +const enableWebUIModsHint = 'This option handles WebUI modifications to enable or disable the Sitemap page and the pop-up menus on the left-hand-side vertical menu bar. These changes require logging you out of the WebUI to restart the web server.'; /**-------------------------------------**/ /** Added by Martinski W. [2026-Mar-15] **/