1
0
mirror of https://github.com/lxsang/antd-web-apps synced 2024-11-20 02:18:20 +01:00

add demo page

This commit is contained in:
lxsang 2018-09-23 14:08:19 +02:00
parent 1a78d814eb
commit efe2061289
5 changed files with 73 additions and 21 deletions

View File

@ -22,25 +22,28 @@ class WebVNC extends window.classes.BaseObject
me = @
@client.onpassword = () ->
return new Promise (r,e) ->
r('lxsan9')
r('demopass')
@client.oncredential = () ->
return new Promise (r,e) ->
r('mrsang', '!x$@n9')
r('demo', 'demo')
@client.oncopy = (text) ->
($ "#clipboard")[0].value = text
@client.init()
.then () ->
$("#connect").click (e) ->
me.client.connect "192.168.1.20:5901", {
me.client.connect "/opt/www/vnc.conf", {
bbp: 32,
flag: 3,
quality: 30
quality: 10
}
$("#tbstatus").html "32bbp, compress JPEG & ZLib, JPEG quality 10%"
$("#stop").click (e) ->
me.client.disconnect()
$("#btclipboard").click (e) ->
me.client.sendTextAsClipboard ($ "#clipboard")[0].value
$("#selscale").on 'change', (e) ->
value = Number(@value)/100
me.client.setScale value
#$("#btclipboard").click (e) ->
# me.client.sendTextAsClipboard ($ "#clipboard")[0].value
.catch (m,s) ->
console.error m, s
WebVNC.dependencies = [

File diff suppressed because one or more lines are too long

View File

@ -188,12 +188,12 @@
me = this;
this.client.onpassword = function() {
return new Promise(function(r, e) {
return r('lxsan9');
return r('demopass');
});
};
this.client.oncredential = function() {
return new Promise(function(r, e) {
return r('mrsang', '!x$@n9');
return r('demo', 'demo');
});
};
this.client.oncopy = function(text) {
@ -201,17 +201,20 @@
};
return this.client.init().then(function() {
$("#connect").click(function(e) {
return me.client.connect("192.168.1.20:5901", {
return me.client.connect("/Users/mrsang/Documents/build/www/vnc.conf", {
bbp: 32,
flag: 3,
quality: 30
quality: 10
});
});
$("#tbstatus").html("32bbp, compress JPEG & ZLib, JPEG quality 10%");
$("#stop").click(function(e) {
return me.client.disconnect();
});
return $("#btclipboard").click(function(e) {
return me.client.sendTextAsClipboard(($("#clipboard"))[0].value);
return $("#selscale").on('change', function(e) {
var value;
value = Number(this.value) / 100;
return me.client.setScale(value);
});
})["catch"](function(m, s) {
return console.error(m, s);

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,18 @@
<h1>VNC screen here</h1>
<p><a id="connect" href="#">Connect</a><a id="stop" href="#">Disconnect</a></p>
<p>
<textarea id='clipboard'></textarea>
<button id="btclipboard">Send</button>
</p>
<div id="screen_container">
<ul id = "tool_bar">
<li class ="title">VNC client demo</li>
<li><a id="connect" href="#">Connect</a></li>
<li><a id="stop" href="#">Disconnect</a></li>
<li>
Scale (percent):
<select id="selscale">
<option value="50">40</option>
<option value="60">60</option>
<option value="80">80</option>
<option value="100" selected="selected">100</option>
</select>
</li>
<li id ="tbstatus"></li>
</ul>
<div style="width:1px; display:block; clear:both;"></div>
<canvas id = "canvas" tabindex="1"></canvas>