From 95596a5b1666cd14ac40b17566ee88c198a07902 Mon Sep 17 00:00:00 2001 From: jgyates Date: Sun, 1 Oct 2023 13:53:42 -0400 Subject: [PATCH] V1.18.18 --- static/genmon.js | 6 +++--- static/libraries.min.js | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/static/genmon.js b/static/genmon.js index 48a30d7e..33699f23 100644 --- a/static/genmon.js +++ b/static/genmon.js @@ -1896,7 +1896,7 @@ function DisplaySettings(){ return regex.test(value); }, InternationalPhone: function(input, value, arg1, arg2) { - var regex = RegExp('^(\\+(\\d{1,3}))?((\\(\\d{1,4}\\))|(\\d{1,3}))?(\\s|-)?(\\d+(\\s?|-?))+$', 'g'); + var regex = RegExp('^[0-9\-().+\s]{10,20}$', 'g'); return regex.test(value); }, UnixFile: function(input, value, arg1, arg2) { @@ -2279,7 +2279,7 @@ function DisplayAddons(){ return regex.test(value); }, InternationalPhone: function(input, value, arg1, arg2) { - var regex = RegExp('^(\\+(\\d{1,3}))?((\\(\\d{1,4}\\))|(\\d{1,3}))?(\\s|-)?(\\d+(\\s?|-?))+$', 'g'); + var regex = RegExp('^[0-9\-().+\s]{10,20}$', 'g'); return regex.test(value); }, UnixFile: function(input, value, arg1, arg2) { @@ -3110,7 +3110,7 @@ function DisplayAdvancedSettings(){ return regex.test(value); }, InternationalPhone: function(input, value, arg1, arg2) { - var regex = RegExp('^(\\+(\\d{1,3}))?((\\(\\d{1,4}\\))|(\\d{1,3}))?(\\s|-)?(\\d+(\\s?|-?))+$', 'g'); + var regex = RegExp('^[0-9\-().+\s]{10,20}$', 'g'); return regex.test(value); }, UnixFile: function(input, value, arg1, arg2) { diff --git a/static/libraries.min.js b/static/libraries.min.js index ccc9d327..93c036e6 100644 --- a/static/libraries.min.js +++ b/static/libraries.min.js @@ -1725,9 +1725,9 @@ v[x][1]+""+printSettingsField(v[x][0],x,v[x][3],v[x][4],v[x][5],"toggle v[x][4],v[x][5]),1==httpsUsed()&&(G+='
'),G+=""):"usemfa"==x?(G+=' '+v[x][1]+""+printSettingsField(v[x][0],x,v[x][3],v[x][4],v[x][5],"toggleSectionInverse(true, 'usemfa');")+"",G+='
'):"mfa_url"==x?(G+='',QR_Code_URL=v[x][3]):G+='"}G+='
 '+ v[x][1]+'
 '+v[x][1]+""+printSettingsField(v[x][0],x,v[x][3],v[x][4],v[x][5])+"

';$("#mydisplay").html(G);$("input").lc_switch();""!=QR_Code_URL&&$("#qrcode").qrcode({width:164,height:164,text:QR_Code_URL});$.extend($.idealforms.rules,{HTTPAddress:function(O,K, A,w){return/^http[s]?:\/\/(([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},InternetAddress:function(O,K,A,w){return/^((([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))|((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/.*)?))$/g.test(K)},IPAddress:function(O,K,A,w){return/^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/.*)?)|(localhost(\/.*)?))$/g.test(K)}, -InternationalPhone:function(O,K,A,w){return/^(\+(\d{1,3}))?((\(\d{1,4}\))|(\d{1,3}))?(\s|-)?(\d+(\s?|-?))+$/g.test(K)},UnixFile:function(O,K,A,w){return/^(\/[^/]+)+$/g.test(K)},UnixDir:function(O,K,A,w){return/^(\/[^/]+)+\/$/g.test(K)},UnixDevice:function(O,K,A,w){return/^\/dev(\/[^/]+)+$/g.test(K)}});$.extend($.idealforms.errors,{HTTPAddress:"Must be a valid address from an internet server, eg. http://mail.google.com",InternetAddress:"Must be a valid address from an internet server, eg. mail.google.com", -IPAddress:"Must be a valid IP address, eg. 192.168.1.100",InternationalPhone:"Must be a valid Phone Number, eg. +1 123 456 7890",UnixFile:"Must be a valid UNIX file",UnixDir:"Must be a valid UNIX path",UnixDevice:"Must be a valid UNIX file path starting with /dev/"});$("form.idealforms").idealforms({tooltip:".tooltip",silentLoad:!0});usehttpsChange(!1);useSerialTCPChange(!1);useFullTank(!1);toggleSection(!1,"useselfsignedcert");toggleSectionInverse(!1,"usemfa");toggleSectionInverse(!1,"disablesmtp"); -toggleSectionInverse(!1,"disableimap");toggleSectionInverse(!1,"disableweather")}})}function useFullTank(b){"Natural Gas"==$("#fueltype").val()?$("#tanksizeSection").hide(b?300:0):$("#tanksizeSection").show(b?300:0)} +InternationalPhone:function(O,K,A,w){return/^[0-9-().+s]{10,20}$/g.test(K)},UnixFile:function(O,K,A,w){return/^(\/[^/]+)+$/g.test(K)},UnixDir:function(O,K,A,w){return/^(\/[^/]+)+\/$/g.test(K)},UnixDevice:function(O,K,A,w){return/^\/dev(\/[^/]+)+$/g.test(K)}});$.extend($.idealforms.errors,{HTTPAddress:"Must be a valid address from an internet server, eg. http://mail.google.com",InternetAddress:"Must be a valid address from an internet server, eg. mail.google.com",IPAddress:"Must be a valid IP address, eg. 192.168.1.100", +InternationalPhone:"Must be a valid Phone Number, eg. +1 123 456 7890",UnixFile:"Must be a valid UNIX file",UnixDir:"Must be a valid UNIX path",UnixDevice:"Must be a valid UNIX file path starting with /dev/"});$("form.idealforms").idealforms({tooltip:".tooltip",silentLoad:!0});usehttpsChange(!1);useSerialTCPChange(!1);useFullTank(!1);toggleSection(!1,"useselfsignedcert");toggleSectionInverse(!1,"usemfa");toggleSectionInverse(!1,"disablesmtp");toggleSectionInverse(!1,"disableimap");toggleSectionInverse(!1, +"disableweather")}})}function useFullTank(b){"Natural Gas"==$("#fueltype").val()?$("#tanksizeSection").hide(b?300:0):$("#tanksizeSection").show(b?300:0)} function usehttpsChange(b){$("#usehttps").is(":checked")?($("#noneSecuritySettings").hide(b?300:0),$("#usehttpsSection").show(b?300:0),$("#usemfa").is(":checked")&&$("#usemfaSection").show(b?300:0),$("#useselfsignedcert").is(":checked")||$("#useselfsignedcertSettings").show(b?300:0)):($("#usehttpsSection").hide(b?300:0),$("#noneSecuritySettings").show(b?300:0),$("#usemfaSection").hide(b?300:0));$("#http_port").val()==$("#http_port").attr("oldValue")&&$("#usehttps").attr("oldValue")==(!0===$("#usehttps").prop("checked")? "true":"false")?$("#newURLnotify").hide(b?300:0):($("#newURL").html(($("#usehttps").is(":checked")?"https":"http")+"://"+$(location).attr("hostname")+($("#usehttps").is(":checked")||"80"==$("#http_port").val()?"":":"+$("#http_port").val())+$(location).attr("pathname")),$("#newURLnotify").show(b?300:0))} function useSerialTCPChange(b){$("#use_serial_tcp").is(":checked")?($("#serialDirect").hide(b?300:0),$("#serialTCP").show(b?300:0)):($("#serialTCP").hide(b?300:0),$("#serialDirect").show(b?300:0))}function toggleSection(b,v){$("#"+v).is(":checked")?$("#"+v+"Section").hide(b?300:0):$("#"+v+"Section").show(b?300:0)}function toggleSectionInverse(b,v){$("#"+v).is(":checked")?$("#"+v+"Section").show(b?300:0):$("#"+v+"Section").hide(b?300:0)} @@ -1750,9 +1750,9 @@ function DisplayAddons(){var b=baseurl.concat("get_add_on_settings");$.ajax({dat v[K].title+"";x+='
";x+='
';x+='
'+ v[K].description+'

Click for more information
';x+='
';null==v[K].parameters||0==Object.keys(v[K].parameters).length?x+="No settings required for this addon":$.each(Object.keys(v[K].parameters),function(u,t){u=v[K].parameters[t];x+=u.display_name+"
";x+=printSettingsField(u.type,t,u.value,u.description,u.bounds,"changedCard(true, '"+K+"')",parent=K,name=u.display_name)+ '
'});x+="
";x+=" ";x+='

';x+=" ";(O+1)/Object.keys(v).length>B/q&&(x+='',B++)});x+="
";$("#mydisplay").html(x);$("input").lc_switch();$.extend($.idealforms.rules,{HTTPAddress:function(O,K,A,w){return/^http[s]?:\/\/(([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))$/g.test(K)}, -InternetAddress:function(O,K,A,w){return/^(([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},IPAddress:function(O,K,A,w){return/^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},InternationalPhone:function(O,K,A,w){return/^(\+(\d{1,3}))?((\(\d{1,4}\))|(\d{1,3}))?(\s|-)?(\d+(\s?|-?))+$/g.test(K)},UnixFile:function(O,K, -A,w){return/^(\/[^/]+)+$/g.test(K)},UnixDir:function(O,K,A,w){return/^(\/[^/]+)+\/$/g.test(K)},UnixDevice:function(O,K,A,w){return/^\/dev(\/[^/]+)+$/g.test(K)}});$.extend($.idealforms.errors,{HTTPAddress:"Must be a valid address from an internet server, eg. http://mail.google.com",InternetAddress:"Must be a valid address from an internet server, eg. mail.google.com",IPAddress:"Must be a valid IP address, eg. 192.168.1.100",InternationalPhone:"Must be a valid Phone Number, eg. +1 123 456 7890",UnixFile:"Must be a valid UNIX file", -UnixDir:"Must be a valid UNIX path",UnixDevice:"Must be a valid UNIX file path starting with /dev/"});$("form.idealforms").idealforms({tooltip:".tooltip",silentLoad:!0});$.each(Object.keys(v),function(O,K){toggleCard(0,K,v[K].icon);$("#"+K+"_save").hide(0)})}})} +InternetAddress:function(O,K,A,w){return/^(([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},IPAddress:function(O,K,A,w){return/^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},InternationalPhone:function(O,K,A,w){return/^[0-9-().+s]{10,20}$/g.test(K)},UnixFile:function(O,K,A,w){return/^(\/[^/]+)+$/g.test(K)},UnixDir:function(O, +K,A,w){return/^(\/[^/]+)+\/$/g.test(K)},UnixDevice:function(O,K,A,w){return/^\/dev(\/[^/]+)+$/g.test(K)}});$.extend($.idealforms.errors,{HTTPAddress:"Must be a valid address from an internet server, eg. http://mail.google.com",InternetAddress:"Must be a valid address from an internet server, eg. mail.google.com",IPAddress:"Must be a valid IP address, eg. 192.168.1.100",InternationalPhone:"Must be a valid Phone Number, eg. +1 123 456 7890",UnixFile:"Must be a valid UNIX file",UnixDir:"Must be a valid UNIX path", +UnixDevice:"Must be a valid UNIX file path starting with /dev/"});$("form.idealforms").idealforms({tooltip:".tooltip",silentLoad:!0});$.each(Object.keys(v),function(O,K){toggleCard(0,K,v[K].icon);$("#"+K+"_save").hide(0)})}})} function toggleCard(b,v,G){$("#"+v).is(":checked")?($("#"+v+"_bg").animate({backgroundColor:"#ffffff",width:"50px",margin:"7px",padding:"0px",borderTopLeftRadius:0,borderTopRightRadius:0},b?300:0),$("#"+v+"_image").animate({backgroundColor:"#ffffff",width:"50px"},0),$("#"+v+"_title").animate({width:"195px"},0),$("#"+v+"_image").removeClass(G),$("#"+v+"_image").addClass(G+"_small"),$("#"+v+"_overview").hide(b?300:0),$("#"+v+"_settings").show(b?300:0)):($("#"+v+"_bg").animate({backgroundColor:"#e1e1e1", width:"360px",margin:"0px",padding:"10px",borderTopLeftRadius:6,borderTopRightRadius:6},b?300:0),$("#"+v+"_image").animate({backgroundColor:"#e1e1e1",width:"252px"},0),$("#"+v+"_title").animate({width:"265px"},0),$("#"+v+"_image").removeClass(G+"_small"),$("#"+v+"_image").addClass(G),$("#"+v+"_overview").show(b?300:0),$("#"+v+"_settings").hide(b?300:0));changedCard(b,v)} function changedCard(b,v){var G={};$("#"+v+"_form input").each(function(){var q=$(this).attr("oldValue"),B="checkbox"==$(this).attr("type")?!0===$(this).prop("checked")?"true":"false":$(this).val();q!=B&&(G[$(this).attr("name")]=B)});$("#"+v+"_form select").each(function(){var q=$(this).attr("oldValue"),B=$(this).val();q!=B&&(G[$(this).attr("name")]=B)});0 '+v[x][1]+""+printSettingsField(v[x][0],x,v[x][3],v[x][4],v[x][5])+""}G+='
 Restart Genmon Software
 Reboot System
 Shutdown System

'; $("#mydisplay").html(G);$("input").lc_switch();$.extend($.idealforms.rules,{HTTPAddress:function(O,K,A,w){return/^http[s]?:\/\/(([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},InternetAddress:function(O,K,A,w){return/^(([a-z0-9]+([-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(\/.*)?)|(localhost(\/.*)?))$/g.test(K)},IPAddress:function(O,K,A,w){return/^(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\/.*)?)|(localhost(\/.*)?))$/g.test(K)}, -InternationalPhone:function(O,K,A,w){return/^(\+(\d{1,3}))?((\(\d{1,4}\))|(\d{1,3}))?(\s|-)?(\d+(\s?|-?))+$/g.test(K)},UnixFile:function(O,K,A,w){return/^(\/[^/]+)+$/g.test(K)},UnixDir:function(O,K,A,w){return/^(\/[^/]+)+\/$/g.test(K)},UnixDevice:function(O,K,A,w){return/^\/dev(\/[^/]+)+$/g.test(K)}});$.extend($.idealforms.errors,{HTTPAddress:"Must be a valid address from an internet server, eg. http://mail.google.com",InternetAddress:"Must be a valid address from an internet server, eg. mail.google.com", -IPAddress:"Must be a valid IP address, eg. 192.168.1.100",InternationalPhone:"Must be a valid Phone Number, eg. +1 123 456 7890",UnixFile:"Must be a valid UNIX file",UnixDir:"Must be a valid UNIX path",UnixDevice:"Must be a valid UNIX file path starting with /dev/"});$("form.idealforms").idealforms({tooltip:".tooltip",silentLoad:!0})}})} +InternationalPhone:function(O,K,A,w){return/^[0-9-().+s]{10,20}$/g.test(K)},UnixFile:function(O,K,A,w){return/^(\/[^/]+)+$/g.test(K)},UnixDir:function(O,K,A,w){return/^(\/[^/]+)+\/$/g.test(K)},UnixDevice:function(O,K,A,w){return/^\/dev(\/[^/]+)+$/g.test(K)}});$.extend($.idealforms.errors,{HTTPAddress:"Must be a valid address from an internet server, eg. http://mail.google.com",InternetAddress:"Must be a valid address from an internet server, eg. mail.google.com",IPAddress:"Must be a valid IP address, eg. 192.168.1.100", +InternationalPhone:"Must be a valid Phone Number, eg. +1 123 456 7890",UnixFile:"Must be a valid UNIX file",UnixDir:"Must be a valid UNIX path",UnixDevice:"Must be a valid UNIX file path starting with /dev/"});$("form.idealforms").idealforms({tooltip:".tooltip",silentLoad:!0})}})} function saveAdvancedSettings(){var b=!1;vex.dialog.open({unsafeMessage:"Save settings? Are you sure?",overlayClosesOnClick:!1,buttons:[{text:"Cancel",type:"button",className:"vex-dialog-button-secondary",click:function(){b=!1;this.close()}},{text:"OK",type:"submit",className:"vex-dialog-button-primary",click:function(){b=!0}}],onSubmit:function(v){b&&(b=!1,v.preventDefault(),saveAdvancedSettingsJSON(),$(".vex-dialog-message").html("Saving..."),$(".vex-dialog-buttons").html('
'), $(".progress-bar-fill").queue(function(){$(this).css("width","100%")}),setTimeout(function(){vex.closeAll()},1E4))}})} function saveAdvancedSettingsJSON(){try{var b={};$("#formSettings input").each(function(){var G=$(this).attr("oldValue"),q="checkbox"==$(this).attr("type")?!0===$(this).prop("checked")?"true":"false":$(this).val();G!=q&&(b[$(this).attr("name")]=q,$(this).attr("oldValue",q))});$("#formSettings select").each(function(){var G=$(this).attr("oldValue"),q=$(this).val();G!=q&&(b[$(this).attr("name")]=q,$(this).attr("oldValue",q))});jQuery.each(["disablesmtp","disableimap","disableweather"],function(G,q){void 0!=