From 833251b03d1c79bd0320f3c0588f03acb16a90ee Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Thu, 12 Dec 2019 18:15:22 -0800 Subject: [PATCH] Updated MeshCommander --- public/commander.htm | 85 ++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/public/commander.htm b/public/commander.htm index 7fd615f4..0b1c429c 100644 --- a/public/commander.htm +++ b/public/commander.htm @@ -45,7 +45,7 @@ m.socketParseState){b=-1;if(void 0==m.socketXHeader.connection||"close"!=m.socke if(0>c)break;b=parseInt(m.socketAccumulator.substring(0,c),16);if(isNaN(b)){m.websocket&&m.websocket.close();break}if(m.socketAccumulator.length++m.authcounter?m.challengeParams=m.parseDigest(c["www-authenticate"]):(c=m.pendingAjaxCall.shift(),m.authcounter=0,m.ActiveAjaxCount--, m.gotNextMessages(a,"success",{status:b},c),m.PerformNextAjax()),m.socketParseState=0,m.socketHeader=null)}}}function p(a){0==m.inDataCount&&(m.tlsv1only=1-m.tlsv1only);m.socketState=0;null!=m.socket&&(m.socket.close(),m.socket=null);if(0=m.MaxActiveAjaxCount||0==m.PendingAjax.length)){var a=m.PendingAjax.shift(); -m.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);m.PerformNextAjax()}};m.PerformAjaxEx=function(a,b,c,p,d){if(0!=m.FailAllError)m.gotNextMessagesError({status:m.FailAllError},"error",null,[a,b,c,p,d]);else return a||(a=""),m.ActiveAjaxCount++,m.PerformAjaxExNodeJS(a,b,c,p,d)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(a,b,c,p,d){m.PerformAjaxExNodeJS2(a,b,c,p,d,3)};m.PerformAjaxExNodeJS2=function(a,b,c,p,d,e){0>=e||0!=m.FailAllError?(m.ActiveAjaxCount--,999!=m.FailAllError&&m.gotNextMessages(null, +m.PerformAjaxEx(a[0],a[1],a[2],a[3],a[4]);m.PerformNextAjax()}};m.PerformAjaxEx=function(a,b,c,p,d){if(0!=m.FailAllError)m.gotNextMessagesError({status:m.FailAllError},"error",null,[a,b,c,p,d]);else return a||(a=""),m.ActiveAjaxCount++,m.PerformAjaxExNodeJS(a,b,c,p,d)};m.pendingAjaxCall=[];m.PerformAjaxExNodeJS=function(a,b,c,p,d){m.PerformAjaxExNodeJS2(a,b,c,p,d,5)};m.PerformAjaxExNodeJS2=function(a,b,c,p,d,e){0>=e||0!=m.FailAllError?(m.ActiveAjaxCount--,999!=m.FailAllError&&m.gotNextMessages(null, "error",{status:0==m.FailAllError?408:m.FailAllError},[a,b,c,p,d]),m.PerformNextAjax()):(m.pendingAjaxCall.push([a,b,c,p,d,e]),0==m.socketState?m.xxConnectHttpSocket():2==m.socketState&&m.sendRequest(a,p,d))};m.sendRequest=function(a,b,c){b=b?b:"/wsman";c=c?c:"POST";var p=c+" "+b+" HTTP/1.1\r\n";if(null!=m.challengeParams){m.digestRealm=m.challengeParams.realm;if(m.digestRealmMatch&&m.digestRealm!=m.digestRealmMatch){m.FailAllError=997;m.CancelAllQueries(997);return}c=hex_md5(hex_md5(m.user+":"+m.challengeParams.realm+ ":"+m.pass)+":"+m.challengeParams.nonce+":"+m.noncecounter+":"+m.cnonce+":"+m.challengeParams.qop+":"+hex_md5(c+":"+b));p+="Authorization: "+m.renderDigest({username:m.user,realm:m.challengeParams.realm,nonce:m.challengeParams.nonce,uri:b,qop:m.challengeParams.qop,response:c,nc:m.noncecounter++,cnonce:m.cnonce})+"\r\n"}a=p+="Host: "+m.host+":"+m.port+"\r\nContent-Length: "+a.length+"\r\n\r\n"+a;if(2==m.socketState&&null!=m.socket&&m.socket.readyState==WebSocket.OPEN){b=new Uint8Array(a.length);for(p= 0;p=a&&(b-=a<<1);return b};d.ByteString a)};d.ByteStringBuffer.prototype.setAt=function(a,b){this.data=this.data.substr(0,this.read+a)+String.fromCharCode(b)+this.data.substr(this.read+a+1);return this};d.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)};d.ByteStringBuffer.prototype.copy=function(){var a=d.createBuffer(this.data);a.read=this.read;return a};d.ByteStringBuffer.prototype.compact=function(){0c&&(a+="0");a+=c.toString(16)}return a};d.ByteStringBuffer.prototype.toString=function(){return d.decodeUtf8(this.bytes())};d.DataBuffer=function(a,b){b=b||{};this.read=b.readOffset|| 0;this.growSize=b.growSize||1024;var c=d.isArrayBuffer(a),g=d.isArrayBufferView(a);c||g?(this.data=c?new DataView(a):new DataView(a.buffer,a.byteOffset,a.byteLength),this.write="writeOffset"in b?b.writeOffset:this.data.byteLength):(this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==a&&void 0!==a&&this.putBytes(a),"writeOffset"in b&&(this.write=b.writeOffset))};d.DataBuffer.prototype.length=function(){return this.write-this.read};d.DataBuffer.prototype.isEmpty=function(){return 0>=this.length()}; -d.DataBuffer.prototype.accommodate=function(a,b){if(this.length()>=a)return this;b=Math.max(b||this.growSize,a);var c=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),g=new Uint8Array(this.length()+b);g.set(c);this.data=new DataView(g.buffer);return this};d.DataBuffer.prototype.putByte=function(a){this.accommodate(1);this.data.setUint8(this.write++,a);return this};d.DataBuffer.prototype.fillWithByte=function(a,b){this.accommodate(b);for(var c=0;c=a)return this;b=Math.max(b||this.growSize,a);var c=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),d=new Uint8Array(this.length()+b);d.set(c);this.data=new DataView(d.buffer);return this};d.DataBuffer.prototype.putByte=function(a){this.accommodate(1);this.data.setUint8(this.write++,a);return this};d.DataBuffer.prototype.fillWithByte=function(a,b){this.accommodate(b);for(var c=0;cc&&(a+="0");a+=c.toString(16)}return a};d.DataBuffer.prototype.toString=function(a){var b=new Uint8Array(this.data,this.read,this.length());a=a||"utf8";if("binary"===a||"raw"===a)return d.binary.raw.encode(b);if("hex"===a)return d.binary.hex.encode(b);if("base64"===a)return d.binary.base64.encode(b);if("utf8"===a)return d.text.utf8.decode(b);if("utf16"===a)return d.text.utf16.decode(b);throw Error("Invalid encoding: "+a);};d.createBuffer=function(a,b){void 0!==a&&"utf8"=== -(b||"raw")&&(a=d.encodeUtf8(a));return new d.ByteBuffer(a)};d.fillString=function(a,b){for(var c="";0>>=1,0>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",g="",d,p,e,k=0;k>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0,b)+"\r\n",c=c.substr(b));return g+ -c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,g,d,p,k=0;k>4),64!==d&&(b+=String.fromCharCode((g&15)<<4|d>>2),64!==p&&(b+=String.fromCharCode((d&3)<<6|p)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}}; -d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(a.length));for(var d=c=c||0,p=0;p>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((d&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(g+=c.substr(0, -b)+"\r\n",c=c.substr(b));return g+c};d.binary.base64.decode=function(a,b,c){var g=b;g||(g=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var d,p,k,m,u=0,q=c;u>4,64!==k&&(g[q++]=(p&15)<<4|k>>2,64!==m&&(g[q++]=(k&3)<<6|m));return b?q-c:g.subarray(0,q)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a); -var g=b;g||(g=new Uint8Array(a.length));for(var p=c=c||0,e=0;e>>=1,0>24&255)+String.fromCharCode(a>>16&255)+String.fromCharCode(a>>8&255)+String.fromCharCode(a&255)};var e=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];d.encode64=function(a,b){for(var c="",d="",g,p,e,k=0;k>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((g&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(d+=c.substr(0,b)+"\r\n",c=c.substr(b));return d+ +c};d.decode64=function(a){a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var b="",c,d,g,p,k=0;k>4),64!==g&&(b+=String.fromCharCode((d&15)<<4|g>>2),64!==p&&(b+=String.fromCharCode((g&3)<<6|p)));return b};d.encodeUtf8=function(a){return unescape(encodeURIComponent(a))};d.decodeUtf8=function(a){return decodeURIComponent(escape(a))};d.binary={raw:{},hex:{},base64:{}}; +d.binary.raw.encode=function(a){return String.fromCharCode.apply(null,a)};d.binary.raw.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(a.length));for(var g=c=c||0,p=0;p>2),c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((g&3)<<4|p>>4),isNaN(p)?c+="==":(c+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt((p&15)<<2|e>>6),c+=isNaN(e)?"=":"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(e&63)),b&&c.length>b&&(d+=c.substr(0, +b)+"\r\n",c=c.substr(b));return d+c};d.binary.base64.decode=function(a,b,c){var d=b;d||(d=new Uint8Array(3*Math.ceil(a.length/4)));a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");c=c||0;for(var g,p,k,m,u=0,q=c;u>4,64!==k&&(d[q++]=(p&15)<<4|k>>2,64!==m&&(d[q++]=(k&3)<<6|m));return b?q-c:d.subarray(0,q)};d.text={utf8:{},utf16:{}};d.text.utf8.encode=function(a,b,c){a=d.encodeUtf8(a); +var g=b;g||(g=new Uint8Array(a.length));for(var p=c=c||0,e=0;e");break;case "%":p.push("%");break;default:p.push("<#"+ -c+"?>")}p.push(a.substring(g));return p.join("")};d.formatNumber=function(a,b,c,g){var d=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;g=void 0===g?".":g;c=0>a?"-":"";var p=parseInt(a=Math.abs(+a||0).toFixed(d),10)+"",e=3");break;case "%":p.push("%");break;default:p.push("<#"+ +c+"?>")}p.push(a.substring(d));return p.join("")};d.formatNumber=function(a,b,c,d){var g=isNaN(b=Math.abs(b))?2:b;b=void 0===c?",":c;d=void 0===d?".":d;c=0>a?"-":"";var p=parseInt(a=Math.abs(+a||0).toFixed(g),10)+"",e=3p;++p)if(a[p]&&0!==a[p].length){var e=d.hexToBytes(a[p]);2>e.length&&g.putByte(0);g.putBytes(e)}else g.fillWithByte(0,c),c=0;return g.getBytes()};d.bytesToIP=function(a){return 4===a.length?d.bytesToIPv4(a):16===a.length?d.bytesToIPv6(a):null};d.bytesToIPv4=function(a){if(4!==a.length)return null;for(var b=[],c=0;cc[g].end-c[g].start&&(g=c.length-1)):c.push({start:h,end:h})}b.push(e)}0z.st&&d.std.st&&z.stz.st&&g.stg.st&&z.st>>0),u.fullMessageLength[E]>>>=0,l[0]=l[1]/4294967296>>>0;d.putBytes(e);c(b,v,d);(2048>>0,E+=y,l.putInt32(E>>>0),E=w;w={h0:b.h0,h1:b.h1,h2:b.h2,h3:b.h3,h4:b.h4,h5:b.h5,h6:b.h6,h7:b.h7};c(w,v,l);l=a.util.createBuffer();l.putInt32(w.h0);l.putInt32(w.h1);l.putInt32(w.h2);l.putInt32(w.h3);l.putInt32(w.h4);l.putInt32(w.h5);l.putInt32(w.h6);l.putInt32(w.h7);return l};return u};var e=null,l=!1,n=null}if("function"!==typeof a)if("object"===typeof module&&module.exports){var e=!0;a=function(a,b){b(c,module)}}else return"undefined"===typeof forge&&(forge= {}),b(forge);var l,n=function(a,c){c.exports=function(c){var e=l.map(function(b){return a(b)}).concat(b);c=c||{};c.defined=c.defined||{};if(c.defined.sha256)return c.sha256;c.defined.sha256=!0;for(var m=0;mJ;++J)b[J][0]=d.getInt32()>>>0,b[J][1]=d.getInt32()>>>0;for(;80>J;++J)m=b[J-2],l=m[0],m=m[1],g=((l>>>19|m<<13)^(m>>>29|l<<3)^l>>>6)>>>0,e=((l<<13|m>>>19)^(m<<3|l>>>29)^(l<<26|m>>>6))>>>0,m=b[J-15],l=m[0],m=m[1],p=((l>>>1|m<<31)^(l>>>8|m<<24)^l>>>7)>>>0,h=((l<<31|m>>>1)^(l<<24|m>>>8)^(l<<25|m>>>7))>>>0,l=b[J-7],v=b[J- -16],m=e+l[1]+h+v[1],b[J][0]=g+l[0]+p+v[0]+(m/4294967296>>>0)>>>0,b[J][1]=m>>>0;l=a[0][0];v=a[0][1];q=a[1][0];x=a[1][1];n=a[2][0];T=a[2][1];ba=a[3][0];P=a[3][1];r=a[4][0];B=a[4][1];Z=a[5][0];aa=a[5][1];O=a[6][0];Y=a[6][1];N=a[7][0];H=a[7][1];for(J=0;80>J;++J)g=((r>>>14|B<<18)^(r>>>18|B<<14)^(B>>>9|r<<23))>>>0,m=((r<<18|B>>>14)^(r<<14|B>>>18)^(B<<23|r>>>9))>>>0,e=(O^r&(Z^O))>>>0,A=(Y^B&(aa^Y))>>>0,p=((l>>>28|v<<4)^(v>>>2|l<<30)^(v>>>7|l<<25))>>>0,h=((l<<4|v>>>28)^(v<<30|l>>>2)^(v<<25|l>>>7))>>>0,z= -(l&q|n&(l^q))>>>0,D=(v&x|T&(v^x))>>>0,m=H+m+A+k[J][1]+b[J][1],g=N+g+e+k[J][0]+b[J][0]+(m/4294967296>>>0)>>>0,e=m>>>0,m=h+D,p=p+z+(m/4294967296>>>0)>>>0,h=m>>>0,N=O,H=Y,O=Z,Y=aa,Z=r,aa=B,m=P+e,r=ba+g+(m/4294967296>>>0)>>>0,B=m>>>0,ba=n,P=T,n=q,T=x,q=l,x=v,m=e+h,l=g+p+(m/4294967296>>>0)>>>0,v=m>>>0;m=a[0][1]+v;a[0][0]=a[0][0]+l+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+x;a[1][0]=a[1][0]+q+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+T;a[2][0]=a[2][0]+n+(m/4294967296>>>0)>>>0;a[2][1]=m>>>0;m= +Array.prototype.slice.call(arguments,0))})})();(function(){function b(a){function c(a,b,d){for(var e,g,p,h,m,A,z,D,l,v,q,x,n,T,ba,P,r,B,Z,aa,O,Y,N,H,J,X=d.length();128<=X;){for(J=0;16>J;++J)b[J][0]=d.getInt32()>>>0,b[J][1]=d.getInt32()>>>0;for(;80>J;++J)m=b[J-2],l=m[0],m=m[1],e=((l>>>19|m<<13)^(m>>>29|l<<3)^l>>>6)>>>0,g=((l<<13|m>>>19)^(m<<3|l>>>29)^(l<<26|m>>>6))>>>0,m=b[J-15],l=m[0],m=m[1],p=((l>>>1|m<<31)^(l>>>8|m<<24)^l>>>7)>>>0,h=((l<<31|m>>>1)^(l<<24|m>>>8)^(l<<25|m>>>7))>>>0,l=b[J-7],v=b[J- +16],m=g+l[1]+h+v[1],b[J][0]=e+l[0]+p+v[0]+(m/4294967296>>>0)>>>0,b[J][1]=m>>>0;l=a[0][0];v=a[0][1];q=a[1][0];x=a[1][1];n=a[2][0];T=a[2][1];ba=a[3][0];P=a[3][1];r=a[4][0];B=a[4][1];Z=a[5][0];aa=a[5][1];O=a[6][0];Y=a[6][1];N=a[7][0];H=a[7][1];for(J=0;80>J;++J)e=((r>>>14|B<<18)^(r>>>18|B<<14)^(B>>>9|r<<23))>>>0,m=((r<<18|B>>>14)^(r<<14|B>>>18)^(B<<23|r>>>9))>>>0,g=(O^r&(Z^O))>>>0,A=(Y^B&(aa^Y))>>>0,p=((l>>>28|v<<4)^(v>>>2|l<<30)^(v>>>7|l<<25))>>>0,h=((l<<4|v>>>28)^(v<<30|l>>>2)^(v<<25|l>>>7))>>>0,z= +(l&q|n&(l^q))>>>0,D=(v&x|T&(v^x))>>>0,m=H+m+A+k[J][1]+b[J][1],e=N+e+g+k[J][0]+b[J][0]+(m/4294967296>>>0)>>>0,g=m>>>0,m=h+D,p=p+z+(m/4294967296>>>0)>>>0,h=m>>>0,N=O,H=Y,O=Z,Y=aa,Z=r,aa=B,m=P+g,r=ba+e+(m/4294967296>>>0)>>>0,B=m>>>0,ba=n,P=T,n=q,T=x,q=l,x=v,m=g+h,l=e+p+(m/4294967296>>>0)>>>0,v=m>>>0;m=a[0][1]+v;a[0][0]=a[0][0]+l+(m/4294967296>>>0)>>>0;a[0][1]=m>>>0;m=a[1][1]+x;a[1][0]=a[1][0]+q+(m/4294967296>>>0)>>>0;a[1][1]=m>>>0;m=a[2][1]+T;a[2][0]=a[2][0]+n+(m/4294967296>>>0)>>>0;a[2][1]=m>>>0;m= a[3][1]+P;a[3][0]=a[3][0]+ba+(m/4294967296>>>0)>>>0;a[3][1]=m>>>0;m=a[4][1]+B;a[4][0]=a[4][0]+r+(m/4294967296>>>0)>>>0;a[4][1]=m>>>0;m=a[5][1]+aa;a[5][0]=a[5][0]+Z+(m/4294967296>>>0)>>>0;a[5][1]=m>>>0;m=a[6][1]+Y;a[6][0]=a[6][0]+O+(m/4294967296>>>0)>>>0;a[6][1]=m>>>0;m=a[7][1]+H;a[7][0]=a[7][0]+N+(m/4294967296>>>0)>>>0;a[7][1]=m>>>0;X-=128}}var d=a.sha512=a.sha512||{};a.md=a.md||{};a.md.algorithms=a.md.algorithms||{};a.md.sha512=a.md.algorithms.sha512=d;var e=a.sha384=a.sha512.sha384=a.sha512.sha384|| {};e.create=function(){return d.create("SHA-384")};a.md.sha384=a.md.algorithms.sha384=e;a.sha512.sha256=a.sha512.sha256||{create:function(){return d.create("SHA-512/256")}};a.md["sha512/256"]=a.md.algorithms["sha512/256"]=a.sha512.sha256;a.sha512.sha224=a.sha512.sha224||{create:function(){return d.create("SHA-512/224")}};a.md["sha512/224"]=a.md.algorithms["sha512/224"]=a.sha512.sha224;d.create=function(b){n||(l=String.fromCharCode(128),l+=a.util.fillString(String.fromCharCode(0),128),k=[[1116352408, 3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235], @@ -1150,25 +1150,25 @@ function termToggleFx(){Q(34).value=["Intel (F10 = ESC+[OM)","Alternate (F10 = E function terminalCaptureToggle(b){if(!xxdialogMode)if(void 0==terminal.m.capture)terminal.m.capture="",c3.value="Stop Capture";else{if(0desktopsettings.encoding,desktop.m.showmouse=desktopsettings.showmouse,desktop.m.onScreenSizeChange=center,desktop.m.onKvmData=function(b){var c=null;try{c=JSON.parse(b)}catch(a){}null!=c&&null!=c.action&&("restart"==c.action?(webRtcDesktopReset(), -desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))):"present"==c.action&&null==webRtcDesktop?(webRtcDesktop={platform:c.platform},"undefined"!==typeof RTCPeerConnection?webRtcDesktop.webrtc=new RTCPeerConnection(null):"undefined"!==typeof webkitRTCPeerConnection&&(webRtcDesktop.webrtc=new webkitRTCPeerConnection(null)),webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{}),webRtcDesktop.webchannel.onopen=function(){urlvars&&urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Open"); -Q(42).textContent=StatusStrs[desktop.State]+", Soft-KVM";desktop.m.hold(!0);webRtcDesktop.webRtcActive=!0;webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk",Q(8)),desktop.m);webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation);desktopsettings.quality&&(webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality);desktopsettings.scaling&&(webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling);webRtcDesktop.softdesktop.Start(); -QV("go24",!0);downloadFile=null;p24files=webRtcDesktop.softdesktop;p24targetpath="";webRtcDesktop.softdesktop.onControlMsg=onFilesControlData;webRtcDesktop.softdesktop.sendCtrlMsg(JSON.stringify({action:"ls",reqid:1,path:""}))},webRtcDesktop.webchannel.onclose=function(a){urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Closed");webRtcDesktopReset()},webRtcDesktop.webrtc.onicecandidate=function(a){null==a.candidate?desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp})): -webRtcDesktop.webrtcoffer.sdp+="a="+a.candidate.candidate+"\r\n"},webRtcDesktop.webrtc.oniceconnectionstatechange=function(){null==webRtcDesktop||null==webRtcDesktop.webrtc||"disconnected"!=webRtcDesktop.webrtc.iceConnectionState&&"failed"!=webRtcDesktop.webrtc.iceConnectionState||webRtcDesktopReset()},webRtcDesktop.webrtc.createOffer(function(a){webRtcDesktop.webrtcoffer=a;webRtcDesktop.webrtc.setLocalDescription(a,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:!1, -OfferToReceiveVideo:!1}})):"answer"==c.action&&null!=webRtcDesktop&&webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:c.sdp}),function(){},webRtcDesktopReset))},desktop.m.frameRateDelay=1==desktopsettings.limitFrameRate?200:0,desktop.m.noMouseRotate=desktopsettings.noMouseRotate,desktop.tlsv1only=amtstack.wsman.comm.tlsv1only,desktop.Start(currentMeshNode._id,16994,"*","*",0),PullDesktopDisplayInfo(),urlvars.norefresh||(desktopPollTimer=setInterval(PullDesktopDisplayInfo, -5E3))):(desktop.Stop(),clearInterval(desktopPollTimer),desktopPollTimer=null,PullDesktopDisplayInfo(),webRtcDesktopReset()))}function PullDesktopDisplayInfo(){7desktopsettings.encoding,desktop.m.showmouse=desktopsettings.showmouse,desktop.m.onScreenSizeChange=center,desktop.m.onKvmData=function(b){var a=null;try{a=JSON.parse(b)}catch(d){}null!=a&&null!=a.action&&("restart"==a.action?(webRtcDesktopReset(),desktop.m.sendKvmData(JSON.stringify({action:"present",ver:1}))):"present"==a.action&&null==webRtcDesktop?(webRtcDesktop={platform:a.platform},"undefined"!==typeof RTCPeerConnection?webRtcDesktop.webrtc=new RTCPeerConnection(null): +"undefined"!==typeof webkitRTCPeerConnection&&(webRtcDesktop.webrtc=new webkitRTCPeerConnection(null)),webRtcDesktop.webchannel=webRtcDesktop.webrtc.createDataChannel("DataChannel",{}),webRtcDesktop.webchannel.onopen=function(){urlvars&&urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Open");Q(42).textContent=StatusStrs[desktop.State]+", Soft-KVM";desktop.m.hold(!0);webRtcDesktop.webRtcActive=!0;webRtcDesktop.softdesktop=CreateKvmDataChannel(webRtcDesktop.webchannel,CreateAgentRemoteDesktop("Desk", +Q(8)),desktop.m);webRtcDesktop.softdesktop.m.setRotation(desktop.m.rotation);desktopsettings.quality&&(webRtcDesktop.softdesktop.m.CompressionLevel=desktopsettings.quality);desktopsettings.scaling&&(webRtcDesktop.softdesktop.m.ScalingLevel=desktopsettings.scaling);webRtcDesktop.softdesktop.Start();QV("go24",!0);downloadFile=null;p24files=webRtcDesktop.softdesktop;p24targetpath="";webRtcDesktop.softdesktop.onControlMsg=onFilesControlData;webRtcDesktop.softdesktop.sendCtrlMsg(JSON.stringify({action:"ls", +reqid:1,path:""}))},webRtcDesktop.webchannel.onclose=function(a){urlvars.kvmdatatrace&&console.log("WebRTC Data Channel Closed");webRtcDesktopReset()},webRtcDesktop.webrtc.onicecandidate=function(a){null==a.candidate?desktop.m.sendKvmData(JSON.stringify({action:"offer",ver:1,sdp:webRtcDesktop.webrtcoffer.sdp})):webRtcDesktop.webrtcoffer.sdp+="a="+a.candidate.candidate+"\r\n"},webRtcDesktop.webrtc.oniceconnectionstatechange=function(){null==webRtcDesktop||null==webRtcDesktop.webrtc||"disconnected"!= +webRtcDesktop.webrtc.iceConnectionState&&"failed"!=webRtcDesktop.webrtc.iceConnectionState||webRtcDesktopReset()},webRtcDesktop.webrtc.createOffer(function(a){webRtcDesktop.webrtcoffer=a;webRtcDesktop.webrtc.setLocalDescription(a,function(){},webRtcDesktopReset)},webRtcDesktopReset,{mandatory:{OfferToReceiveAudio:!1,OfferToReceiveVideo:!1}})):"answer"==a.action&&null!=webRtcDesktop&&webRtcDesktop.webrtc.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:a.sdp}),function(){},webRtcDesktopReset))}, +desktop.m.frameRateDelay=1==desktopsettings.limitFrameRate?200:0,desktop.m.noMouseRotate=desktopsettings.noMouseRotate,desktop.tlsv1only=amtstack.wsman.comm.tlsv1only,desktop.Start(currentMeshNode._id,16994,"*","*",0),PullDesktopDisplayInfo(),urlvars.norefresh||(desktopPollTimer=setInterval(PullDesktopDisplayInfo,5E3))):(desktop.Stop(),clearInterval(desktopPollTimer),desktopPollTimer=null,PullDesktopDisplayInfo(),webRtcDesktopReset()))} +function PullDesktopDisplayInfo(){7a;a++)1==desktopScreenInfo.IsActive[a]&&(c++,b+=' ');1Enter text and click OK to remotely type it using a US english keyboard. Make sure to place the remote cursor at the correct position before proceeding.
'),Q("d2typeText").focus())} +function deskToggleFull(b){xxdialogMode||(1==fullscreenonly?(console.log("deskToggleFull1",fullscreenonly,urlvars.kvmonly),fullscreenonly=!1,1==urlvars.kvmonly?console.log("deskToggleFull2"):disconnect()):(fullscreenonly=b,fullscreen=!fullscreen,QV(7,!fullscreen),QV(37,!fullscreen),QV("c5",!fullscreen),QV("c9",fullscreen),fullscreen?(QS(8).left=0,QS(16).padding=0):(QS(8).left="156px",QS(16).padding= +"8px"),center()))}function deskShowTypeDialog(){xxdialogMode||3!=desktop.State||(Q(46).blur(),setDialogMode(11,"Remote Keyboard Entry",3,showDeskTypeEx,'
Enter text and click OK to remotely type it using a US english keyboard. Make sure to place the remote cursor at the correct position before proceeding.
'),Q("d2typeText").focus())} var AmtDeskTypeTimer=null,AmtDeskTypeContent=null,DeskTypeTranslate={39:222,42:106,43:107,44:188,45:189,46:190,47:191,59:186,61:187,91:219,92:220,93:221,96:192,191:111},DeskTypeShiftTranslate={33:49,34:222,35:51,36:52,37:53,38:55,40:57,41:48,58:186,60:188,62:190,63:191,64:50,94:54,95:189,106:56,107:187,123:219,124:220,125:221,126:192}; function showDeskTypeEx(){var b=Q("d2typeText").value;Q("d2typeText").value.toUpperCase();var c=[],a;for(a in b){var d=b.charCodeAt(a);c.push([d,1],[d,0])}AmtDeskTypeContent=c;AmtDeskTypeTimer=setInterval(function(){var a=AmtDeskTypeContent.shift();desktop&&desktop.m.sendkey(a[0],a[1]);if(null==desktop||0==AmtDeskTypeContent.length)clearInterval(AmtDeskTypeTimer),AmtDeskTypeContent=null},10)}function sendCAD(){Q(50).checked||desktop.m.sendcad()} var deskkeysset={0:[[65511,1],[65511,0]],1:[[65511,1],[65364,1],[65364,0],[65511,0]],2:[[65511,1],[65362,1],[65362,0],[65511,0]],3:[[65511,1],[108,1],[108,0],[65511,0]],4:[[65511,1],[109,1],[109,0],[65511,0]],5:[[65505,1],[65511,1],[109,1],[109,0],[65511,0],[65505,0]],6:[[65470,1],[65470,0]],7:[[65471,1],[65471,0]],8:[[65472,1],[65472,0]],9:[[65473,1],[65473,0]],10:[[65474,1],[65474,0]],11:[[65475,1],[65475,0]],12:[[65476,1],[65476,0]],13:[[65477,1],[65477,0]],14:[[65478,1],[65478,0]],15:[[65479, @@ -1177,7 +1177,7 @@ function deskSendKeys(){if(!Q(50).checked){var b=Q("deskkeys").value;if(null!=b& function deskSaveImage(){if(!xxdialogMode&&3==desktop.State){var b="Desktop",c=new Date;amtsysstate&&(b+="-"+amtsysstate.AMT_GeneralSettings.response.HostName);b+="-"+c.getFullYear()+"-"+("0"+(c.getMonth()+1)).slice(-2)+"-"+("0"+c.getDate()).slice(-2)+"-"+("0"+c.getHours()).slice(-2)+"-"+("0"+c.getMinutes()).slice(-2);Q("Desk").toBlob(function(a){saveAs(a,b+".jpg")})}} function dmousedown(b){xxdialogMode||Q(50).checked||(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousedown(b),desktop.m.sendKeepAlive()):desktop.m.mousedown(b))}function dmouseup(b){xxdialogMode||Q(50).checked||(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mouseup(b),desktop.m.sendKeepAlive()):desktop.m.mouseup(b))} function dmousemove(b){xxdialogMode||Q(50).checked||(null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop?(webRtcDesktop.softdesktop.m.mousemove(b),desktop.m.sendKeepAlive()):desktop.m.mousemove(b))}function dmousewheel(b){xxdialogMode||Q(50).checked||null==webRtcDesktop||null==webRtcDesktop.softdesktop||(webRtcDesktop.softdesktop.m.mousewheel(b),desktop.m.sendKeepAlive())} -function drotate(b){b=desktop.m.rotation+b;desktop.m.setRotation(b);null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop&&null!=webRtcDesktop.softdesktop.m&&webRtcDesktop.softdesktop.m.setRotation(b);center()}var p24files=null,p24filetree=null,p24targetpath=null,p24filetreelocation=[]; +function drotate(b){xxdialogMode||(b=desktop.m.rotation+b,desktop.m.setRotation(b),null!=webRtcDesktop&&null!=webRtcDesktop.softdesktop&&null!=webRtcDesktop.softdesktop.m&&webRtcDesktop.softdesktop.m.setRotation(b),center())}var p24files=null,p24filetree=null,p24targetpath=null,p24filetreelocation=[]; function onFilesControlData(b){if(0"+p24filetreelocation[l]+"";var e=p24filetreelocation.join("/"),n=p24sort_files(p24filetree.dir);for(l in n){var r=n[l],p=r.n,m;m=70'+EscapeHtml(p.substring(0, @@ -1210,8 +1210,8 @@ function p24uploadNextFile(){uploadFile.xfilePtr++;if(uploadFile.xfiles.length>u uploadFile.xreader.onerror=function(){p24uploadNextFile()};uploadFile.xreader.readAsArrayBuffer(b)}else p24uploadFileCancel(),p24folderup(9999)}function p24uploadFileCancel(b,c){null!=uploadFile&&(uploadFile=null,setDialogMode(0),99==c&&null!=p24files&&p24files.sendCtrlMsg(JSON.stringify({action:"upload",sub:"cancel"})))} function p24gotUploadData(b){if(null!=uploadFile&&parseInt(uploadFile.xfilePtr)==parseInt(b.reqid))if("start"==b.sub)for(p24uploadNextPart(!1),b=0;8>b;b++)p24uploadNextPart(!0);else"ack"==b.sub?p24uploadNextPart(!1):"error"==b.sub&&p24uploadFileCancel()}function ab2str(b){return String.fromCharCode.apply(null,new Uint8Array(b))} function p24uploadNextPart(b){var c=uploadFile.xdata,a=uploadFile.xptr,d=uploadFile.xptr+4096;if(d>c.byteLength){if(1==b)return;d=c.byteLength}a==c.byteLength?p24uploadNextFile():(p24files.sendCtrlMsg(btoa(IntToStr(d!=c.byteLength?16777216:16777217)+ab2str(c.slice(a,d)))),uploadFile.xptr=d,Q("d2progressBar").value=d)}var ider,iderCodeBlock,iderTimer; -function iderStart(b){b='
Mount disk images on a Intel® AMT computer - Experimental.

Floppy (.img)
CDROM (.iso)
';b+="
Session Start
"; -setDialogMode(11,"Storage Redirection",3,iderStart2,b);if(b=localStorage.getItem("iderurl"))Q("storageserverurl").value=b.substring(1,b.length-1)} +function iderStart(b){!xxdialogMode&&(b='
Mount disk images on a Intel® AMT computer - Experimental.

Floppy (.img)
CDROM (.iso)
',b+="
Session Start
", +setDialogMode(11,"Storage Redirection",3,iderStart2,b),b=localStorage.getItem("iderurl"))&&(Q("storageserverurl").value=b.substring(1,b.length-1))} function iderStart2(){if(1!=Q("floppyImageInput").files.length&&1!=Q("cdromImageInput").files.length)messagebox("Storage Redirection Error","At least one disk image file must be selected.");else if(1==Q("floppyImageInput").files.length&&0!=Q("floppyImageInput").files[0].size%512)messagebox("Storage Redirection Error","Invalid .img file.");else if(1==Q("cdromImageInput").files.length&&0!=Q("cdromImageInput").files[0].size%2048)messagebox("Storage Redirection Error","Invalid .iso file.");else{var b= null,c=null;1==Q("floppyImageInput").files.length&&(b=Q("floppyImageInput").files[0]);1==Q("cdromImageInput").files.length&&(c=Q("cdromImageInput").files[0]);null==b&&null==c||iderStart3(b,c,Q("iderStartType").value)}} function iderStart3(b,c,a){iderStop();ider=CreateAmtRedirect(CreateAmtRemoteIder());ider.onStateChanged=onIderStateChange;ider.m.floppy=b;ider.m.cdrom=c;ider.m.iderStart=a;ider.m.sectorStats=iderSectorStats;ider.tlsv1only=amtstack.wsman.comm.tlsv1only;ider.Start(currentMeshNode._id,16994,"*","*",0);QV("IDERDiskMapButton",!0)} @@ -1220,7 +1220,7 @@ function onIderTimer(){ider.m.Update&&ider.m.Update();-1==ider.m.bytesFromAmt?id function iderSectorStats(b,c,a,d,e){var l=c?Q("cdromHeatMapCanvas"):Q("floppyHeatMapCanvas"),n=l.getContext("2d");if(0==b){heatMapDividor[c]=1;if(0CDROM, blocks are {0} bytes.",2048*heatMapDividor[c]))):(QV("floppyHeatMap",a),QH("floppyHeatMapText",format("Floppy, blocks are {0} bytes.",512*heatMapDividor[c])))}c=heatMapDividor[c];a/=c;d/=c;e/=c;if(0==b)l.height=6*(Math.floor(a/ (heatMapWidth/6))+(a%heatMapWidth?1:0)),n.fillStyle="rgba(225,250,225,1)",n.fillRect(0,0,heatMapWidth,6*Math.floor(a/(heatMapWidth/6))),a%heatMapWidth&&n.fillRect(0,6*Math.floor(a/(heatMapWidth/6)),a%(heatMapWidth/6)*6,6),n.fillStyle="rgba(0,0,0,0.3)";else for(b=d;bb,a.BootMediaIndex=0,a.FirmwareVerbosity=0,a.ForcedProgressEvents=!1,a.IDERBootDevice=202==b||203==b?1:0,a.LockKeyboard=!1,a.LockPowerButton=!1,a.LockResetButton=!1,a.LockSleepButton=!1,a.ReflashBIOS=!1,a.UseIDER=199b,a.UseSOL=13==currentView&&8!=b&&300>b,a.UseSafeMode=!1,a.UserPasswordBypass=!1,null!=a.SecureErase&&(a.SecureErase=(104==b||105==b)&&1==amtPowerBootCapabilities.SecureErase,!0===a.SecureErase&&0