5
0
mirror of git://git.proxmox.com/git/novnc-pve.git synced 2025-01-03 05:17:56 +03:00

rebase novnc patches on 1.0.0

also optimize indentation and squash patches

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
Dominik Csapak 2018-05-09 13:31:33 +02:00 committed by Thomas Lamprecht
parent 43233cc27e
commit a375b7e5d0
14 changed files with 236 additions and 302 deletions

View File

@ -1,7 +1,7 @@
From ad6975daaeee0798955f1d8b36d567975f4cbae5 Mon Sep 17 00:00:00 2001 From e9e4fe2eab135507fd6574b2f12ddc5c9d0a532b Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Tue, 13 Dec 2016 16:11:35 +0100 Date: Tue, 13 Dec 2016 16:11:35 +0100
Subject: [PATCH 1/9] add pve specific js code Subject: [PATCH 01/10] add pve specific js code
this adds a es6 module 'PVEUI' which we use for defining the pve related this adds a es6 module 'PVEUI' which we use for defining the pve related
methods (API2Request, etc.) methods (API2Request, etc.)
@ -11,17 +11,17 @@ autoresizing, commandstoggle, etc.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
--- ---
app/pve.js | 417 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/pve.js | 414 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
app/ui.js | 95 ++++++++++---- app/ui.js | 75 ++++++++---
2 files changed, 488 insertions(+), 24 deletions(-) 2 files changed, 475 insertions(+), 14 deletions(-)
create mode 100644 app/pve.js create mode 100644 app/pve.js
diff --git a/app/pve.js b/app/pve.js diff --git a/app/pve.js b/app/pve.js
new file mode 100644 new file mode 100644
index 0000000..668835a index 0000000..37858f5
--- /dev/null --- /dev/null
+++ b/app/pve.js +++ b/app/pve.js
@@ -0,0 +1,417 @@ @@ -0,0 +1,414 @@
+/* +/*
+ * PVE Utility functions for noVNC + * PVE Utility functions for noVNC
+ * Copyright (C) 2017 Proxmox GmbH + * Copyright (C) 2017 Proxmox GmbH
@ -76,6 +76,13 @@ index 0000000..668835a
+ break; + break;
+ } + }
+ +
+ if (this.resize == 'scale' &&
+ (this.consoletype === 'lxc' || this.consoletype === 'shell')) {
+ var size = this.getFBSize();
+ params.width = size.width;
+ params.height = size.height;
+ }
+
+ this.baseUrl = baseUrl; + this.baseUrl = baseUrl;
+ this.url = url; + this.url = url;
+ this.params = params; + this.params = params;
@ -341,10 +348,6 @@ index 0000000..668835a
+ el.classList.add('noVNC_hidden'); + el.classList.add('noVNC_hidden');
+ } + }
+ }); + });
+
+ //edge/ie11 quirk
+ var canvas = document.getElementById('noVNC_canvas');
+ canvas.onclick = canvas.focus;
+ }, + },
+ +
+ getFBSize: function() { + getFBSize: function() {
@ -393,7 +396,6 @@ index 0000000..668835a
+ +
+ updateFBSize: function(rfb, width, height, clip) { + updateFBSize: function(rfb, width, height, clip) {
+ var me = this; + var me = this;
+ console.log(arguments);
+ try { + try {
+ // Note: window size must be even number for firefox + // Note: window size must be even number for firefox
+ me.lastFBWidth = Math.floor((width + 1)/2)*2; + me.lastFBWidth = Math.floor((width + 1)/2)*2;
@ -420,11 +422,6 @@ index 0000000..668835a
+ //console.log("try resize by " + offsetw + " " + offseth); + //console.log("try resize by " + offsetw + " " + offseth);
+ try { + try {
+ window.resizeBy(offsetw, offseth); + window.resizeBy(offsetw, offseth);
+ // wait a little an then fix the scrollbars
+ // on chrome
+ setTimeout(function() {
+ me.UI.fixScrollbars();
+ }, 100);
+ } catch (e) { + } catch (e) {
+ console.log('resizing did not work', e); + console.log('resizing did not work', e);
+ } + }
@ -440,135 +437,126 @@ index 0000000..668835a
+ }, + },
+}; +};
diff --git a/app/ui.js b/app/ui.js diff --git a/app/ui.js b/app/ui.js
index 73ad2b4..def0eda 100644 index 2218d24..143cb60 100644
--- a/app/ui.js --- a/app/ui.js
+++ b/app/ui.js +++ b/app/ui.js
@@ -20,6 +20,7 @@ import keysyms from "../core/input/keysymdef.js"; @@ -18,6 +18,7 @@ import Keyboard from "../core/input/keyboard.js";
import RFB from "../core/rfb.js"; import RFB from "../core/rfb.js";
import Display from "../core/display.js"; import Display from "../core/display.js";
import * as WebUtil from "./webutil.js"; import * as WebUtil from "./webutil.js";
+import PVEUI from "./pve.js"; +import PVEUI from "./pve.js";
const UI = { var UI = {
@@ -63,6 +64,7 @@ const UI = { @@ -59,6 +60,7 @@ var UI = {
// Render default UI and initialize settings menu // Render default UI and initialize settings menu
start: function(callback) { start: function(callback) {
+ UI.PVE = new PVEUI(UI); + UI.PVE = new PVEUI(UI);
// Setup global variables first // Setup global variables first
UI.isSafari = (navigator.userAgent.indexOf('Safari') !== -1 && UI.isSafari = (navigator.userAgent.indexOf('Safari') !== -1 &&
navigator.userAgent.indexOf('Chrome') === -1); navigator.userAgent.indexOf('Chrome') === -1);
@@ -95,6 +97,9 @@ const UI = { @@ -90,6 +92,9 @@ var UI = {
UI.addConnectionControlHandlers(); UI.addConnectionControlHandlers();
UI.addClipboardHandlers(); UI.addClipboardHandlers();
UI.addSettingsHandlers(); UI.addSettingsHandlers();
+ +
+ // add pve specific event handlers + // add pve specific event handlers
+ UI.PVE.addPVEHandlers(); + UI.PVE.addPVEHandlers();
document.getElementById("noVNC_status") document.getElementById("noVNC_status")
.addEventListener('click', UI.hideStatus); .addEventListener('click', UI.hideStatus);
@@ -103,11 +108,6 @@ const UI = { @@ -98,23 +103,19 @@ var UI = {
UI.openControlbar(); UI.openControlbar();
- // Show the connect panel on first load unless autoconnecting + UI.updateViewClip();
- if (!autoconnect) { +
- UI.openConnectPanel(); UI.updateVisualState('init');
- }
-
UI.updateViewClip();
UI.updateVisualState();
@@ -115,17 +115,13 @@ const UI = {
document.getElementById('noVNC_setting_host').focus();
document.documentElement.classList.remove("noVNC_loading"); document.documentElement.classList.remove("noVNC_loading");
- var autoconnect = WebUtil.getConfigVar('autoconnect', false); - var autoconnect = WebUtil.getConfigVar('autoconnect', false);
- if (autoconnect === 'true' || autoconnect == '1') { - if (autoconnect === 'true' || autoconnect == '1') {
- autoconnect = true; - autoconnect = true;
- UI.connect(); + UI.PVE.pveStart(function() {
UI.connect();
- } else { - } else {
- autoconnect = false; - autoconnect = false;
- // Show the connect panel on first load unless autoconnecting
- UI.openConnectPanel();
- } - }
+ UI.PVE.pveStart(function() {
+ UI.connect();
- if (typeof callback === "function") { - if (typeof callback === "function") {
- callback(UI.rfb); - callback(UI.rfb);
- } - }
+ if (typeof callback === "function") { + if (typeof callback === "function") {
+ callback(UI.rfb); + callback(UI.rfb);
+ } + }
+ }); + });
}, },
initFullscreen: function() { initFullscreen: function() {
@@ -170,10 +166,14 @@ const UI = { @@ -159,9 +160,13 @@ var UI = {
/* Populate the controls if defaults are provided in the URL */ /* Populate the controls if defaults are provided in the URL */
UI.initSetting('host', window.location.hostname); UI.initSetting('host', window.location.hostname);
UI.initSetting('port', port); UI.initSetting('port', port);
- UI.initSetting('encrypt', (window.location.protocol === "https:")); - UI.initSetting('encrypt', (window.location.protocol === "https:"));
+ UI.initSetting('encrypt', true); + UI.initSetting('encrypt', true);
UI.initSetting('cursor', !isTouchDevice); UI.initSetting('view_clip', false);
UI.initSetting('clip', false);
- UI.initSetting('resize', 'off'); - UI.initSetting('resize', 'off');
+ // we need updateSetting because + // we need updateSetting because
+ // otherwise we load from browser storage + // otherwise we load from browser storage
+ // we want to overwrite the resize mode from url + // we want to overwrite the resize mode from url
+ var resize = WebUtil.getQueryVar('resize'); + var resize = WebUtil.getQueryVar('resize');
+ UI.updateSetting('resize', resize); + UI.updateSetting('resize', resize);
UI.initSetting('shared', true); UI.initSetting('shared', true);
UI.initSetting('view_only', false); UI.initSetting('view_only', false);
UI.initSetting('path', 'websockify'); UI.initSetting('path', 'websockify');
@@ -434,6 +434,7 @@ const UI = { @@ -393,6 +398,9 @@ var UI = {
document.documentElement.classList.add("noVNC_connecting");
break;
case 'connected': case 'connected':
UI.connected = true; + UI.connected = true;
UI.inhibit_reconnect = false; + UI.inhibit_reconnect = false;
+ UI.pveAllowMigratedTest = true; + UI.pveAllowMigratedTest = true;
document.documentElement.classList.add("noVNC_connected"); document.documentElement.classList.add("noVNC_connected");
if (rfb && rfb.get_encrypt()) { break;
msg = _("Connected (encrypted) to ") + UI.desktopName; case 'disconnecting':
@@ -449,6 +450,10 @@ const UI = { @@ -400,6 +408,11 @@ var UI = {
document.documentElement.classList.add("noVNC_disconnecting");
break; break;
case 'disconnected': case 'disconnected':
UI.showStatus(_("Disconnected")); + UI.showStatus(_("Disconnected"));
+ if (UI.pveAllowMigratedTest === true) { + if (UI.pveAllowMigratedTest === true) {
+ UI.pveAllowMigratedTest = false; + UI.pveAllowMigratedTest = false;
+ UI.PVE.pve_detect_migrated_vm(); + UI.PVE.pve_detect_migrated_vm();
+ } + }
break; break;
default: case 'reconnecting':
msg = "Invalid UI state"; transition_elem.textContent = _("Reconnecting...");
@@ -861,6 +866,7 @@ const UI = { @@ -813,6 +826,7 @@ var UI = {
UI.closeXvpPanel(); UI.closePowerPanel();
UI.closeClipboardPanel(); UI.closeClipboardPanel();
UI.closeExtraKeys(); UI.closeExtraKeys();
+ UI.closePVECommandPanel(); + UI.closePVECommandPanel();
}, },
/* ------^------- /* ------^-------
@@ -1033,9 +1039,15 @@ const UI = { @@ -988,6 +1002,12 @@ var UI = {
password = WebUtil.getConfigVar('password'); UI.reconnect_password = password;
} }
- if (password === null) { + var password = document.getElementById('noVNC_password_input').value;
- password = undefined;
- }
+ var password = document.getElementById('noVNC_password_input').value;
+ +
+ if (!password) { + if (!password) {
+ password = WebUtil.getConfigVar('password'); + password = WebUtil.getConfigVar('password');
+ } + }
+ +
+ if (password === null) { if (password === null) {
+ password = undefined; password = undefined;
+ } }
@@ -1567,9 +1587,36 @@ var UI = {
if ((!host) || (!port)) {
var msg = _("Must set host and port");
@@ -1608,9 +1620,36 @@ const UI = {
/* ------^------- /* ------^-------
* /EXTRA KEYS * /EXTRA KEYS
* ============== * ==============
@ -577,63 +565,35 @@ index 73ad2b4..def0eda 100644
* ------v------*/ * ------v------*/
+ togglePVECommandPanel: function() { + togglePVECommandPanel: function() {
+ if (document.getElementById('pve_commands').classList.contains("noVNC_open")) { + if (document.getElementById('pve_commands').classList.contains("noVNC_open")) {
+ UI.closePVECommandPanel(); + UI.closePVECommandPanel();
+ } else { + } else {
+ UI.openPVECommandPanel(); + UI.openPVECommandPanel();
+ } + }
+ }, + },
+ +
+ openPVECommandPanel: function() { + openPVECommandPanel: function() {
+ var me = this; + var me = this;
+ UI.closeAllPanels(); + UI.closeAllPanels();
+ UI.openControlbar(); + UI.openControlbar();
+ +
+ document.getElementById('pve_commands').classList.add("noVNC_open"); + document.getElementById('pve_commands').classList.add("noVNC_open");
+ document.getElementById('pve_commands_button').classList.add("noVNC_selected"); + document.getElementById('pve_commands_button').classList.add("noVNC_selected");
+ }, + },
+ +
+ closePVECommandPanel: function() { + closePVECommandPanel: function() {
+ document.getElementById('pve_commands').classList.remove("noVNC_open"); + document.getElementById('pve_commands').classList.remove("noVNC_open");
+ document.getElementById('pve_commands_button').classList.remove("noVNC_selected"); + document.getElementById('pve_commands_button').classList.remove("noVNC_selected");
+ }, + },
+ +
+/* ------^------- +/* ------^-------
+ * /PVE + * /PVE
+ * ============== + * ==============
+ * MISC + * MISC
+ * ------v------*/ + * ------v------*/
setMouseButton: function(num) { setMouseButton: function(num) {
var view_only = UI.rfb.get_view_only(); var view_only = UI.rfb.viewOnly;
if (UI.rfb && !view_only) { if (UI.rfb && !view_only) {
@@ -1658,8 +1697,16 @@ const UI = {
},
updateSessionSize: function(rfb, width, height) {
- UI.updateViewClip();
- UI.fixScrollbars();
+ var resize = UI.getSetting('resize');
+
+ if (resize == 'null') {
+ var clip = UI.getSetting('clip');
+ UI.PVE.updateFBSize(rfb, width, height, clip);
+ }
+
+ UI.applyResizeMode();
+ UI.updateViewClip();
+ UI.updateViewDrag();
},
fixScrollbars: function() {
@@ -1704,7 +1751,7 @@ const UI = {
},
/* ------^-------
- * /MISC
+ * /MISC
* ==============
*/
};
-- --
2.11.0 2.11.0

View File

@ -0,0 +1,72 @@
From 5a456e52e6a1c9cb283187505bc09289a9fb3334 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Wed, 9 May 2018 10:47:53 +0200
Subject: [PATCH 02/10] add custom fbresize event on rfb
this can be use to react to changes of the resolution, like resizing the
window
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
app/ui.js | 16 ++++++++++++++++
core/rfb.js | 10 ++++++++++
2 files changed, 26 insertions(+)
diff --git a/app/ui.js b/app/ui.js
index 143cb60..b01fd5d 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -1047,6 +1047,7 @@ var UI = {
UI.rfb.addEventListener("clipboard", UI.clipboardReceive);
UI.rfb.addEventListener("bell", UI.bell);
UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
+ UI.rfb.addEventListener("fbresize", UI.updateSessionSize);
UI.rfb.clipViewport = UI.getSetting('view_clip');
UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
@@ -1612,6 +1613,21 @@ var UI = {
document.getElementById('pve_commands_button').classList.remove("noVNC_selected");
},
+ updateSessionSize: function(e) {
+ var rfb = e.detail.rfb;
+ var width = e.detail.width;
+ var height = e.detail.height;
+ var resize = UI.getSetting('resize');
+
+ if (resize == 'null') {
+ var clip = UI.getSetting('view_clip');
+ UI.PVE.updateFBSize(rfb, width, height, clip);
+ }
+
+ UI.applyResizeMode();
+ UI.updateViewClip();
+ },
+
/* ------^-------
* /PVE
* ==============
diff --git a/core/rfb.js b/core/rfb.js
index 7c4e0c9..6a1ff85 100644
--- a/core/rfb.js
+++ b/core/rfb.js
@@ -1588,6 +1588,16 @@ RFB.prototype = {
this._updateClip();
this._updateScale();
+ // fbresize event
+ var event = new CustomEvent("fbresize", {
+ detail: {
+ rfb: this,
+ width: width,
+ height: height }
+ }
+ );
+ this.dispatchEvent(event);
+
this._timing.fbu_rt_start = (new Date()).getTime();
this._updateContinuousUpdates();
},
--
2.11.0

View File

@ -1,45 +1,44 @@
From c1073cb0f19ebd64f6ee4b221b5aa06a2f8e5c99 Mon Sep 17 00:00:00 2001 From 6abc6b0b278717584ff2452cbe8d1f448398a406 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Thu, 11 May 2017 10:34:10 +0200 Date: Thu, 11 May 2017 10:34:10 +0200
Subject: [PATCH 2/9] change scaling when toggling fullscreen Subject: [PATCH 03/10] change scaling when toggling fullscreen
when activating fullscreen, we change the scaling to 'scale', when activating fullscreen, we change the scaling to 'scale',
and changing it back when leaving fullscreen and changing it back when leaving fullscreen
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
--- ---
app/ui.js | 11 +++++++++++ app/ui.js | 9 +++++++++
1 file changed, 11 insertions(+) 1 file changed, 9 insertions(+)
diff --git a/app/ui.js b/app/ui.js diff --git a/app/ui.js b/app/ui.js
index def0eda..d4b0291 100644 index b01fd5d..d35be49 100644
--- a/app/ui.js --- a/app/ui.js
+++ b/app/ui.js +++ b/app/ui.js
@@ -1174,6 +1174,15 @@ const UI = { @@ -1210,6 +1210,12 @@ var UI = {
} else if (document.msExitFullscreen) { } else if (document.msExitFullscreen) {
document.msExitFullscreen(); document.msExitFullscreen();
} }
+ +
+ // when changing from fullscreen to window, + // when changing from fullscreen to window,
+ // re enable auto resize + // re enable auto resize
+ if (WebUtil.getQueryVar('resize') === null) { + if (WebUtil.getQueryVar('resize') === null) {
+ UI.updateSetting('resize', null); + UI.updateSetting('resize', null);
+ setTimeout(function() { + }
+ UI.fixScrollbars();
+ }, 100);
+ }
} else { } else {
if (document.documentElement.requestFullscreen) { if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen(); document.documentElement.requestFullscreen();
@@ -1184,6 +1193,8 @@ const UI = { @@ -1220,7 +1226,10 @@ var UI = {
} else if (document.body.msRequestFullscreen) { } else if (document.body.msRequestFullscreen) {
document.body.msRequestFullscreen(); document.body.msRequestFullscreen();
} }
+ // we want scaling in fullscreen mode + // we want scaling in fullscreen mode
+ UI.updateSetting('resize', 'scale'); + UI.updateSetting('resize', 'scale');
} }
+ UI.applyResizeMode();
UI.enableDisableViewClip(); UI.enableDisableViewClip();
UI.updateFullscreenButton(); UI.updateFullscreenButton();
},
-- --
2.11.0 2.11.0

View File

@ -1,7 +1,7 @@
From 1cdfeafd561bfe4d9acb7ef8a838d82c64f9c1e5 Mon Sep 17 00:00:00 2001 From 5d8fb2485e4863d561481ea7d51e36f8e0be1d2b Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Tue, 13 Dec 2016 16:03:41 +0100 Date: Tue, 13 Dec 2016 16:03:41 +0100
Subject: [PATCH 3/9] add pve style Subject: [PATCH 04/10] add pve style
this adds the custom pve style (based on black.css) this adds the custom pve style (based on black.css)
@ -10,17 +10,17 @@ and fix the z-index of the connect overlay
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
--- ---
app/styles/pve.css | 37 +++++++++++++++++++++++++++++++++++++ app/styles/pve.css | 42 ++++++++++++++++++++++++++++++++++++++++++
vnc.html | 1 + vnc.html | 1 +
2 files changed, 38 insertions(+) 2 files changed, 43 insertions(+)
create mode 100644 app/styles/pve.css create mode 100644 app/styles/pve.css
diff --git a/app/styles/pve.css b/app/styles/pve.css diff --git a/app/styles/pve.css b/app/styles/pve.css
new file mode 100644 new file mode 100644
index 0000000..35002fe index 0000000..eaeb5cb
--- /dev/null --- /dev/null
+++ b/app/styles/pve.css +++ b/app/styles/pve.css
@@ -0,0 +1,37 @@ @@ -0,0 +1,42 @@
+/* +/*
+ * noVNC black CSS + * noVNC black CSS
+ * Copyright (C) 2012 Joel Martin + * Copyright (C) 2012 Joel Martin
@ -58,11 +58,16 @@ index 0000000..35002fe
+#noVNC_connect_button { +#noVNC_connect_button {
+ display: none; + display: none;
+} +}
+
+:root:not(.noVNC_touch) .noVNC_button.noVNC_selected:hover {
+ border-color: rgba(0, 0, 0, 0.4);
+ background: #5BA8DF;
+}
diff --git a/vnc.html b/vnc.html diff --git a/vnc.html b/vnc.html
index 6cb4be4..98a9952 100644 index 701714c..63d7181 100644
--- a/vnc.html --- a/vnc.html
+++ b/vnc.html +++ b/vnc.html
@@ -53,6 +53,7 @@ @@ -55,6 +55,7 @@
<!-- Stylesheets --> <!-- Stylesheets -->
<link rel="stylesheet" href="app/styles/base.css" /> <link rel="stylesheet" href="app/styles/base.css" />

View File

@ -1,20 +1,20 @@
From a28b283a224990e1b46f304d9a2067afa7633d63 Mon Sep 17 00:00:00 2001 From 761e67e803bfcf196cc2229ec451adaee0beb61a Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Fri, 20 Jan 2017 10:35:05 +0100 Date: Fri, 20 Jan 2017 10:35:05 +0100
Subject: [PATCH 4/9] remove vnc logos Subject: [PATCH 05/10] remove vnc logos
to show the pve icon instead to show the pve icon instead
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
--- ---
vnc.html | 24 ------------------------ vnc.html | 26 --------------------------
1 file changed, 24 deletions(-) 1 file changed, 26 deletions(-)
diff --git a/vnc.html b/vnc.html diff --git a/vnc.html b/vnc.html
index 98a9952..cd8e594 100644 index 63d7181..60727e4 100644
--- a/vnc.html --- a/vnc.html
+++ b/vnc.html +++ b/vnc.html
@@ -23,34 +23,10 @@ @@ -23,36 +23,10 @@
Remove this if you use the .htaccess --> Remove this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
@ -32,7 +32,9 @@ index 98a9952..cd8e594 100644
- <link rel="icon" sizes="144x144" type="image/png" href="app/images/icons/novnc-144x144.png"> - <link rel="icon" sizes="144x144" type="image/png" href="app/images/icons/novnc-144x144.png">
- <link rel="icon" sizes="152x152" type="image/png" href="app/images/icons/novnc-152x152.png"> - <link rel="icon" sizes="152x152" type="image/png" href="app/images/icons/novnc-152x152.png">
- <link rel="icon" sizes="192x192" type="image/png" href="app/images/icons/novnc-192x192.png"> - <link rel="icon" sizes="192x192" type="image/png" href="app/images/icons/novnc-192x192.png">
- <!-- Firefox currently mishandles SVG, see #1419039
- <link rel="icon" sizes="any" type="image/svg+xml" href="app/images/icons/novnc-icon.svg"> - <link rel="icon" sizes="any" type="image/svg+xml" href="app/images/icons/novnc-icon.svg">
- -->
- <!-- Repeated last so that legacy handling will pick this --> - <!-- Repeated last so that legacy handling will pick this -->
- <link rel="icon" sizes="16x16" type="image/png" href="app/images/icons/novnc-16x16.png"> - <link rel="icon" sizes="16x16" type="image/png" href="app/images/icons/novnc-16x16.png">
- -

View File

@ -1,7 +1,7 @@
From 0b7322fc05361366fc4e24e6d5b9d8e2254ace40 Mon Sep 17 00:00:00 2001 From 87486c038db7ddb212f995c70edf13dc1e8783cd Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Tue, 17 Jan 2017 17:24:03 +0100 Date: Tue, 17 Jan 2017 17:24:03 +0100
Subject: [PATCH 5/9] change src directory for images/js files Subject: [PATCH 06/10] change src directory for images/js files
since they will be in /novnc/ since they will be in /novnc/
also change the directory in the build script also change the directory in the build script
@ -14,11 +14,11 @@ Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 files changed, 30 insertions(+), 30 deletions(-) 3 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/app/ui.js b/app/ui.js diff --git a/app/ui.js b/app/ui.js
index d4b0291..d32c789 100644 index d35be49..d64389d 100644
--- a/app/ui.js --- a/app/ui.js
+++ b/app/ui.js +++ b/app/ui.js
@@ -1771,7 +1771,7 @@ const UI = { @@ -1725,7 +1725,7 @@ var UI = {
var LINGUAS = ["de", "el", "nl", "sv"]; var LINGUAS = ["de", "el", "es", "nl", "pl", "sv", "tr", "zh"];
l10n.setup(LINGUAS); l10n.setup(LINGUAS);
if (l10n.language !== "en" && l10n.dictionary === undefined) { if (l10n.language !== "en" && l10n.dictionary === undefined) {
- WebUtil.fetchJSON('app/locale/' + l10n.language + '.json', function (translations) { - WebUtil.fetchJSON('app/locale/' + l10n.language + '.json', function (translations) {
@ -40,7 +40,7 @@ index 990fb4d..0f44e1c 100644
noCopyOverride: () => {}, noCopyOverride: () => {},
}, },
diff --git a/vnc.html b/vnc.html diff --git a/vnc.html b/vnc.html
index cd8e594..23fc0e4 100644 index 60727e4..fa66d6f 100644
--- a/vnc.html --- a/vnc.html
+++ b/vnc.html +++ b/vnc.html
@@ -28,7 +28,7 @@ @@ -28,7 +28,7 @@
@ -76,8 +76,8 @@ index cd8e594..23fc0e4 100644
}); });
</script> </script>
<!-- actual script modules --> <!-- actual script modules -->
- <script type="module" src="app/ui.js"></script> - <script type="module" crossorigin="anonymous" src="app/ui.js"></script>
+ <script type="module" src="/novnc/app/ui.js"></script> + <script type="module" crossorigin="anonymous" src="/novnc/app/ui.js"></script>
<!-- end scripts --> <!-- end scripts -->
</head> </head>
@ -146,19 +146,19 @@ index cd8e594..23fc0e4 100644
@@ -130,13 +130,13 @@ @@ -130,13 +130,13 @@
</div> </div>
<!-- XVP Shutdown/Reboot --> <!-- Shutdown/Reboot -->
- <input type="image" alt="Shutdown/Reboot" src="app/images/power.svg" - <input type="image" alt="Shutdown/Reboot" src="app/images/power.svg"
+ <input type="image" alt="Shutdown/Reboot" src="/novnc/app/images/power.svg" + <input type="image" alt="Shutdown/Reboot" src="/novnc/app/images/power.svg"
id="noVNC_xvp_button" class="noVNC_button" id="noVNC_power_button" class="noVNC_button"
title="Shutdown/Reboot..." /> title="Shutdown/Reboot..." />
<div class="noVNC_vcenter"> <div class="noVNC_vcenter">
<div id="noVNC_xvp" class="noVNC_panel"> <div id="noVNC_power" class="noVNC_panel">
<div class="noVNC_heading"> <div class="noVNC_heading">
- <img src="app/images/power.svg"> Power - <img src="app/images/power.svg"> Power
+ <img src="/novnc/app/images/power.svg"> Power + <img src="/novnc/app/images/power.svg"> Power
</div> </div>
<input type="button" id="noVNC_xvp_shutdown_button" value="Shutdown" /> <input type="button" id="noVNC_shutdown_button" value="Shutdown" />
<input type="button" id="noVNC_xvp_reboot_button" value="Reboot" /> <input type="button" id="noVNC_reboot_button" value="Reboot" />
@@ -145,13 +145,13 @@ @@ -145,13 +145,13 @@
</div> </div>
@ -198,7 +198,7 @@ index cd8e594..23fc0e4 100644
</li> </li>
<li> <li>
<label><input id="noVNC_setting_shared" type="checkbox" /> Shared Mode</label> <label><input id="noVNC_setting_shared" type="checkbox" /> Shared Mode</label>
@@ -249,7 +249,7 @@ @@ -244,7 +244,7 @@
</div> </div>
<!-- Connection Controls --> <!-- Connection Controls -->
@ -207,7 +207,7 @@ index cd8e594..23fc0e4 100644
id="noVNC_disconnect_button" class="noVNC_button" id="noVNC_disconnect_button" class="noVNC_button"
title="Disconnect" /> title="Disconnect" />
@@ -266,7 +266,7 @@ @@ -263,7 +263,7 @@
<div id="noVNC_connect_dlg"> <div id="noVNC_connect_dlg">
<div class="noVNC_logo" translate="no"><span>no</span>VNC</div> <div class="noVNC_logo" translate="no"><span>no</span>VNC</div>
<div id="noVNC_connect_button"><div> <div id="noVNC_connect_button"><div>
@ -216,7 +216,7 @@ index cd8e594..23fc0e4 100644
</div></div> </div></div>
</div> </div>
</div> </div>
@@ -314,8 +314,8 @@ @@ -304,8 +304,8 @@
</div> </div>
<audio id="noVNC_bell"> <audio id="noVNC_bell">

View File

@ -1,7 +1,7 @@
From 1a042fcad1f9242cafbb589a1da5b8b270e8b8bb Mon Sep 17 00:00:00 2001 From d83521eab33ef32d35f4ea8ada73585bad4265a4 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Fri, 20 Jan 2017 10:35:43 +0100 Date: Fri, 20 Jan 2017 10:35:43 +0100
Subject: [PATCH 6/9] add pve vnc commands Subject: [PATCH 07/10] add pve vnc commands
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
--- ---
@ -9,7 +9,7 @@ Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
1 file changed, 20 insertions(+) 1 file changed, 20 insertions(+)
diff --git a/vnc.html b/vnc.html diff --git a/vnc.html b/vnc.html
index 23fc0e4..e789d04 100644 index fa66d6f..8c3d9d9 100644
--- a/vnc.html --- a/vnc.html
+++ b/vnc.html +++ b/vnc.html
@@ -165,6 +165,26 @@ @@ -165,6 +165,26 @@

View File

@ -1,7 +1,7 @@
From c3d885b78fd816201ed485eb7a681ce1fcf3a122 Mon Sep 17 00:00:00 2001 From f56b6fe825b776c30e445d2319488bec63551b8f Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Fri, 20 Jan 2017 10:16:09 +0100 Date: Fri, 20 Jan 2017 10:16:09 +0100
Subject: [PATCH 7/9] add replaceable snippets in vnc.html Subject: [PATCH 08/10] add replaceable snippets in vnc.html
so that we can insert the username/csrftoken via search/replace so that we can insert the username/csrftoken via search/replace
@ -11,7 +11,7 @@ Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
1 file changed, 7 insertions(+), 1 deletion(-) 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/vnc.html b/vnc.html diff --git a/vnc.html b/vnc.html
index e789d04..1423f78 100644 index 8c3d9d9..a139e26 100644
--- a/vnc.html --- a/vnc.html
+++ b/vnc.html +++ b/vnc.html
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@

View File

@ -1,43 +0,0 @@
From b97c51d6a2ca70a5e60209cd7ab16563455b8d13 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Wed, 14 Dec 2016 08:40:02 +0100
Subject: [PATCH 8/9] focus canvas after load
or else in some browsers, the canvas does not get the focus after
loading in an iframe
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
app/ui.js | 2 ++
vnc.html | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/app/ui.js b/app/ui.js
index d32c789..ed2897b 100644
--- a/app/ui.js
+++ b/app/ui.js
@@ -442,6 +442,8 @@ const UI = {
msg = _("Connected (unencrypted) to ") + UI.desktopName;
}
UI.showStatus(msg);
+ rfb.get_keyboard().set_focused(true);
+ document.getElementById("noVNC_canvas").focus();
break;
case 'disconnecting':
UI.connected = false;
diff --git a/vnc.html b/vnc.html
index 1423f78..ff70e0c 100644
--- a/vnc.html
+++ b/vnc.html
@@ -332,7 +332,7 @@
autocorrect="off" autocomplete="off" spellcheck="false"
mozactionhint="Enter"></textarea>
- <canvas id="noVNC_canvas" width="0" height="0">
+ <canvas id="noVNC_canvas" width="0" height="0" tabindex="0">
Canvas not supported.
</canvas>
</div>
--
2.11.0

View File

@ -1,7 +1,7 @@
From 3f13289a9f895b1ba86ad61ed085390bffda3e3a Mon Sep 17 00:00:00 2001 From d98b4392c64493316f3b7b899772e4411b346ee0 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Fri, 20 Jan 2017 10:55:49 +0100 Date: Fri, 20 Jan 2017 10:55:49 +0100
Subject: [PATCH 9/9] decrease animation time Subject: [PATCH 09/10] decrease animation time
because 0.5s is too long because 0.5s is too long
@ -11,10 +11,10 @@ Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
1 file changed, 6 insertions(+), 6 deletions(-) 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/app/styles/base.css b/app/styles/base.css diff --git a/app/styles/base.css b/app/styles/base.css
index ce31cf7..6db4467 100644 index 344db9b..6e0d8d6 100644
--- a/app/styles/base.css --- a/app/styles/base.css
+++ b/app/styles/base.css +++ b/app/styles/base.css
@@ -283,7 +283,7 @@ select:active { @@ -285,7 +285,7 @@ select:active {
position: fixed; position: fixed;
z-index: 10; z-index: 10;
@ -23,7 +23,7 @@ index ce31cf7..6db4467 100644
/* Edge misrenders animations wihthout this */ /* Edge misrenders animations wihthout this */
transform: translateX(0); transform: translateX(0);
@@ -300,7 +300,7 @@ select:active { @@ -302,7 +302,7 @@ select:active {
position: relative; position: relative;
left: -100%; left: -100%;
@ -32,7 +32,7 @@ index ce31cf7..6db4467 100644
background-color: rgb(110, 132, 163); background-color: rgb(110, 132, 163);
border-radius: 0 10px 10px 0; border-radius: 0 10px 10px 0;
@@ -318,7 +318,7 @@ select:active { @@ -320,7 +320,7 @@ select:active {
height: 100%; height: 100%;
width: 30px; width: 30px;
left: -30px; left: -30px;
@ -41,7 +41,7 @@ index ce31cf7..6db4467 100644
} }
#noVNC_control_bar.noVNC_open::before { #noVNC_control_bar.noVNC_open::before {
box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5); box-shadow: 6px 6px 0px rgba(0, 0, 0, 0.5);
@@ -352,7 +352,7 @@ select:active { @@ -354,7 +354,7 @@ select:active {
} }
#noVNC_control_bar_handle:after { #noVNC_control_bar_handle:after {
content: ""; content: "";
@ -50,7 +50,7 @@ index ce31cf7..6db4467 100644
background: url("../images/handle.svg"); background: url("../images/handle.svg");
position: absolute; position: absolute;
top: 22px; /* (50px-6px)/2 */ top: 22px; /* (50px-6px)/2 */
@@ -440,7 +440,7 @@ select:active { @@ -476,7 +476,7 @@ select:active {
.noVNC_panel { .noVNC_panel {
transform: translateX(25px); transform: translateX(25px);
@ -59,7 +59,7 @@ index ce31cf7..6db4467 100644
max-height: 100vh; /* Chrome is buggy with 100% */ max-height: 100vh; /* Chrome is buggy with 100% */
overflow-x: hidden; overflow-x: hidden;
@@ -617,7 +617,7 @@ select:active { @@ -653,7 +653,7 @@ select:active {
cursor: pointer; cursor: pointer;

View File

@ -1,4 +1,4 @@
From 6d3945c7c0b680a871d789215659f04e42acd6e7 Mon Sep 17 00:00:00 2001 From 821a87411fd75bc1137e99250689f21d820e49ed Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com> From: Dominik Csapak <d.csapak@proxmox.com>
Date: Tue, 16 May 2017 10:36:15 +0200 Date: Tue, 16 May 2017 10:36:15 +0200
Subject: [PATCH 10/10] use only app.js Subject: [PATCH 10/10] use only app.js
@ -12,7 +12,7 @@ Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
1 file changed, 1 insertion(+), 16 deletions(-) 1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/vnc.html b/vnc.html diff --git a/vnc.html b/vnc.html
index ff70e0c..40c726b 100644 index a139e26..46d09d7 100644
--- a/vnc.html --- a/vnc.html
+++ b/vnc.html +++ b/vnc.html
@@ -46,22 +46,7 @@ @@ -46,22 +46,7 @@
@ -34,8 +34,8 @@ index ff70e0c..40c726b 100644
- }); - });
- </script> - </script>
- <!-- actual script modules --> - <!-- actual script modules -->
- <script type="module" src="/novnc/app/ui.js"></script> - <script type="module" crossorigin="anonymous" src="/novnc/app/ui.js"></script>
+ <script src="/novnc/app.js"></script> + <script crossorigin=anonymous" src="/novnc/app.js"></script>
<!-- end scripts --> <!-- end scripts -->
</head> </head>

View File

@ -1,33 +0,0 @@
From d3da00817202a762de5bcd7cf14c38dceb30a301 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Fri, 19 May 2017 08:53:56 +0200
Subject: [PATCH 11/11] add width and height to vncproxy call in console tab
to set the resolution we want
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
app/pve.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/app/pve.js b/app/pve.js
index 668835a..c10df4e 100644
--- a/app/pve.js
+++ b/app/pve.js
@@ -52,6 +52,13 @@ export default function PVEUI(UI){
break;
}
+ if (this.resize == 'scale' &&
+ (this.consoletype === 'lxc' || this.consoletype === 'shell')) {
+ var size = this.getFBSize();
+ params.width = size.width;
+ params.height = size.height;
+ }
+
this.baseUrl = baseUrl;
this.url = url;
this.params = params;
--
2.11.0

View File

@ -1,26 +0,0 @@
From 486e178afc6db131a0b24b18442e5b9fb04f37b0 Mon Sep 17 00:00:00 2001
From: Dominik Csapak <d.csapak@proxmox.com>
Date: Tue, 6 Jun 2017 12:03:49 +0200
Subject: [PATCH 12/12] change higlight color for pressed buttons
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
app/styles/pve.css | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/app/styles/pve.css b/app/styles/pve.css
index 35002fe..eaeb5cb 100644
--- a/app/styles/pve.css
+++ b/app/styles/pve.css
@@ -35,3 +35,8 @@
#noVNC_connect_button {
display: none;
}
+
+:root:not(.noVNC_touch) .noVNC_button.noVNC_selected:hover {
+ border-color: rgba(0, 0, 0, 0.4);
+ background: #5BA8DF;
+}
--
2.11.0

16
debian/patches/series vendored
View File

@ -1,12 +1,10 @@
0001-add-pve-specific-js-code.patch 0001-add-pve-specific-js-code.patch
0002-change-scaling-when-toggling-fullscreen.patch 0002-add-custom-fbresize-event-on-rfb.patch
0003-add-pve-style.patch 0003-change-scaling-when-toggling-fullscreen.patch
0004-remove-vnc-logos.patch 0004-add-pve-style.patch
0005-change-src-directory-for-images-js-files.patch 0005-remove-vnc-logos.patch
0006-add-pve-vnc-commands.patch 0006-change-src-directory-for-images-js-files.patch
0007-add-replaceable-snippets-in-vnc.html.patch 0007-add-pve-vnc-commands.patch
0008-focus-canvas-after-load.patch 0008-add-replaceable-snippets-in-vnc.html.patch
0009-decrease-animation-time.patch 0009-decrease-animation-time.patch
0010-use-only-app.js.patch 0010-use-only-app.js.patch
0011-add-width-and-height-to-vncproxy-call-in-console-tab.patch
0012-change-higlight-color-for-pressed-buttons.patch