Tenda-v1.0 Copy Copiato!
javascript:ftb();function getStatus(){boxcar=gw/(gt+1),rnd=Math.floor(1e9*Math.random()),cmd="?rand="+rnd+"&modules=wanCfg,systemCfg,lanCfg,wifiBasicCfg,onlineList,workMode,onlineUpgrade,simWan,simInfo,simStatus,meshCfg,meshStatus,onlineListNum}",url="/goform/getModules",xhr=new XMLHttpRequest,xhr.open("GET",url+cmd,!0),xhr.setRequestHeader("Content-type","application/json; charset=UTF-8"),xhr.send(),xhr.onload=function(){if(200===xhr.status)for(signal=JSON.parse(xhr.responseText),s=signal.simInfo,nr5rsrp=s.ss_rsrp,nr5rsrq=s.ss_rsrq,nr5sinr=s.ss_sinr,rsrp=s.rsrp,rsrq=s.rsrq,sinr=s.sinr,enbid=s.enode_id,cell_id=s.cell_id,bands=s.accessBand,cqi=s.cqi,barGraph("rsrp",rsrp,-130,-60),barGraph("rsrq",rsrq,-16,-3),barGraph("sinr",sinr,0,24),nr="undefined"!=typeof nr5rsrp,nr?(barGraph("nr5rsrp",nr5rsrp,-130,-60),barGraph("nr5rsrq",nr5rsrq,-16,-3),barGraph("nr5sinr",nr5sinr,0,24),document.getElementById("nr").style.display="inline-block"):document.getElementById("nr").style.display="none",acctech=signal.simWan.connectType,plmn=s.imsi.substring(0,5),"22201"==plmn&&(plmn="2221"),"22299"==plmn&&(plmn="22288"),"22250"==plmn&&6==enbid.length&&(plmn="22288"),link_lte="https://lteitaly.it/internal/map.php#bts="+plmn+"."+enbid,document.getElementById("lteitaly").setAttribute("href",link_lte),dervars=["cell_id","sinr","rsrp","rsrq","nr5sinr","nr5rsrp","nr5rsrq","enbid","acctech","bands","cqi"],i=0;i<dervars.length;i++)document.getElementById(dervars[i]).innerHTML=window[dervars[i]];else err("Communication Err")}}function err(txt){txt="Houston we have a problem:\n\n"+txt,alert(txt)}function raw(cmd){console.log(cmd),url="/goform/setModules",xhr=new XMLHttpRequest,xhr.open("POST",url,!0),xhr.setRequestHeader("Content-type","application/json; charset=UTF-8"),xhr.send(cmd),xhr.onload=function(){200===xhr.status&&('{"errCode":"0"}'!=xhr.responseText&&err("Router response not positive"),console.log(xhr.responseText))}}function doTheMagic(b4g,b5g){cmd='{"simSupportBand":{"band4g":'+b4g+',"band5g":'+b5g+',"bandType":0}}',console.log(cmd),url="/goform/setModules",xhr=new XMLHttpRequest,xhr.open("POST",url,!0),xhr.setRequestHeader("Content-type","application/json; charset=UTF-8"),xhr.send(cmd),xhr.onload=function(){200===xhr.status&&('{"errCode":"0"}'!=xhr.responseText&&err("Router response not positive"),console.log(xhr.responseText))}}function changeNrBands(){var band;if(0==arguments.length){if(msg="Please input NR bands number, separated by + char (example 3+78).If you want to use every supported bands, write 'AUTO'.",null==(band=prompt(msg,"AUTO"))||""===band)return}else var band=arguments[0];var bs=band.replaceAll("+",",");"AUTO"===band.toUpperCase()&&(bs=[1,3,5,7,8,20,28,38,40,77,78]),doTheMagic("[]",bs="["+bs+"]")}function changeLteBands(){var band;if(0==arguments.length){if(msg="Please input LTE bands number, separated by + char (example 1+3+20).If you want to use every supported bands, write 'AUTO'.",null==(band=prompt(msg,"AUTO"))||""===band)return}else var band=arguments[0];var bs=band.replaceAll("+",",");"AUTO"===band.toUpperCase()&&(bs=[1,3,5,7,8,20,28,32,38,40,42]),doTheMagic(bs="["+bs+"]","[-1]")}function barGraph(p,val,min,max){for(val>max&&(val=max),val<min&&(val=min),ap="a"+p,window[ap].unshift(val),window[ap].length>boxcar&&window[ap].pop(),html='<svg version="1.1" viewBox="0 0 '+gw+" "+gh+'" width="'+gw+'" height="'+gh+'" preserveAspectRatio="xMaxYMax slice" style="border:1px solid #ccc;padding:1px;margin-top:-6px;width: '+gw+'px;">',x=0;x<window[ap].length;x++)pax=(gt+1)*(x+1),pay=gh-1,pby=gh-(window[ap][x]-min)/(max-min)*gh,isNaN(pby)&&(pby=pay),pc=(window[ap][x]-min)/(max-min)*100,pc<50?color="yellow":pc<85?color="green":color="orange",html+='<line x1="'+pax+'" y1="'+pay+'" x2="'+pax+'" y2="'+pby+'" stroke="'+color+'" stroke-width="'+gt+'"></line>';html+="</svg>",document.getElementById("b"+p).innerHTML=html}function ftb(){document.body.insertAdjacentHTML("afterbegin",'<style>.clear{clear:both}.action{background-color:#448;padding:10px;border-radius:10px;color:#fff;font-weight:bolder;margin-right:5px;margin-left:5px}.action:hover{color:#fff}#cell_id,#bands,#enbid,#nr5rsrp,#nr5rsrq,#nr5rssi,#nr5sinr,#rsrp,#rsrq,#rssi,#sinr,#acctech,#cqi{color:#b00;}.f{float:left;border:1px solid #bbb;border-radius:5px;padding:10px;line-height:2em;margin:5px}.f ul{margin:0;padding:0}.f ul li{display:inline;margin-right:5px;margin-left:5px}#enbid{font-weight:700;text-decoration:underline}.p{border-bottom:1px solid #ccc;width:auto;height:20px}.v{height:100%25;border-right:1px solid #ccc;padding-left:20px}</style><div style="display:block;overflow:auto;font-family:Verdana;"><div class="f">RSRP:<span id="rsrp"></span>dBm<div id="brsrp"></div>RSRQ:<span id="rsrq"></span>dB<div id="brsrq"></div>SINR:<span id="sinr"></span>dB<div id="bsinr"></div></div><div id="nr" class="f">NR RSRP:<span id="nr5rsrp"></span>dBm<div id="bnr5rsrp"></div>NR RSRQ:<span id="nr5rsrq"></span>dB<div id="bnr5rsrq"></div>NR SINR:<span id="nr5sinr"></span>dB<div id="bnr5sinr"></div></div><div class="f"><ul><li id="acctech">Che la banda sia con te! Miononno ♥</li></ul></div><div class="f"><ul><li>CQI:<span id="cqi"></li></ul></div><div class="f"><ul><li>ENB ID:<a id="lteitaly" target="lteitaly" href="#"><span id="enbid">#</span></a></li><li>CELL ID:<span id="cell_id">#</span></li></ul></div><div class="f"><ul><li><a class="action" onclick="changeLteBands()">4G</a></li><li><a class="action" style="text-decoration: line-through;" onclick="changeNrBands()">NR</a></li><li>BANDS:<span id="bands"></span></li></ul></div></div>')}gw=500,gh=30,gt=3,signal="",version="Tenda 5G03-v1.0",[arsrp,arsrq,asinr,anr5rsrp,anr5rsrq,anr5sinr]=[[],[],[],[],[],[]],window.setInterval(getStatus,2e3),console.log("Code by Miononno - "+version),console.log("type: signal");