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

1 line
11 KiB
JavaScript
Raw Normal View History

2022-08-18 21:35:37 +02:00
(function(){var e,t,n,s;(e=class e extends this.OS.GUI.BasicDialog{constructor(){super("ConnectionDialog",e.scheme)}main(){return super.main(),this.find("bbp").data=[{text:"16 bits",value:16,selected:!0},{text:"32 bits",value:32}],this.find("jq").value=40,this.find("bt-ok").onbtclick=e=>{var t;if(this.handle)return t={wvnc:this.find("txtWVNC").value,server:this.find("txtServer").value,bbp:this.find("bbp").selectedItem.data.value,quality:this.find("jq").value},this.handle(t),this.quit()},this.find("bt-cancel").onbtclick=e=>this.quit()}}).scheme='<afx-app-window width=\'350\' height=\'270\'>\n <afx-hbox>\n <div data-width="5"></div>\n <afx-vbox>\n <afx-label text="__(WVNC Websocket)" data-height="25" class="header" ></afx-label>\n <input data-height="25" data-id="txtWVNC" value="wss://app.iohub.dev/wbs/wvnc"></input>\n <afx-label text="__(VNC Server)" data-height="25" class="header" ></afx-label>\n <input data-height="25" data-id="txtServer" value="192.168.1.27:5900"></input>\n <div data-height="5"></div>\n <afx-label text="__(Bits per pixel)" data-height="25" class="header" ></afx-label>\n <afx-list-view dropdown = "true" data-id ="bbp" data-height="25" ></afx-list-view>\n <div data-height="5"></div>\n <afx-label text="__(JPEG quality)" data-height="25" class="header" ></afx-label>\n <afx-slider data-id ="jq" data-height="25" ></afx-slider>\n <afx-hbox data-height = \'30\'>\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 <div data-width="5"></div>\n </afx-hbox>\n </afx-vbox>\n <div data-width="5"></div>\n </afx-hbox>\n</afx-app-window>\n',(t=class e extends this.OS.GUI.BasicDialog{constructor(){super("CredentialDialog",e.scheme)}main(){return this.find("bt-ok").onbtclick=()=>{var e;return this.handle?(e={username:this.find("txtUser").value,password:this.find("txtPass").value},this.handle(e),this.quit()):this.quit()},this.find("bt-cancel").onbtclick=()=>this.quit()}}).scheme='<afx-app-window width=\'350\' height=\'150\'>\n <afx-vbox>\n <afx-label text="__(Username)" data-height="25" class="header" ></afx-label>\n <input data-height="30" data-id="txtUser"></input>\n <afx-label text="__(Password)" data-height="25" class="header" ></afx-label>\n <input type="password" data-height="30" data-id="txtPass"></input>\n <afx-hbox data-height = \'30\'>\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 <div data-width="5"></div>\n </afx-hbox>\n </afx-vbox>\n</afx-app-window>',n=class extends this.OS.application.BaseApplication{constructor(e){super("RemoteDesktop",e)}main(){return this.canvas=this.find("screen"),this.container=this.find("container"),this.client=new s({element:this.canvas}),this.bindKey("CTRL-SHIFT-V",e=>this.pasteText()),this.client.ondisconnect=()=>this.showConnectionDialog(),this.client.onresize=()=>this.setScale(),this.client.onpassword=()=>new Promise((e,t)=>this.openDialog("PromptDialog",{title:__("VNC password"),label:__("VNC password"),value:"password",type:"password"}).then((function(t){return e(t)}))),this.client.oncopy=e=>this._api.setClipboard(e),this.client.oncredential=()=>new Promise((e,n)=>this.openDialog(new t,{title:__("User credential")}).then((function(t){return e(t.username,t.password)}))),this.on("resize",e=>this.setScale()),this.on("focus",e=>$(this.canvas).focus()),this.client.init().then(()=>this.showConnectionDialog())}pasteText(){var e;if(this.client)return e=e=>{if(e&&""!==e)return this.client.sendTextAsClipboard(e)},this._api.getClipboard().then(t=>e(t)).catch(t=>(this.erro