mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2026-08-05 16:12:41 +02:00
feat: upgrade noVNC
This commit is contained in:
@@ -33,25 +33,23 @@
|
||||
</body>
|
||||
|
||||
<!--
|
||||
<script type='text/javascript'
|
||||
<script type='text/javascript'
|
||||
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
|
||||
-->
|
||||
|
||||
<script type="text/javascript">
|
||||
var INCLUDE_URI= "../include/";
|
||||
// TODO: Data file should override
|
||||
var VNC_frame_encoding = "base64";
|
||||
var INCLUDE_URI= "../";
|
||||
</script>
|
||||
<script src="../include/util.js"></script>
|
||||
<script src="../include/webutil.js"></script>
|
||||
<script src="../core/util.js"></script>
|
||||
<script src="../app/webutil.js"></script>
|
||||
|
||||
<script>
|
||||
var fname, start_time;
|
||||
|
||||
function message(str) {
|
||||
console.log(str);
|
||||
var cell = $D('messages');
|
||||
cell.innerHTML += str + "\n";
|
||||
var cell = document.getElementById('messages');
|
||||
cell.textContent += str + "\n";
|
||||
cell.scrollTop = cell.scrollHeight;
|
||||
}
|
||||
|
||||
@@ -59,39 +57,37 @@
|
||||
if (fname) {
|
||||
message("Loading " + fname);
|
||||
// Load supporting scripts
|
||||
Util.load_scripts(["base64.js", "websock.js", "des.js",
|
||||
"keysymdef.js", "keyboard.js", "input.js", "display.js",
|
||||
"jsunzip.js", "rfb.js", "playback.js", fname]);
|
||||
WebUtil.load_scripts({
|
||||
'core': ["base64.js", "websock.js", "des.js", "input/keysym.js",
|
||||
"input/keysymdef.js", "input/xtscancodes.js", "input/util.js",
|
||||
"input/devices.js", "display.js", "rfb.js", "inflator.js"],
|
||||
'tests': ["playback.js"],
|
||||
'recordings': [fname]});
|
||||
|
||||
} else {
|
||||
message("Must specify data=FOO in query string.");
|
||||
}
|
||||
|
||||
updateState = function (rfb, state, oldstate, msg) {
|
||||
switch (state) {
|
||||
case 'failed':
|
||||
case 'fatal':
|
||||
message("noVNC sent '" + state + "' state during iteration " + iteration + " frame " + frame_idx);
|
||||
test_state = 'failed';
|
||||
break;
|
||||
case 'loaded':
|
||||
$D('startButton').disabled = false;
|
||||
break;
|
||||
}
|
||||
if (typeof msg !== 'undefined') {
|
||||
$D('VNC_status').innerHTML = msg;
|
||||
disconnected = function (rfb, reason) {
|
||||
if (reason) {
|
||||
message("noVNC sent '" + state + "' state during iteration " + iteration + " frame " + frame_idx);
|
||||
test_state = 'failed';
|
||||
}
|
||||
}
|
||||
|
||||
function start() {
|
||||
$D('startButton').value = "Running";
|
||||
$D('startButton').disabled = true;
|
||||
notification = function (rfb, mesg, level, options) {
|
||||
document.getElementById('VNC_status').textContent = mesg;
|
||||
}
|
||||
|
||||
iterations = $D('iterations').value;
|
||||
function start() {
|
||||
document.getElementById('startButton').value = "Running";
|
||||
document.getElementById('startButton').disabled = true;
|
||||
|
||||
iterations = document.getElementById('iterations').value;
|
||||
iteration = 0;
|
||||
start_time = (new Date()).getTime();
|
||||
|
||||
if ($D('mode1').checked) {
|
||||
if (document.getElementById('mode1').checked) {
|
||||
message("Starting performance playback (fullspeed) [" + iterations + " iteration(s)]");
|
||||
mode = 'perftest';
|
||||
} else {
|
||||
@@ -99,7 +95,8 @@
|
||||
mode = 'realtime';
|
||||
}
|
||||
|
||||
recv_message = rfb.testMode(send_array, VNC_frame_encoding);
|
||||
//recv_message = rfb.testMode(send_array, VNC_frame_encoding);
|
||||
|
||||
next_iteration();
|
||||
}
|
||||
|
||||
@@ -114,25 +111,24 @@
|
||||
// Shut-off event interception
|
||||
rfb.get_mouse().ungrab();
|
||||
rfb.get_keyboard().ungrab();
|
||||
$D('startButton').disabled = false;
|
||||
$D('startButton').value = "Start";
|
||||
document.getElementById('startButton').disabled = false;
|
||||
document.getElementById('startButton').value = "Start";
|
||||
|
||||
}
|
||||
|
||||
window.onscriptsload = function () {
|
||||
iterations = WebUtil.getQueryVar('iterations', 3);
|
||||
$D('iterations').value = iterations;
|
||||
document.getElementById('iterations').value = iterations;
|
||||
mode = WebUtil.getQueryVar('mode', 3);
|
||||
if (mode === 'realtime') {
|
||||
$D('mode2').checked = true;
|
||||
document.getElementById('mode2').checked = true;
|
||||
} else {
|
||||
$D('mode1').checked = true;
|
||||
document.getElementById('mode1').checked = true;
|
||||
}
|
||||
if (fname) {
|
||||
message("VNC_frame_data.length: " + VNC_frame_data.length);
|
||||
rfb = new RFB({'target': $D('VNC_canvas'),
|
||||
'onUpdateState': updateState});
|
||||
}
|
||||
document.getElementById('startButton').disabled = false;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user