From: Dominik Csapak Date: Fri, 17 Dec 2021 10:19:56 +0000 (+0100) Subject: upgrade novnc and patches to 1.3.0 X-Git-Url: https://git.proxmox.com/?p=novnc-pve.git;a=commitdiff_plain;h=e5e5987430e1eae5d8c52b5bc3a675b60b874ad2 upgrade novnc and patches to 1.3.0 rebase patches for 1.3.0 Signed-off-by: Dominik Csapak [ T: address gone-wrong rebase and missed push ] Signed-off-by: Thomas Lamprecht --- diff --git a/debian/patches/0001-add-PVE-specific-JS-code.patch b/debian/patches/0001-add-PVE-specific-JS-code.patch index 7800ada..885b092 100644 --- a/debian/patches/0001-add-PVE-specific-JS-code.patch +++ b/debian/patches/0001-add-PVE-specific-JS-code.patch @@ -13,9 +13,9 @@ Signed-off-by: Dominik Csapak Signed-off-by: Thomas Lamprecht --- app/pve.js | 418 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - app/ui.js | 75 ++++++++-- + app/ui.js | 66 +++++++-- vnc.html | 10 +- - 3 files changed, 487 insertions(+), 16 deletions(-) + 3 files changed, 480 insertions(+), 14 deletions(-) create mode 100644 app/pve.js diff --git a/app/pve.js b/app/pve.js @@ -443,7 +443,7 @@ index 0000000..e2c37fb + }, +}; diff --git a/app/ui.js b/app/ui.js -index c70743d..cae2b57 100644 +index cb6a9fd..6b4442f 100644 --- a/app/ui.js +++ b/app/ui.js @@ -16,6 +16,7 @@ import keysyms from "../core/input/keysymdef.js"; @@ -463,7 +463,7 @@ index c70743d..cae2b57 100644 UI.initSettings(); // Translate the DOM -@@ -94,6 +97,9 @@ const UI = { +@@ -100,6 +103,9 @@ const UI = { UI.addConnectionControlHandlers(); UI.addClipboardHandlers(); UI.addSettingsHandlers(); @@ -473,7 +473,7 @@ index c70743d..cae2b57 100644 document.getElementById("noVNC_status") .addEventListener('click', UI.hideStatus); -@@ -102,19 +108,15 @@ const UI = { +@@ -108,19 +114,15 @@ const UI = { UI.openControlbar(); @@ -497,7 +497,7 @@ index c70743d..cae2b57 100644 return Promise.resolve(UI.rfb); }, -@@ -158,11 +160,12 @@ const UI = { +@@ -164,11 +166,12 @@ const UI = { /* Populate the controls if defaults are provided in the URL */ UI.initSetting('host', window.location.hostname); UI.initSetting('port', port); @@ -511,7 +511,7 @@ index c70743d..cae2b57 100644 UI.initSetting('shared', true); UI.initSetting('view_only', false); UI.initSetting('show_dot', false); -@@ -341,6 +344,7 @@ const UI = { +@@ -347,6 +350,7 @@ const UI = { UI.addSettingChangeHandler('resize'); UI.addSettingChangeHandler('resize', UI.applyResizeMode); UI.addSettingChangeHandler('resize', UI.updateViewClip); @@ -519,7 +519,7 @@ index c70743d..cae2b57 100644 UI.addSettingChangeHandler('quality'); UI.addSettingChangeHandler('quality', UI.updateQuality); UI.addSettingChangeHandler('compression'); -@@ -395,6 +399,9 @@ const UI = { +@@ -401,6 +405,9 @@ const UI = { document.documentElement.classList.add("noVNC_connecting"); break; case 'connected': @@ -529,7 +529,7 @@ index c70743d..cae2b57 100644 document.documentElement.classList.add("noVNC_connected"); break; case 'disconnecting': -@@ -402,6 +409,11 @@ const UI = { +@@ -408,6 +415,11 @@ const UI = { document.documentElement.classList.add("noVNC_disconnecting"); break; case 'disconnected': @@ -541,7 +541,7 @@ index c70743d..cae2b57 100644 break; case 'reconnecting': transitionElem.textContent = _("Reconnecting..."); -@@ -820,6 +832,7 @@ const UI = { +@@ -821,6 +833,7 @@ const UI = { UI.closePowerPanel(); UI.closeClipboardPanel(); UI.closeExtraKeys(); @@ -549,7 +549,7 @@ index c70743d..cae2b57 100644 }, /* ------^------- -@@ -997,6 +1010,12 @@ const UI = { +@@ -998,6 +1011,12 @@ const UI = { UI.reconnectPassword = password; } @@ -562,7 +562,7 @@ index c70743d..cae2b57 100644 if (password === null) { password = undefined; } -@@ -1621,12 +1640,42 @@ const UI = { +@@ -1622,9 +1641,36 @@ const UI = { /* ------^------- * /EXTRA KEYS * ============== @@ -600,30 +600,11 @@ index c70743d..cae2b57 100644 updateViewOnly() { if (!UI.rfb) return; UI.rfb.viewOnly = UI.getSetting('view_only'); -+ if (!UI.PVE) return; -+ -+ let kvm = UI.PVE.consoletype === 'kvm'; - - // Hide input related buttons in view only mode - if (UI.rfb.viewOnly) { -@@ -1641,8 +1690,10 @@ const UI = { - .classList.remove('noVNC_hidden'); - document.getElementById('noVNC_toggle_extra_keys_button') - .classList.remove('noVNC_hidden'); -- document.getElementById('noVNC_clipboard_button') -- .classList.remove('noVNC_hidden'); -+ if (!kvm) { -+ document.getElementById('noVNC_clipboard_button') -+ .classList.remove('noVNC_hidden'); -+ } - } - }, - diff --git a/vnc.html b/vnc.html -index 32f356f..5ec354a 100644 +index 8d4b497..7ce9ba7 100644 --- a/vnc.html +++ b/vnc.html -@@ -171,7 +171,7 @@ +@@ -163,7 +163,7 @@
  • Settings
  • @@ -632,7 +613,7 @@ index 32f356f..5ec354a 100644
  • -@@ -181,16 +181,18 @@ +@@ -173,16 +173,18 @@
  • diff --git a/debian/patches/0002-add-custom-fbresize-event-on-rfb.patch b/debian/patches/0002-add-custom-fbresize-event-on-rfb.patch index d4bc62b..48de338 100644 --- a/debian/patches/0002-add-custom-fbresize-event-on-rfb.patch +++ b/debian/patches/0002-add-custom-fbresize-event-on-rfb.patch @@ -13,10 +13,10 @@ Signed-off-by: Dominik Csapak 2 files changed, 21 insertions(+) diff --git a/app/ui.js b/app/ui.js -index cae2b57..fdae7a2 100644 +index 6b4442f..11fad2d 100644 --- a/app/ui.js +++ b/app/ui.js -@@ -1054,6 +1054,7 @@ const UI = { +@@ -1055,6 +1055,7 @@ const UI = { UI.rfb.addEventListener("clipboard", UI.clipboardReceive); UI.rfb.addEventListener("bell", UI.bell); UI.rfb.addEventListener("desktopname", UI.updateDesktopName); @@ -24,7 +24,7 @@ index cae2b57..fdae7a2 100644 UI.rfb.clipViewport = UI.getSetting('view_clip'); UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale'; UI.rfb.resizeSession = UI.getSetting('resize') === 'remote'; -@@ -1665,6 +1666,16 @@ const UI = { +@@ -1666,6 +1667,16 @@ const UI = { document.getElementById('pve_commands_button').classList.remove("noVNC_selected"); }, @@ -42,10 +42,10 @@ index cae2b57..fdae7a2 100644 * /PVE * ============== diff --git a/core/rfb.js b/core/rfb.js -index f35d503..7ea2004 100644 +index ea3bf58..90ca28b 100644 --- a/core/rfb.js +++ b/core/rfb.js -@@ -2492,6 +2492,16 @@ export default class RFB extends EventTargetMixin { +@@ -2499,6 +2499,16 @@ export default class RFB extends EventTargetMixin { this._updateClip(); this._updateScale(); diff --git a/debian/patches/0003-change-scaling-when-toggling-fullscreen.patch b/debian/patches/0003-change-scaling-when-toggling-fullscreen.patch index a777e2f..4b7d4b9 100644 --- a/debian/patches/0003-change-scaling-when-toggling-fullscreen.patch +++ b/debian/patches/0003-change-scaling-when-toggling-fullscreen.patch @@ -12,10 +12,10 @@ Signed-off-by: Dominik Csapak 1 file changed, 11 insertions(+) diff --git a/app/ui.js b/app/ui.js -index fdae7a2..7237d00 100644 +index 11fad2d..b40d1f8 100644 --- a/app/ui.js +++ b/app/ui.js -@@ -1239,6 +1239,13 @@ const UI = { +@@ -1240,6 +1240,13 @@ const UI = { } else if (document.msExitFullscreen) { document.msExitFullscreen(); } @@ -29,7 +29,7 @@ index fdae7a2..7237d00 100644 } else { if (document.documentElement.requestFullscreen) { document.documentElement.requestFullscreen(); -@@ -1249,7 +1256,11 @@ const UI = { +@@ -1250,7 +1257,11 @@ const UI = { } else if (document.body.msRequestFullscreen) { document.body.msRequestFullscreen(); } diff --git a/debian/patches/0004-add-pve-style.patch b/debian/patches/0004-add-pve-style.patch index 1a44edf..f704814 100644 --- a/debian/patches/0004-add-pve-style.patch +++ b/debian/patches/0004-add-pve-style.patch @@ -64,10 +64,10 @@ index 0000000..eaeb5cb + background: #5BA8DF; +} diff --git a/vnc.html b/vnc.html -index 5ec354a..a49e3a2 100644 +index 7ce9ba7..61d0fdd 100644 --- a/vnc.html +++ b/vnc.html -@@ -52,7 +52,8 @@ +@@ -48,7 +48,8 @@ @@ -75,5 +75,5 @@ index 5ec354a..a49e3a2 100644 + + - - + + diff --git a/debian/patches/0005-remove-vnc-logos.patch b/debian/patches/0005-remove-vnc-logos.patch index dae5b78..6464751 100644 --- a/debian/patches/0005-remove-vnc-logos.patch +++ b/debian/patches/0005-remove-vnc-logos.patch @@ -11,12 +11,12 @@ Signed-off-by: Dominik Csapak 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/vnc.html b/vnc.html -index a49e3a2..12db665 100644 +index 61d0fdd..216b33f 100644 --- a/vnc.html +++ b/vnc.html -@@ -21,36 +21,10 @@ - Remove this if you use the .htaccess --> - +@@ -17,36 +17,10 @@ + + - - diff --git a/debian/patches/0006-change-source-directory-for-fetching-images-js-files.patch b/debian/patches/0006-change-source-directory-for-fetching-images-js-files.patch index 872fdef..88e1514 100644 --- a/debian/patches/0006-change-source-directory-for-fetching-images-js-files.patch +++ b/debian/patches/0006-change-source-directory-for-fetching-images-js-files.patch @@ -9,36 +9,36 @@ also change the directory in the build script Signed-off-by: Dominik Csapak --- app/ui.js | 4 ++-- - vnc.html | 50 +++++++++++++++++++++++++------------------------- - 2 files changed, 27 insertions(+), 27 deletions(-) + vnc.html | 52 ++++++++++++++++++++++++++-------------------------- + 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/app/ui.js b/app/ui.js -index 7237d00..17e86a7 100644 +index b40d1f8..f7b7dc4 100644 --- a/app/ui.js +++ b/app/ui.js @@ -64,7 +64,7 @@ const UI = { // Translate the DOM l10n.translateDOM(); -- WebUtil.fetchJSON('./package.json') -+ WebUtil.fetchJSON('/novnc/package.json') - .then((packageInfo) => { - Array.from(document.getElementsByClassName('noVNC_version')).forEach(el => el.innerText = packageInfo.version); - }) -@@ -1772,7 +1772,7 @@ l10n.setup(LINGUAS); +- fetch('./package.json') ++ fetch('/novnc/package.json') + .then((response) => { + if (!response.ok) { + throw Error("" + response.status + " " + response.statusText); +@@ -1768,7 +1768,7 @@ l10n.setup(LINGUAS); if (l10n.language === "en" || l10n.dictionary !== undefined) { UI.prime(); } else { -- WebUtil.fetchJSON('app/locale/' + l10n.language + '.json') -+ WebUtil.fetchJSON('/novnc/app/locale/' + l10n.language + '.json') - .then((translations) => { l10n.dictionary = translations; }) - .catch(err => Log.Error("Failed to load translations: " + err)) - .then(UI.prime); +- fetch('app/locale/' + l10n.language + '.json') ++ fetch('/novnc/app/locale/' + l10n.language + '.json') + .then((response) => { + if (!response.ok) { + throw Error("" + response.status + " " + response.statusText); diff --git a/vnc.html b/vnc.html -index 12db665..396ded8 100644 +index 216b33f..8ca4ea4 100644 --- a/vnc.html +++ b/vnc.html -@@ -26,19 +26,19 @@ +@@ -22,16 +22,16 @@ @@ -46,24 +46,22 @@ index 12db665..396ded8 100644 + - -- -+ + +- +- +- ++ ++ ++ - - -- -+ - -- -+ - +- - ++ + - -@@ -63,51 +63,51 @@ + +@@ -55,51 +55,51 @@

    no
    VNC

    @@ -126,7 +124,7 @@ index 12db665..396ded8 100644 -@@ -116,13 +116,13 @@ +@@ -108,13 +108,13 @@ @@ -142,7 +140,7 @@ index 12db665..396ded8 100644
    -@@ -132,19 +132,19 @@ +@@ -124,19 +124,19 @@ @@ -165,7 +163,7 @@ index 12db665..396ded8 100644
  • -@@ -235,7 +235,7 @@ +@@ -227,7 +227,7 @@ @@ -174,7 +172,7 @@ index 12db665..396ded8 100644 id="noVNC_disconnect_button" class="noVNC_button" title="Disconnect"> -@@ -254,7 +254,7 @@ +@@ -246,7 +246,7 @@
    @@ -183,7 +181,7 @@ index 12db665..396ded8 100644
    -@@ -298,8 +298,8 @@ +@@ -290,8 +290,8 @@
  • diff --git a/debian/patches/0013-Revert-Remove-the-default-value-of-wsProtocols.patch b/debian/patches/0013-Revert-Remove-the-default-value-of-wsProtocols.patch index e73bc59..d96976b 100644 --- a/debian/patches/0013-Revert-Remove-the-default-value-of-wsProtocols.patch +++ b/debian/patches/0013-Revert-Remove-the-default-value-of-wsProtocols.patch @@ -15,10 +15,10 @@ Signed-off-by: Thomas Lamprecht 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/rfb.js b/core/rfb.js -index 85c7836..f049246 100644 +index ec75610..96617b9 100644 --- a/core/rfb.js +++ b/core/rfb.js -@@ -87,7 +87,8 @@ export default class RFB extends EventTargetMixin { +@@ -91,7 +91,8 @@ export default class RFB extends EventTargetMixin { this._rfbCredentials = options.credentials || {}; this._shared = 'shared' in options ? !!options.shared : true; this._repeaterID = options.repeaterID || ''; @@ -29,7 +29,7 @@ index 85c7836..f049246 100644 // Internal state this._rfbConnectionState = ''; diff --git a/docs/API.md b/docs/API.md -index d78360a..d55a234 100644 +index aa5aea7..623d685 100644 --- a/docs/API.md +++ b/docs/API.md @@ -195,8 +195,7 @@ connection to a specified VNC server. diff --git a/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch b/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch index 3e03c2a..b84a5c3 100644 --- a/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch +++ b/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch @@ -21,4 +21,3 @@ index 9cf4b09..0ab825a 100644 title = 'System upgrade on node ' + this.nodename; break; case 'cmd': - diff --git a/novnc b/novnc index 9142f8f..463c39e 160000 --- a/novnc +++ b/novnc @@ -1 +1 @@ -Subproject commit 9142f8f0f7b4a53447f5cfec3a797cbf0d6204a9 +Subproject commit 463c39e4af98ec4106b87bbea17e1605aa4c6180