Commit b50f3406 authored by Joel Martin's avatar Joel Martin
parent 2090f1af
......@@ -134,7 +134,6 @@ Util.conf_defaults(conf, that, defaults, [
['focusContainer', 'wo', 'dom', document, 'DOM element that captures keyboard input'],
['encrypt', 'rw', 'bool', false, 'Use TLS/SSL/wss encryption'],
['repeaterID', 'rw', 'string', '', 'RepeaterID to connect to'],
['true_color', 'rw', 'bool', true, 'Request true color pixel data'],
['local_cursor', 'rw', 'bool', false, 'Request locally rendered cursor'],
['shared', 'rw', 'bool', true, 'Request shared mode'],
......@@ -143,6 +142,9 @@ Util.conf_defaults(conf, that, defaults, [
['connectTimeout', 'rw', 'int', def_con_timeout, 'Time (s) to wait for connection'],
['disconnectTimeout', 'rw', 'int', 3, 'Time (s) to wait for disconnection'],
// UltraVNC repeater ID to connect to
['repeaterID', 'rw', 'str', '', 'RepeaterID to connect to'],
['viewportDrag', 'rw', 'bool', false, 'Move the viewport on mouse drags'],
['check_rate', 'rw', 'int', 217, 'Timing (ms) of send/receive check'],
......@@ -689,8 +691,9 @@ init_msg = function() {
}
if (is_repeater) {
repeaterID = conf.repeaterID;
while(repeaterID.length < 250)
while (repeaterID.length < 250) {
repeaterID += "\0";
}
ws.send_string(repeaterID);
break;
}
......@@ -740,7 +743,6 @@ init_msg = function() {
// Server decides
if (ws.rQwait("security scheme", 4)) { return false; }
rfb_auth_scheme = ws.rQshift32();
//rfb_auth_scheme = ws.rQshiftStr(12);
}
updateState('Authentication',
"Authenticating using scheme: " + rfb_auth_scheme);
......
......@@ -49,13 +49,13 @@ load: function() {
UI.initSetting('port', window.location.port);
UI.initSetting('password', '');
UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('repeaterID', '');
UI.initSetting('true_color', true);
UI.initSetting('cursor', false);
UI.initSetting('shared', true);
UI.initSetting('view_only', false);
UI.initSetting('connectTimeout', 2);
UI.initSetting('path', 'websockify');
UI.initSetting('repeaterID', '');
UI.rfb = RFB({'target': $D('noVNC_canvas'),
'onUpdateState': UI.updateState,
......@@ -259,7 +259,6 @@ toggleSettingsPanel: function() {
UI.closeSettingsMenu();
} else {
UI.updateSetting('encrypt');
UI.updateSetting('repeaterID');
UI.updateSetting('true_color');
if (UI.rfb.get_display().get_cursor_uri()) {
UI.updateSetting('cursor');
......@@ -272,6 +271,7 @@ toggleSettingsPanel: function() {
UI.updateSetting('view_only');
UI.updateSetting('connectTimeout');
UI.updateSetting('path');
UI.updateSetting('repeaterID');
UI.updateSetting('stylesheet');
UI.updateSetting('logging');
......@@ -306,7 +306,6 @@ closeSettingsMenu: function() {
settingsApply: function() {
//Util.Debug(">> settingsApply");
UI.saveSetting('encrypt');
UI.saveSetting('repeaterID');
UI.saveSetting('true_color');
if (UI.rfb.get_display().get_cursor_uri()) {
UI.saveSetting('cursor');
......@@ -316,6 +315,7 @@ settingsApply: function() {
UI.saveSetting('view_only');
UI.saveSetting('connectTimeout');
UI.saveSetting('path');
UI.saveSetting('repeaterID');
UI.saveSetting('stylesheet');
UI.saveSetting('logging');
......@@ -418,7 +418,6 @@ updateVisualState: function() {
//Util.Debug(">> updateVisualState");
$D('noVNC_encrypt').disabled = connected;
$D('noVNC_repeaterID').disabled = connected;
$D('noVNC_true_color').disabled = connected;
if (UI.rfb && UI.rfb.get_display() &&
UI.rfb.get_display().get_cursor_uri()) {
......@@ -431,6 +430,7 @@ updateVisualState: function() {
$D('noVNC_view_only').disabled = connected;
$D('noVNC_connectTimeout').disabled = connected;
$D('noVNC_path').disabled = connected;
$D('noVNC_repeaterID').disabled = connected;
if (connected) {
UI.setViewClip();
......@@ -488,14 +488,15 @@ connect: function() {
}
UI.rfb.set_encrypt(UI.getSetting('encrypt'));
UI.rfb.set_repeaterID(UI.getSetting('repeaterID'));
UI.rfb.set_true_color(UI.getSetting('true_color'));
UI.rfb.set_local_cursor(UI.getSetting('cursor'));
UI.rfb.set_shared(UI.getSetting('shared'));
UI.rfb.set_view_only(UI.getSetting('view_only'));
UI.rfb.set_connectTimeout(UI.getSetting('connectTimeout'));
UI.rfb.set_repeaterID(UI.getSetting('repeaterID'));
UI.rfb.connect(host, port, password, path);
//Close dialog.
setTimeout(UI.setBarPosition, 100);
$D('noVNC_logo').style.display = "none";
......
......@@ -146,7 +146,7 @@ Util.conf_default = function(cfg, api, defaults, v, mode, type, defval, desc) {
}
} else if (type in {'integer':1, 'int':1}) {
val = parseInt(val, 10);
} else if (type === 'string') {
} else if (type === 'str') {
val = String(val);
} else if (type === 'func') {
if (!val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment