antosdk-apps/RemoteDesktop/build/debug/main.js

1 line
12 KiB
JavaScript
Raw Permalink Normal View History

(function(){var t,e,n,s;(t=class t extends this.OS.GUI.BasicDialog{constructor(){super("ConnectionDialog",t.scheme)}main(){var t;return super.main(),this.find("bbp").data=[{text:"16 bits",value:16},{text:"32 bits",value:32}],this.find("txtWVNC").value=this.parent.setting.wvnc,this.find("txtServer").value=this.parent.setting.server,t=0,32===this.parent.setting.bbc&&(t=1),this.find("bbp").selected=t,this.find("jq").value=this.parent.setting.quality,this.find("bt-ok").onbtclick=t=>{if(this.handle)return this.parent.setting.wvnc=this.find("txtWVNC").value,this.parent.setting.server=this.find("txtServer").value,this.parent.setting.bbc=this.find("bbp").selectedItem.data.value,this.parent.setting.quality=this.find("jq").value,this.handle(void 0),this.quit()},this.find("bt-cancel").onbtclick=t=>this.quit()}}).scheme='<afx-app-window width=\'350\' height=\'320\'>\n <afx-vbox padding="5">\n <afx-input label="__(WVNC Websocket)" data-height="50" data-id="txtWVNC"></afx-input>\n <afx-input label="__(VNC Server)" data-height="50" data-id="txtServer" ></afx-input>\n <div data-height="5"></div>\n <afx-label text="__(Bits per pixel)" data-height="30" class="header" ></afx-label>\n <afx-list-view dropdown = "true" data-id ="bbp" data-height="35" ></afx-list-view>\n <div data-height="5"></div>\n <afx-label text="__(JPEG quality)" data-height="30" class="header" ></afx-label>\n <afx-slider data-id ="jq" data-height="30" ></afx-slider>\n <div></div>\n <afx-hbox data-height = \'35\'>\n <div style=\' text-align:right;\'>\n <afx-button data-id = "bt-ok" text = "__(Connect)"></afx-button>\n <afx-button data-id = "bt-cancel" text = "__(Cancel)"></afx-button>\n </div>\n </afx-hbox>\n </afx-vbox>\n</afx-app-window>\n',(e=class t extends this.OS.GUI.BasicDialog{constructor(){super("CredentialDialog",t.scheme)}main(){return this.find("bt-ok").onbtclick=()=>{var t;return this.handle?(t={username:this.find("txtUser").value,password:this.find("txtPass").value},this.handle(t),this.quit()):this.quit()},this.find("bt-cancel").onbtclick=()=>this.quit()}}).scheme='<afx-app-window width=\'350\' height=\'170\'>\n <afx-vbox padding="5">\n <afx-input label="__(Username)" data-height="55" data-id="txtUser"></afx-input>\n <afx-input label="__(Password)" data-height="55" type="password" data-id="txtPass"></afx-input>\n <div></div>\n <afx-hbox data-height = \'35\'>\n <div style=\' text-align:right;\'>\n <afx-button data-id = "bt-ok" text = "__(Ok)"></afx-button>\n <afx-button data-id = "bt-cancel" text = "__(Cancel)"></afx-button>\n </div>\n </afx-hbox>\n </afx-vbox>\n</afx-app-window>',n=class extends this.OS.application.BaseApplication{constructor(t){super("RemoteDesktop",t)}main(){var t,n;return this.canvas=this.find("screen"),this.container=this.find("container"),this.zoom=this.find("zoom"),this.btreset=this.find("btreset"),this.zoom.max=200,this.zoom.value=100,this.zoom.onvaluechange=t=>this.setScale(),this.switch=this.find("capture_mouse"),this.switch.onswchange=t=>this.client.mouseCapture=this.switch.swon,n="ws",window.location.protocol.startsWith("https")&&(n+="s"),t=""+window.location.host,window.location.port&&""!==window.location.port&&(t+=":"+window.location.port),this.setting.wvnc||(this.setting.wvnc=`${n}://${t}/wvnc`),this.setting.server||(this.setting.server="127.0.0.1:5900"),this.setting.bbp||(this.setting.bbp=16),this.setting.quality||(this.setting.quality=40),this.btreset.onbtclick=t=>{var e,n,s,i;return i=$(this.container).width(),e=$(this.container).height(),n=i/this.client.resolution.w,s=e/this.client.resolution.h,this.zoom.value=n>s?100*s:100*n,this.setScale()},this.client=new s({element:this.canvas}),this.bindKey("CTRL-SHIFT-V",t=>this.pasteText()),this.client.ondisconnect=()=>this.showConnectionDialog(),this.client.onresize=()=>this.setScale(),this.client.onpassword=()=>new Promise((t,e)=>this.openDialog("PromptDi