diff --git a/include/base.css b/include/base.css index 55d791a2e59436dfe1b6cc061b23d2def9e89fb7..c88cda5ed70b495cd4921ef7a89251ce2a5f2679 100644 --- a/include/base.css +++ b/include/base.css @@ -36,6 +36,9 @@ html { #noVNC_connectTimeout { width: 30px; } +#noVNC_path { + width: 100px; +} #noVNC_connect_button { width: 110px; float:right; diff --git a/include/rfb.js b/include/rfb.js index e161532d497851396ab4a15db4de3a5451f7cfb5..b7aa3f62c8a06069fbcd2fbdc631ec9316965271 100644 --- a/include/rfb.js +++ b/include/rfb.js @@ -35,7 +35,7 @@ var that = {}, // Public API methods rfb_host = '', rfb_port = 5900, rfb_password = '', - rfb_uri = '', + rfb_path = '', rfb_state = 'disconnected', rfb_version = 0, @@ -273,7 +273,7 @@ function connect() { } else { uri = "ws://"; } - uri += rfb_host + ":" + rfb_port + "/" + rfb_uri; + uri += rfb_host + ":" + rfb_port + "/" + rfb_path; Util.Info("connecting to " + uri); ws.open(uri); @@ -1526,13 +1526,13 @@ clientCutText = function(text) { // Public API interface functions // -that.connect = function(host, port, password, uri) { +that.connect = function(host, port, password, path) { //Util.Debug(">> connect"); rfb_host = host; rfb_port = port; rfb_password = (password !== undefined) ? password : ""; - rfb_uri = (uri !== undefined) ? uri : ""; + rfb_path = (path !== undefined) ? path : ""; if ((!rfb_host) || (!rfb_port)) { return fail("Must set host and port"); diff --git a/include/ui.js b/include/ui.js index d6e1d8565f50a5ba6e06b7fabcaa6beeac1fce91..321d77a5b171d356e29c75f89266c153cbdede3e 100644 --- a/include/ui.js +++ b/include/ui.js @@ -52,6 +52,7 @@ load: function() { UI.initSetting('cursor', false); UI.initSetting('shared', true); UI.initSetting('connectTimeout', 2); + UI.initSetting('path', ''); UI.rfb = RFB({'target': $D('noVNC_canvas'), 'onUpdateState': UI.updateState, @@ -246,6 +247,7 @@ toggleSettingsPanel: function() { UI.updateSetting('clip'); UI.updateSetting('shared'); UI.updateSetting('connectTimeout'); + UI.updateSetting('path'); UI.updateSetting('stylesheet'); UI.updateSetting('logging'); @@ -283,6 +285,7 @@ settingsApply: function() { UI.saveSetting('clip'); UI.saveSetting('shared'); UI.saveSetting('connectTimeout'); + UI.saveSetting('path'); UI.saveSetting('stylesheet'); UI.saveSetting('logging'); @@ -394,6 +397,7 @@ updateVisualState: function() { } $D('noVNC_shared').disabled = connected; $D('noVNC_connectTimeout').disabled = connected; + $D('noVNC_path').disabled = connected; if (connected) { UI.setViewClip(); @@ -435,7 +439,7 @@ clipReceive: function(rfb, text) { connect: function() { - var host, port, password; + var host, port, password, path; UI.closeSettingsMenu(); UI.toggleConnectPanel(); @@ -443,6 +447,7 @@ connect: function() { host = $D('noVNC_host').value; port = $D('noVNC_port').value; password = $D('noVNC_password').value; + path = $D('noVNC_path').value; if ((!host) || (!port)) { throw("Must set host and port"); } @@ -453,7 +458,7 @@ connect: function() { UI.rfb.set_shared(UI.getSetting('shared')); UI.rfb.set_connectTimeout(UI.getSetting('connectTimeout')); - UI.rfb.connect(host, port, password); + UI.rfb.connect(host, port, password, path); //Close dialog. setTimeout(UI.setBarPosition, 100); $D('noVNC_logo').style.display = "none"; diff --git a/vnc.html b/vnc.html index c412c70d254e19828c837c990d1ad463f25d9d44..8d6c3d5d4147339397d57ab38e8b986ae1664c07 100644 --- a/vnc.html +++ b/vnc.html @@ -122,6 +122,7 @@ <li><input id="noVNC_clip" type="checkbox"> Clip to window</li> <li><input id="noVNC_shared" type="checkbox"> Shared Mode</li> <li><input id="noVNC_connectTimeout" type="input"> Connect Timeout (s)</li> + <li><input id="noVNC_path" type="input"> Path</li> <hr> <!-- Stylesheet selection dropdown --> <li><label><strong>Style: </strong>