Skip to content

Commit

Permalink
Merge pull request #2 from marco-nh/master
Browse files Browse the repository at this point in the history
Fix: Dependencies
  • Loading branch information
paulavmf authored Nov 5, 2024
2 parents 8c154f5 + 293669e commit 35002a3
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 68 deletions.
60 changes: 28 additions & 32 deletions src/common/install/kasm_vnc/www/app/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,8 @@ const UI = {
}
qualityDropdown.appendChild(Object.assign(document.createElement("option"),{value:10,label:"Custom"}))

// if port == 80 (or 443) then it won't be present and should be
// set manually
let port = window.location.port;
if (!port) {
if (window.location.protocol.substring(0, 5) == 'https') {
port = 443;
} else if (window.location.protocol.substring(0, 4) == 'http') {
port = 80;
}
}

/* Populate the controls if defaults are provided in the URL */
UI.initSetting('host', window.location.hostname);
UI.initSetting('port', port);
UI.initSetting('encrypt', (window.location.protocol === "https:"));
UI.initSetting('view_clip', false);
/* UI.initSetting('resize', 'off'); */
Expand Down Expand Up @@ -474,7 +462,6 @@ const UI = {
document.getElementById("noVNC_reset_button")
.addEventListener('click', () => UI.rfb.machineReset());
},

addConnectionControlHandlers() {
UI.addClickHandle('noVNC_disconnect_button', UI.disconnect);

Expand Down Expand Up @@ -1363,30 +1350,39 @@ const UI = {

UI.hideStatus();

if (!host) {
Log.Error("Can't connect when host is: " + host);
UI.showStatus(_("Must set host"), 'error');
return;
}

UI.updateVisualState('connecting');

let url;

url = UI.getSetting('encrypt') ? 'wss' : 'ws';
if (host) {
url = new URL("https://" + host);

url += '://' + host;
if (port) {
url += ':' + port;
}
url += '/' + path;

UI.rfb = new RFB(document.getElementById('noVNC_container'),
document.getElementById('noVNC_keyboardinput'),
url,
{ shared: UI.getSetting('shared'),
repeaterID: UI.getSetting('repeaterID'),
credentials: { password: password } });
url.protocol = UI.getSetting('encrypt') ? 'wss:' : 'ws:';
if (port) {
url.port = port;
}
url.pathname = '/' + path;
} else {
// Current (May 2024) browsers support relative WebSocket
// URLs natively, but we need to support older browsers for
// some time.
url = new URL(path, location.href);
url.protocol = (window.location.protocol === "https:") ? 'wss:' : 'ws:';
}

try {
UI.rfb = new RFB(document.getElementById('noVNC_container'),
document.getElementById('noVNC_keyboardinput'),
url.href,
{ shared: UI.getSetting('shared'),
repeaterID: UI.getSetting('repeaterID'),
credentials: { password: password } });
} catch (exc) {
Log.Error("Failed to connect to server: " + exc);
UI.updateVisualState('disconnected');
UI.showStatus(_("Failed to connect to server: ") + exc, 'error');
return;
}
UI.rfb.addEventListener("connect", UI.connectFinished);
UI.rfb.addEventListener("disconnect", UI.disconnectFinished);
UI.rfb.addEventListener("credentialsrequired", UI.credentials);
Expand Down
72 changes: 36 additions & 36 deletions src/common/install/kasm_vnc/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,56 +38,56 @@
"homepage": "https://github.com/kasmtech/noVNC",
"devDependencies": {
"@babel/cli": "*",
"@babel/core": "*",
"@babel/plugin-syntax-dynamic-import": "*",
"@babel/plugin-transform-modules-commonjs": "*",
"@babel/preset-env": "*",
"@chiragrupani/karma-chromium-edge-launcher": "*",
"babel-loader": "^8.2.2",
"@babel/core": "*",
"@babel/plugin-syntax-dynamic-import": "*",
"@babel/plugin-transform-modules-commonjs": "*",
"@babel/preset-env": "*",
"@chiragrupani/karma-chromium-edge-launcher": "*",
"@rollup/plugin-node-resolve": "15.3.0",
"babel-loader": "^8.2.2",
"babel-plugin-import-redirect": "*",
"babelify": "*",
"browserify": "*",
"chai": "*",
"clean-webpack-plugin": "^3.0.0",
"commander": "*",
"core-js": "^3.18.3",
"babelify": "*",
"browserify": "*",
"chai": "^5.1.1",
"clean-webpack-plugin": "4.0.0",
"commander": "^2.20.3",
"core-js": "^3.18.3",
"cross-env": "^7.0.3",
"css-loader": "^5.0.1",
"css-minimizer-webpack-plugin": "^1.1.5",
"es-module-loader": "*",
"eslint": "*",
"es-module-loader": "2.3.0",
"eslint": "^8.57.1",
"file-loader": "^6.2.0",
"fs-extra": "*",
"fs-extra": "11.2.0",
"html-loader": "^1.3.2",
"html-webpack-inline-svg-plugin": "^2.3.0",
"html-webpack-plugin": "^5.5.0",
"jsdom": "*",
"karma": "*",
"karma-chrome-launcher": "*",
"karma-firefox-launcher": "*",
"karma-ie-launcher": "*",
"karma-mocha": "*",
"karma-mocha-reporter": "*",
"karma-safari-launcher": "*",
"karma-script-launcher": "*",
"karma-sinon-chai": "*",
"jsdom": "^25.0.1",
"karma": "^6.4.4",
"karma-chrome-launcher": "3.2.0",
"karma-firefox-launcher": "2.1.3",
"karma-ie-launcher": "1.0.0",
"karma-mocha": "2.0.1",
"karma-mocha-reporter": "2.2.5",
"karma-safari-launcher": "1.0.0",
"karma-script-launcher": "1.0.0",
"karma-sinon-chai": "2.0.2",
"mini-css-extract-plugin": "^1.3.3",
"mocha": "*",
"node-getopt": "*",
"po2json": "*",
"mocha": "^10.7.3",
"node-getopt": "0.3.2",
"po2json": "0.4.5",
"postcss-loader": "^4.1.0",
"preload-webpack-plugin": "^3.0.0-beta.4",
"regenerator-runtime": "^0.13.9",
"requirejs": "*",
"rollup": "*",
"rollup-plugin-node-resolve": "*",
"requirejs": "2.3.7",
"rollup": "4.23.0",
"sass": "^1.30.0",
"sass-loader": "^10.1.0",
"sinon": "*",
"sinon-chai": "^2.8.0",
"svg-sprite-html-webpack": "^2.3.0",
"webpack": "^5.20.0",
"webpack-cli": "^5.1.4"
"sinon": "19.0.2",
"sinon-chai": "^4.0.0",
"svg-sprite-html-webpack": "2.4.1",
"webpack": "^5.0.0-alpha.12",
"webpack-cli": "^4.0.0-alpha-4"
},
"keywords": [
"vnc",
Expand Down

0 comments on commit 35002a3

Please sign in to comment.