update remoteDesktop

This commit is contained in:
lxsang
2020-12-29 19:36:35 +00:00
parent b31cd4302d
commit 0a6f8c0f8c
23 changed files with 757 additions and 34 deletions

View File

@@ -5,11 +5,8 @@ A web based VNC client allowing to control remote VNC desktop from browser. The
Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blog.lxsang.me/post/id/23)
**Credit**
* antd-wvnc-plugin: [https://github.com/lxsang/antd-wvnc-plugin](https://github.com/lxsang/antd-wvnc-plugin)
* wvnc.js: [https://github.com/lxsang/wvnc.js](https://github.com/lxsang/wvnc.js)
*
## Change logs
* v0.1.5 - add package dependencies and use the new **libwvnc**
* v0.1.0 - adapt to the new AntOS API

View File

@@ -5,11 +5,8 @@ A web based VNC client allowing to control remote VNC desktop from browser. The
Further information on **wvnc**: [https://blog.lxsang.me/post/id/23](https://blog.lxsang.me/post/id/23)
**Credit**
* antd-wvnc-plugin: [https://github.com/lxsang/antd-wvnc-plugin](https://github.com/lxsang/antd-wvnc-plugin)
* wvnc.js: [https://github.com/lxsang/wvnc.js](https://github.com/lxsang/wvnc.js)
*
## Change logs
* v0.1.5 - add package dependencies and use the new **libwvnc**
* v0.1.0 - adapt to the new AntOS API

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,8 @@
"author": "",
"email": ""
},
"version":"0.1.0-a",
"version":"0.1.5-a",
"dependencies": ["libwvnc@0.1.2-a"],
"category":"Other",
"icon": "icon.png",
"mimes":["none"]

View File

@@ -6,14 +6,12 @@ class ConnectionDialog extends this.OS.GUI.BasicDialog
main: () ->
super.main()
@find("bbp").data = [
{ text: "16 bits", value: 16, selected: true },
{ text: "16 bits", value: 16, selected: true },
{ text: "32 bits", value: 32 }
]
@find("compression").data = [
{text: "No compression", value:0},
{text: "JPEG", value:1},
{text: "zLib", value:2},
{text: "JPEG & zLib", value:3, selected:true}
{text: "JPEG", value:1, selected: true}
]
@find("jq").value = 40
@find("bt-ok").onbtclick = (e) =>
@@ -38,7 +36,7 @@ ConnectionDialog.scheme = """
<afx-label text="__(WVNC Websocket)" data-height="25" class="header" ></afx-label>
<input data-height="25" data-id="txtWVNC" value="wss://localhost/wvnc"></input>
<afx-label text="__(VNC Server)" data-height="25" class="header" ></afx-label>
<input data-height="25" data-id="txtServer" value="192.168.1.10:5900"></input>
<input data-height="25" data-id="txtServer" value="192.168.1.27:5901"></input>
<div data-height="5"></div>
<afx-label text="__(Bits per pixel)" data-height="25" class="header" ></afx-label>
<afx-list-view dropdown = "true" data-id ="bbp" data-height="25" ></afx-list-view>
@@ -106,7 +104,7 @@ class RemoteDesktop extends this.OS.application.BaseApplication
@container = @find "container"
@client = new WVNC {
element: @canvas,
worker: "#{@_api.handle.get}/#{@meta().path}/decoder.js"
libjpeg: "pkg://libjpeg/jpg.js".asFileHandle().getlink()
}
@client.onerror = (m) =>
@error m
@@ -118,7 +116,7 @@ class RemoteDesktop extends this.OS.application.BaseApplication
@openDialog "PromptDialog", {
title: __("VNC password"),
label: __("VNC password"),
value: "!x$@n9ph",
value: "password",
type: "password"
}
.then (d) ->
@@ -156,7 +154,7 @@ class RemoteDesktop extends this.OS.application.BaseApplication
]
actionConnection: (e) ->
@client.disconnect() if @client
@client.disconnect(false) if @client
@showConnectionDialog()
showConnectionDialog: () ->
@@ -164,11 +162,12 @@ class RemoteDesktop extends this.OS.application.BaseApplication
@openDialog new ConnectionDialog, { title: __("Connection")}
.then (d) =>
@client.ws = d.wvnc
console.log d
@client.connect d.server, d
cleanup: () ->
@client.disconnect() if @client
@client.disconnect(true) if @client
RemoteDesktop.dependencies = [
"pkg://libwvnc/main.js"
]
this.OS.register "RemoteDesktop", RemoteDesktop

View File

@@ -1 +0,0 @@
var api,onmessage,resolution,wasm_update;importScripts("wvnc_asm.js"),api={},resolution=void 0,Module.onRuntimeInitialized=function(){return api={createBuffer:Module.cwrap("create_buffer","number",["number","number"]),destroyBuffer:Module.cwrap("destroy_buffer","",["number"]),updateBuffer:Module.cwrap("update","number",["number","number","number","number","number","number"]),decodeBuffer:Module.cwrap("decode","number",["number","number","number","number"])}},wasm_update=function(e){var r,u,n,t,a,o,d,f,i,s,m;if(s=(r=new Uint8Array(e))[1]|r[2]<<8,m=r[3]|r[4]<<8,i=r[5]|r[6]<<8,t=r[7]|r[8]<<8,n=r[9],a=api.createBuffer(r.length),Module.HEAP8.set(r,a),d=i*t*4,o=api.decodeBuffer(a,r.length,resolution.depth,d),u=new Uint8Array(Module.HEAP8.buffer,o,d),e={},(f=new Uint8Array(d)).set(u,0),e.pixels=f.buffer,e.x=s,e.y=m,e.w=i,e.h=t,postMessage(e,[e.pixels]),api.destroyBuffer(a),0!==n||32!==resolution.depth)return api.destroyBuffer(o)},onmessage=function(e){return e.data.depth?resolution=e.data:wasm_update(e.data)};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,8 @@
"author": "",
"email": ""
},
"version":"0.1.0-a",
"version":"0.1.5-a",
"dependencies": ["libwvnc@0.1.2-a"],
"category":"Other",
"icon": "icon.png",
"mimes":["none"]

View File

@@ -1,7 +1,7 @@
{
"name": "RemoteDesktop",
"css": ["assets/main.css"],
"javascripts": ["javascripts/wvnc.js"],
"javascripts": [],
"coffees": ["coffees/main.coffee"],
"copies": ["assets/scheme.html", "package.json", "README.md", "javascripts/decoder.js", "javascripts/wvnc_asm.js", "javascripts/wvnc_asm.wasm", "assets/icon.png"]
"copies": ["assets/scheme.html", "package.json", "README.md","assets/icon.png"]
}