[pve-devel] [PATCH novnc 2/4] rebase patches for 1.3.0

Dominik Csapak d.csapak at proxmox.com
Fri Dec 17 11:19:57 CET 2021


Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 .../0001-add-PVE-specific-JS-code.patch       |  26 +--
 ...002-add-custom-fbresize-event-on-rfb.patch |  10 +-
 ...nge-scaling-when-toggling-fullscreen.patch |   6 +-
 debian/patches/0004-add-pve-style.patch       |   8 +-
 debian/patches/0005-remove-vnc-logos.patch    |   8 +-
 ...rectory-for-fetching-images-js-files.patch |  66 ++++----
 .../patches/0007-add-pve-vnc-commands.patch   |   4 +-
 ...add-replaceable-snippets-in-vnc.html.patch |  20 +--
 .../0010-add-localCursor-setting-to-rfb.patch | 155 ++++++++++++++++++
 debian/patches/0010-use-only-app.js.patch     |  19 +--
 .../0011-add-localCursor-setting-to-rfb.patch |  30 ++--
 .../0011-pass-custom-command-to-vnc.patch     |  39 +++++
 ...ove-the-default-value-of-wsProtocols.patch |  48 ++++++
 debian/patches/0013-                          |   0
 ...ove-the-default-value-of-wsProtocols.patch |   6 +-
 ...passing-deprecated-upgrade-parameter.patch |  27 +++
 ...passing-deprecated-upgrade-parameter.patch |   1 -
 ...-create-own-class-for-hidden-buttons.patch |  61 +++++++
 18 files changed, 427 insertions(+), 107 deletions(-)
 create mode 100644 debian/patches/0010-add-localCursor-setting-to-rfb.patch
 create mode 100644 debian/patches/0011-pass-custom-command-to-vnc.patch
 create mode 100644 debian/patches/0012-Revert-Remove-the-default-value-of-wsProtocols.patch
 create mode 100644 debian/patches/0013-
 create mode 100644 debian/patches/0013-avoid-passing-deprecated-upgrade-parameter.patch
 create mode 100644 debian/patches/0014-create-own-class-for-hidden-buttons.patch

diff --git a/debian/patches/0001-add-PVE-specific-JS-code.patch b/debian/patches/0001-add-PVE-specific-JS-code.patch
index 22dffe7..885b092 100644
--- a/debian/patches/0001-add-PVE-specific-JS-code.patch
+++ b/debian/patches/0001-add-PVE-specific-JS-code.patch
@@ -443,7 +443,7 @@ index 0000000..e2c37fb
 +    },
 +};
 diff --git a/app/ui.js b/app/ui.js
-index c70743d..317f845 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..317f845 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..317f845 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..317f845 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..317f845 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..317f845 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..317f845 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..317f845 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..317f845 100644
      },
  
  /* ------^-------
-@@ -997,6 +1010,12 @@ const UI = {
+@@ -998,6 +1011,12 @@ const UI = {
              UI.reconnectPassword = password;
          }
  
@@ -562,7 +562,7 @@ index c70743d..317f845 100644
          if (password === null) {
              password = undefined;
          }
-@@ -1621,9 +1640,36 @@ const UI = {
+@@ -1622,9 +1641,36 @@ const UI = {
  /* ------^-------
   *   /EXTRA KEYS
   * ==============
@@ -601,10 +601,10 @@ index c70743d..317f845 100644
          if (!UI.rfb) return;
          UI.rfb.viewOnly = UI.getSetting('view_only');
 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 @@
                      <li class="noVNC_heading">
                          <img alt="" src="app/images/settings.svg"> Settings
                      </li>
@@ -613,7 +613,7 @@ index 32f356f..5ec354a 100644
                          <label><input id="noVNC_setting_shared" type="checkbox"> Shared Mode</label>
                      </li>
                      <li>
-@@ -181,16 +181,18 @@
+@@ -173,16 +173,18 @@
                      <li>
                          <label><input id="noVNC_setting_view_clip" type="checkbox"> Clip to Window</label>
                      </li>
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 50c3d6e..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 <d.csapak at proxmox.com>
  2 files changed, 21 insertions(+)
 
 diff --git a/app/ui.js b/app/ui.js
-index 317f845..91bdcf4 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 317f845..91bdcf4 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 317f845..91bdcf4 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 f9ec196..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 <d.csapak at proxmox.com>
  1 file changed, 11 insertions(+)
 
 diff --git a/app/ui.js b/app/ui.js
-index 91bdcf4..ef2c77f 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 91bdcf4..ef2c77f 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 @@
      <link rel="apple-touch-icon" sizes="152x152" type="image/png" href="app/images/icons/novnc-152x152.png">
  
      <!-- Stylesheets -->
@@ -75,5 +75,5 @@ index 5ec354a..a49e3a2 100644
 +    <link rel="stylesheet" href="app/styles/base.css" />
 +    <link rel="stylesheet" href="/novnc/app/styles/pve.css" />
  
-     <!-- this is included as a normal file in order to catch script-loading errors as well -->
-     <script src="app/error-handler.js"></script>
+     <!-- Images that will later appear via CSS -->
+     <link rel="preload" as="image" href="app/images/info.svg">
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 <d.csapak at proxmox.com>
  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 -->
-     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+@@ -17,36 +17,10 @@
+ 
+     <meta charset="utf-8">
  
 -    <!-- Icons (see app/images/icons/Makefile for what the sizes are for) -->
 -    <link rel="icon" sizes="16x16" type="image/png" href="app/images/icons/novnc-16x16.png">
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 d14dabc..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 <d.csapak at proxmox.com>
 ---
  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 ef2c77f..1605565 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);
-             })
-@@ -1767,7 +1767,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 @@
      <meta name="apple-mobile-web-app-capable" content="yes" />
      <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
      <!-- Stylesheets -->
@@ -46,24 +46,22 @@ index 12db665..396ded8 100644
 +    <link rel="stylesheet" href="/novnc/app/styles/base.css" />
      <link rel="stylesheet" href="/novnc/app/styles/pve.css" />
  
-     <!-- this is included as a normal file in order to catch script-loading errors as well -->
--    <script src="app/error-handler.js"></script>
-+    <script src="/novnc/app/error-handler.js"></script>
+     <!-- Images that will later appear via CSS -->
+-    <link rel="preload" as="image" href="app/images/info.svg">
+-    <link rel="preload" as="image" href="app/images/error.svg">
+-    <link rel="preload" as="image" href="app/images/warning.svg">
++    <link rel="preload" as="image" href="/novnc/app/images/info.svg">
++    <link rel="preload" as="image" href="/novnc/app/images/error.svg">
++    <link rel="preload" as="image" href="/novnc/app/images/warning.svg">
  
-     <!-- begin scripts -->
-     <!-- promise polyfills promises for IE11 -->
--    <script src="vendor/promise.js"></script>
-+    <script src="/novnc/vendor/promise.js"></script>
-     <!-- ES2015/ES6 modules polyfill -->
--    <script nomodule src="vendor/browser-es-module-loader/dist/browser-es-module-loader.js"></script>
-+    <script nomodule src="/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js"></script>
-     <!-- actual script modules -->
+-    <script src="app/error-handler.js"></script>
 -    <script type="module" crossorigin="anonymous" src="app/ui.js"></script>
++    <script src="/novnc/app/error-handler.js"></script>
 +    <script type="module" crossorigin="anonymous" src="/novnc/app/ui.js"></script>
-     <!-- end scripts -->
  </head>
  
-@@ -63,51 +63,51 @@
+ <body>
+@@ -55,51 +55,51 @@
              <h1 class="noVNC_logo" translate="no"><span>no</span><br>VNC</h1>
  
              <!-- Drag/Pan the viewport -->
@@ -126,7 +124,7 @@ index 12db665..396ded8 100644
                  </div>
                  <input type="button" id="noVNC_shutdown_button" value="Shutdown">
                  <input type="button" id="noVNC_reboot_button" value="Reboot">
-@@ -116,13 +116,13 @@
+@@ -108,13 +108,13 @@
              </div>
  
              <!-- Clipboard -->
@@ -142,7 +140,7 @@ index 12db665..396ded8 100644
                  </div>
                  <textarea id="noVNC_clipboard_text" rows=5></textarea>
                  <br>
-@@ -132,19 +132,19 @@
+@@ -124,19 +124,19 @@
              </div>
  
              <!-- Toggle fullscreen -->
@@ -165,7 +163,7 @@ index 12db665..396ded8 100644
                      </li>
                      <li style="display:none;">
                          <label><input id="noVNC_setting_shared" type="checkbox"> Shared Mode</label>
-@@ -235,7 +235,7 @@
+@@ -227,7 +227,7 @@
              </div>
  
              <!-- Connection Controls -->
@@ -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 @@
          <div id="noVNC_connect_dlg">
              <div class="noVNC_logo" translate="no"><span>no</span>VNC</div>
              <div id="noVNC_connect_button"><div>
@@ -183,7 +181,7 @@ index 12db665..396ded8 100644
              </div></div>
          </div>
      </div>
-@@ -298,8 +298,8 @@
+@@ -290,8 +290,8 @@
      </div>
  
      <audio id="noVNC_bell">
diff --git a/debian/patches/0007-add-pve-vnc-commands.patch b/debian/patches/0007-add-pve-vnc-commands.patch
index a351207..3007692 100644
--- a/debian/patches/0007-add-pve-vnc-commands.patch
+++ b/debian/patches/0007-add-pve-vnc-commands.patch
@@ -9,10 +9,10 @@ Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
  1 file changed, 21 insertions(+)
 
 diff --git a/vnc.html b/vnc.html
-index 396ded8..a0802e0 100644
+index 8ca4ea4..01f71e1 100644
 --- a/vnc.html
 +++ b/vnc.html
-@@ -234,6 +234,27 @@
+@@ -226,6 +226,27 @@
              </div>
              </div>
  
diff --git a/debian/patches/0008-add-replaceable-snippets-in-vnc.html.patch b/debian/patches/0008-add-replaceable-snippets-in-vnc.html.patch
index ba5c9b3..a556f6b 100644
--- a/debian/patches/0008-add-replaceable-snippets-in-vnc.html.patch
+++ b/debian/patches/0008-add-replaceable-snippets-in-vnc.html.patch
@@ -7,11 +7,11 @@ so that we can insert the username/csrftoken via search/replace
 
 Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
 ---
- vnc.html | 10 ++++++++--
- 1 file changed, 8 insertions(+), 2 deletions(-)
+ vnc.html | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
 
 diff --git a/vnc.html b/vnc.html
-index a0802e0..5f09cd2 100644
+index 01f71e1..dc4cc23 100644
 --- a/vnc.html
 +++ b/vnc.html
 @@ -13,7 +13,7 @@
@@ -22,19 +22,17 @@ index a0802e0..5f09cd2 100644
 +    <title>[% nodename %] - Proxmox Console</title>
  
      <meta charset="utf-8">
-     
-@@ -30,7 +30,13 @@
-     <link rel="stylesheet" href="/novnc/app/styles/pve.css" />
  
-     <!-- this is included as a normal file in order to catch script-loading errors as well -->
--    <script src="/novnc/app/error-handler.js"></script>
-+    <script type="text/javascript" src="/novnc/app/error-handler.js"></script>
+@@ -31,6 +31,12 @@
+     <link rel="preload" as="image" href="/novnc/app/images/warning.svg">
+ 
+     <script src="/novnc/app/error-handler.js"></script>
 +    <script type="text/javascript">
 +	if (typeof(PVE) === 'undefined') PVE = {};
 +	PVE.UserName = '[% username %]';
 +	PVE.CSRFPreventionToken = '[% token %]';
 +	INCLUDE_URI='/novnc/include';
 +    </script>
+     <script type="module" crossorigin="anonymous" src="/novnc/app/ui.js"></script>
+ </head>
  
-     <!-- begin scripts -->
-     <!-- promise polyfills promises for IE11 -->
diff --git a/debian/patches/0010-add-localCursor-setting-to-rfb.patch b/debian/patches/0010-add-localCursor-setting-to-rfb.patch
new file mode 100644
index 0000000..587b6e6
--- /dev/null
+++ b/debian/patches/0010-add-localCursor-setting-to-rfb.patch
@@ -0,0 +1,155 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dominik Csapak <d.csapak at proxmox.com>
+Date: Thu, 19 Jul 2018 11:31:51 +0200
+Subject: [PATCH] add localCursor setting to rfb
+
+and use it in app.js (default true)
+
+Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
+Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
+---
+ app/ui.js           | 10 ++++++++++
+ core/rfb.js         | 10 ++++++++++
+ core/util/cursor.js | 15 ++++++++++++++-
+ vnc.html            |  3 +++
+ 4 files changed, 37 insertions(+), 1 deletion(-)
+
+diff --git a/app/ui.js b/app/ui.js
+index f7b7dc4..37a0279 100644
+--- a/app/ui.js
++++ b/app/ui.js
+@@ -172,6 +172,7 @@ const UI = {
+         UI.initSetting('quality', 6);
+         UI.initSetting('compression', 2);
+         UI.initSetting('autoresize', true);
++        UI.initSetting('local_cursor', true);
+         UI.initSetting('shared', true);
+         UI.initSetting('view_only', false);
+         UI.initSetting('show_dot', false);
+@@ -362,6 +363,8 @@ const UI = {
+         UI.addSettingChangeHandler('view_only', UI.updateViewOnly);
+         UI.addSettingChangeHandler('show_dot');
+         UI.addSettingChangeHandler('show_dot', UI.updateShowDotCursor);
++        UI.addSettingChangeHandler('local_cursor');
++        UI.addSettingChangeHandler('local_cursor', UI.updateLocalCursor);
+         UI.addSettingChangeHandler('host');
+         UI.addSettingChangeHandler('port');
+         UI.addSettingChangeHandler('path');
+@@ -1057,6 +1060,7 @@ const UI = {
+         UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
+         UI.rfb.addEventListener("fbresize", UI.updateSessionSize);
+         UI.rfb.clipViewport = UI.getSetting('view_clip');
++        UI.rfb.localCursor = UI.getSetting('local_cursor');
+         UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
+         UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
+         UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
+@@ -1693,6 +1697,12 @@ const UI = {
+  * ==============
+  *     MISC
+  * ------v------*/
++
++    updateLocalCursor() {
++        if (!UI.rfb) return;
++        UI.rfb.localCursor = UI.getSetting('local_cursor');
++    },
++
+     updateViewOnly() {
+         if (!UI.rfb) return;
+         UI.rfb.viewOnly = UI.getSetting('view_only');
+diff --git a/core/rfb.js b/core/rfb.js
+index 90ca28b..ec75610 100644
+--- a/core/rfb.js
++++ b/core/rfb.js
+@@ -256,6 +256,7 @@ export default class RFB extends EventTargetMixin {
+         this._clipViewport = false;
+         this._scaleViewport = false;
+         this._resizeSession = false;
++        this._localCursor = false;
+ 
+         this._showDotCursor = false;
+         if (options.showDotCursor !== undefined) {
+@@ -316,6 +317,15 @@ export default class RFB extends EventTargetMixin {
+         }
+     }
+ 
++    get localCursor() { return this._localCursor; }
++    set localCursor(localCursor) {
++        this._localCursor = localCursor;
++
++        if (this._cursor) {
++            this._cursor.setLocalCursor(localCursor);
++        }
++    }
++
+     get showDotCursor() { return this._showDotCursor; }
+     set showDotCursor(show) {
+         this._showDotCursor = show;
+diff --git a/core/util/cursor.js b/core/util/cursor.js
+index 12bcced..ce7340e 100644
+--- a/core/util/cursor.js
++++ b/core/util/cursor.js
+@@ -12,6 +12,8 @@ export default class Cursor {
+     constructor() {
+         this._target = null;
+ 
++        this._showLocalCursor = false;
++
+         this._canvas = document.createElement('canvas');
+ 
+         if (useFallback) {
+@@ -100,7 +102,7 @@ export default class Cursor {
+     }
+ 
+     clear() {
+-        this._target.style.cursor = 'none';
++        this._target.style.cursor = this._showLocalCursor ? 'default' : 'none';
+         this._canvas.width = 0;
+         this._canvas.height = 0;
+         this._position.x = this._position.x + this._hotSpot.x;
+@@ -130,6 +132,11 @@ export default class Cursor {
+         this._updateVisibility(target);
+     }
+ 
++    setLocalCursor(cursor) {
++        this._showLocalCursor = cursor;
++        this._updateLocalCursor();
++    }
++
+     _handleMouseOver(event) {
+         // This event could be because we're entering the target, or
+         // moving around amongst its sub elements. Let the move handler
+@@ -182,6 +189,11 @@ export default class Cursor {
+         }
+     }
+ 
++    _updateLocalCursor() {
++        if (this._target)
++            this._target.style.cursor = this._showLocalCursor ? 'default' : 'none';
++    }
++
+     _showCursor() {
+         if (this._canvas.style.visibility === 'hidden') {
+             this._canvas.style.visibility = '';
+@@ -240,4 +252,5 @@ export default class Cursor {
+         return document.captureElement &&
+             document.documentElement.contains(document.captureElement);
+     }
++
+ }
+diff --git a/vnc.html b/vnc.html
+index dc4cc23..9de4fd5 100644
+--- a/vnc.html
++++ b/vnc.html
+@@ -154,6 +154,9 @@
+                     <li>
+                         <label><input id="noVNC_setting_view_clip" type="checkbox"> Clip to Window</label>
+                     </li>
++                    <li>
++                        <label><input id="noVNC_setting_local_cursor" type="checkbox" /> Local Cursor</label>
++                    </li>
+                     <li>
+                         <label><input id="noVNC_setting_autoresize" type="checkbox" /> Autoresize Window</label>
+                     </li>
+-- 
+2.30.2
+
diff --git a/debian/patches/0010-use-only-app.js.patch b/debian/patches/0010-use-only-app.js.patch
index 95adac7..7355b7c 100644
--- a/debian/patches/0010-use-only-app.js.patch
+++ b/debian/patches/0010-use-only-app.js.patch
@@ -8,24 +8,19 @@ generated app.js
 
 Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
 ---
- vnc.html | 7 +------
- 1 file changed, 1 insertion(+), 6 deletions(-)
+ vnc.html | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/vnc.html b/vnc.html
-index 5f09cd2..9f594e2 100644
+index dc4cc23..21b3844 100644
 --- a/vnc.html
 +++ b/vnc.html
-@@ -39,12 +39,7 @@
+@@ -37,7 +37,7 @@
+ 	PVE.CSRFPreventionToken = '[% token %]';
+ 	INCLUDE_URI='/novnc/include';
      </script>
- 
-     <!-- begin scripts -->
--    <!-- promise polyfills promises for IE11 -->
--    <script src="/novnc/vendor/promise.js"></script>
--    <!-- ES2015/ES6 modules polyfill -->
--    <script nomodule src="/novnc/vendor/browser-es-module-loader/dist/browser-es-module-loader.js"></script>
--    <!-- actual script modules -->
 -    <script type="module" crossorigin="anonymous" src="/novnc/app/ui.js"></script>
 +    <script crossorigin=anonymous" src="/novnc/app.js"></script>
-     <!-- end scripts -->
  </head>
  
+ <body>
diff --git a/debian/patches/0011-add-localCursor-setting-to-rfb.patch b/debian/patches/0011-add-localCursor-setting-to-rfb.patch
index e0301da..2789889 100644
--- a/debian/patches/0011-add-localCursor-setting-to-rfb.patch
+++ b/debian/patches/0011-add-localCursor-setting-to-rfb.patch
@@ -15,10 +15,10 @@ Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
  4 files changed, 37 insertions(+), 1 deletion(-)
 
 diff --git a/app/ui.js b/app/ui.js
-index d604067..d8126bc 100644
+index f7b7dc4..37a0279 100644
 --- a/app/ui.js
 +++ b/app/ui.js
-@@ -166,6 +166,7 @@ const UI = {
+@@ -172,6 +172,7 @@ const UI = {
          UI.initSetting('quality', 6);
          UI.initSetting('compression', 2);
          UI.initSetting('autoresize', true);
@@ -26,7 +26,7 @@ index d604067..d8126bc 100644
          UI.initSetting('shared', true);
          UI.initSetting('view_only', false);
          UI.initSetting('show_dot', false);
-@@ -356,6 +357,8 @@ const UI = {
+@@ -362,6 +363,8 @@ const UI = {
          UI.addSettingChangeHandler('view_only', UI.updateViewOnly);
          UI.addSettingChangeHandler('show_dot');
          UI.addSettingChangeHandler('show_dot', UI.updateShowDotCursor);
@@ -35,7 +35,7 @@ index d604067..d8126bc 100644
          UI.addSettingChangeHandler('host');
          UI.addSettingChangeHandler('port');
          UI.addSettingChangeHandler('path');
-@@ -1056,6 +1059,7 @@ const UI = {
+@@ -1057,6 +1060,7 @@ const UI = {
          UI.rfb.addEventListener("desktopname", UI.updateDesktopName);
          UI.rfb.addEventListener("fbresize", UI.updateSessionSize);
          UI.rfb.clipViewport = UI.getSetting('view_clip');
@@ -43,7 +43,7 @@ index d604067..d8126bc 100644
          UI.rfb.scaleViewport = UI.getSetting('resize') === 'scale';
          UI.rfb.resizeSession = UI.getSetting('resize') === 'remote';
          UI.rfb.qualityLevel = parseInt(UI.getSetting('quality'));
-@@ -1692,6 +1696,12 @@ const UI = {
+@@ -1693,6 +1697,12 @@ const UI = {
   * ==============
   *     MISC
   * ------v------*/
@@ -57,10 +57,10 @@ index d604067..d8126bc 100644
          if (!UI.rfb) return;
          UI.rfb.viewOnly = UI.getSetting('view_only');
 diff --git a/core/rfb.js b/core/rfb.js
-index 7ea2004..85c7836 100644
+index 90ca28b..ec75610 100644
 --- a/core/rfb.js
 +++ b/core/rfb.js
-@@ -296,6 +296,7 @@ export default class RFB extends EventTargetMixin {
+@@ -256,6 +256,7 @@ export default class RFB extends EventTargetMixin {
          this._clipViewport = false;
          this._scaleViewport = false;
          this._resizeSession = false;
@@ -68,7 +68,7 @@ index 7ea2004..85c7836 100644
  
          this._showDotCursor = false;
          if (options.showDotCursor !== undefined) {
-@@ -356,6 +357,15 @@ export default class RFB extends EventTargetMixin {
+@@ -316,6 +317,15 @@ export default class RFB extends EventTargetMixin {
          }
      }
  
@@ -85,7 +85,7 @@ index 7ea2004..85c7836 100644
      set showDotCursor(show) {
          this._showDotCursor = show;
 diff --git a/core/util/cursor.js b/core/util/cursor.js
-index 4db1dab..e5b1768 100644
+index 12bcced..ce7340e 100644
 --- a/core/util/cursor.js
 +++ b/core/util/cursor.js
 @@ -12,6 +12,8 @@ export default class Cursor {
@@ -97,7 +97,7 @@ index 4db1dab..e5b1768 100644
          this._canvas = document.createElement('canvas');
  
          if (useFallback) {
-@@ -110,7 +112,7 @@ export default class Cursor {
+@@ -100,7 +102,7 @@ export default class Cursor {
      }
  
      clear() {
@@ -106,7 +106,7 @@ index 4db1dab..e5b1768 100644
          this._canvas.width = 0;
          this._canvas.height = 0;
          this._position.x = this._position.x + this._hotSpot.x;
-@@ -140,6 +142,11 @@ export default class Cursor {
+@@ -130,6 +132,11 @@ export default class Cursor {
          this._updateVisibility(target);
      }
  
@@ -118,7 +118,7 @@ index 4db1dab..e5b1768 100644
      _handleMouseOver(event) {
          // This event could be because we're entering the target, or
          // moving around amongst its sub elements. Let the move handler
-@@ -192,6 +199,11 @@ export default class Cursor {
+@@ -182,6 +189,11 @@ export default class Cursor {
          }
      }
  
@@ -130,17 +130,17 @@ index 4db1dab..e5b1768 100644
      _showCursor() {
          if (this._canvas.style.visibility === 'hidden') {
              this._canvas.style.visibility = '';
-@@ -250,4 +262,5 @@ export default class Cursor {
+@@ -240,4 +252,5 @@ export default class Cursor {
          return document.captureElement &&
              document.documentElement.contains(document.captureElement);
      }
 +
  }
 diff --git a/vnc.html b/vnc.html
-index 9f594e2..bf1fde5 100644
+index 21b3844..3e63087 100644
 --- a/vnc.html
 +++ b/vnc.html
-@@ -157,6 +157,9 @@
+@@ -154,6 +154,9 @@
                      <li>
                          <label><input id="noVNC_setting_view_clip" type="checkbox"> Clip to Window</label>
                      </li>
diff --git a/debian/patches/0011-pass-custom-command-to-vnc.patch b/debian/patches/0011-pass-custom-command-to-vnc.patch
new file mode 100644
index 0000000..7bb13ce
--- /dev/null
+++ b/debian/patches/0011-pass-custom-command-to-vnc.patch
@@ -0,0 +1,39 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tim Marx <t.marx at proxmox.com>
+Date: Fri, 21 Dec 2018 11:46:13 +0100
+Subject: [PATCH] pass custom command to vnc
+
+Signed-off-by: Tim Marx <t.marx at proxmox.com>
+Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
+---
+ app/pve.js | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/app/pve.js b/app/pve.js
+index e2c37fb..9cf4b09 100644
+--- a/app/pve.js
++++ b/app/pve.js
+@@ -11,6 +11,7 @@ export default function PVEUI(UI){
+     this.vmname = WebUtil.getQueryVar('vmname');
+     this.nodename = WebUtil.getQueryVar('node');
+     this.resize = WebUtil.getQueryVar('resize');
++    this.cmd = WebUtil.getQueryVar('cmd');
+     this.lastFBWidth = undefined;
+     this.lastFBHeight = undefined;
+     this.sizeUpdateTimer = undefined;
+@@ -46,6 +47,12 @@ export default function PVEUI(UI){
+ 	    url =  baseUrl + '/vncshell';
+ 	    params.upgrade = 1;
+ 	    title = 'System upgrade on node ' + this.nodename;
++	    break;
++	case 'cmd':
++	    url =  baseUrl + '/vncshell';
++	    params.cmd = decodeURI(this.cmd);
++	    title = 'Install Ceph on node ' + this.nodename;
++
+ 	    break;
+ 	default:
+ 	    throw 'implement me';
+-- 
+2.30.2
+
diff --git a/debian/patches/0012-Revert-Remove-the-default-value-of-wsProtocols.patch b/debian/patches/0012-Revert-Remove-the-default-value-of-wsProtocols.patch
new file mode 100644
index 0000000..f5ab5eb
--- /dev/null
+++ b/debian/patches/0012-Revert-Remove-the-default-value-of-wsProtocols.patch
@@ -0,0 +1,48 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Thomas Lamprecht <t.lamprecht at proxmox.com>
+Date: Mon, 17 May 2021 09:43:35 +0200
+Subject: [PATCH] Revert "Remove the default value of wsProtocols"
+
+This reverts commit c912230309806aacbae4295faf7ad6406da97617.
+
+We very-much depend on the WS protocol default of 'binary', for now
+lets just revert it here, albeit it could be externally set..
+
+Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
+Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
+---
+ core/rfb.js | 3 ++-
+ docs/API.md | 3 +--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/core/rfb.js b/core/rfb.js
+index ec75610..96617b9 100644
+--- a/core/rfb.js
++++ b/core/rfb.js
+@@ -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 || '';
+-        this._wsProtocols = options.wsProtocols || [];
++        this._wsProtocols = options.wsProtocols || ['binary'];
++        this._showDotCursor = options.showDotCursor || false;
+ 
+         // Internal state
+         this._rfbConnectionState = '';
+diff --git a/docs/API.md b/docs/API.md
+index aa5aea7..623d685 100644
+--- a/docs/API.md
++++ b/docs/API.md
+@@ -195,8 +195,7 @@ connection to a specified VNC server.
+         encountered.
+ 
+     `wsProtocols`
+-      - An `Array` of `DOMString`s specifying the sub-protocols to use
+-        in the WebSocket connection. Empty by default.
++      - Protocols to use in the WebSocket connection, the default is: ['binary']
+ 
+ #### connect
+ 
+-- 
+2.30.2
+
diff --git a/debian/patches/0013- b/debian/patches/0013-
new file mode 100644
index 0000000..e69de29
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 <t.lamprecht at proxmox.com>
  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/0013-avoid-passing-deprecated-upgrade-parameter.patch b/debian/patches/0013-avoid-passing-deprecated-upgrade-parameter.patch
new file mode 100644
index 0000000..06c5f58
--- /dev/null
+++ b/debian/patches/0013-avoid-passing-deprecated-upgrade-parameter.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Fabian Ebner <f.ebner at proxmox.com>
+Date: Fri, 4 Jun 2021 08:27:23 +0200
+Subject: [PATCH] avoid passing deprecated 'upgrade' parameter
+
+Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
+Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
+---
+ app/pve.js | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/app/pve.js b/app/pve.js
+index 9cf4b09..0ab825a 100644
+--- a/app/pve.js
++++ b/app/pve.js
+@@ -45,7 +45,7 @@ export default function PVEUI(UI){
+ 	    break;
+ 	case 'upgrade':
+ 	    url =  baseUrl + '/vncshell';
+-	    params.upgrade = 1;
++	    params.cmd = 'upgrade';
+ 	    title = 'System upgrade on node ' + this.nodename;
+ 	    break;
+ 	case 'cmd':
+-- 
+2.30.2
+
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/debian/patches/0014-create-own-class-for-hidden-buttons.patch b/debian/patches/0014-create-own-class-for-hidden-buttons.patch
new file mode 100644
index 0000000..41cdecb
--- /dev/null
+++ b/debian/patches/0014-create-own-class-for-hidden-buttons.patch
@@ -0,0 +1,61 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dominik Csapak <d.csapak at proxmox.com>
+Date: Thu, 16 Dec 2021 14:31:20 +0100
+Subject: [PATCH] create own class for hidden buttons
+
+since novnc itself sometimes triggers a removal of their '_hidden'
+class, even if we hid it. This way the buttons stay hidden even then.
+
+Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
+---
+ app/pve.js         | 8 ++++----
+ app/styles/pve.css | 4 ++++
+ 2 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/app/pve.js b/app/pve.js
+index 0ab825a..486bd5c 100644
+--- a/app/pve.js
++++ b/app/pve.js
+@@ -293,15 +293,15 @@ PVEUI.prototype = {
+ 
+ 	// show/hide the buttons
+ 	document.getElementById('noVNC_disconnect_button')
+-	    .classList.add('noVNC_hidden');
++	    .classList.add('pve_hidden');
+ 	if (me.consoletype === 'kvm') {
+ 	    document.getElementById('noVNC_clipboard_button')
+-		.classList.add('noVNC_hidden');
++		.classList.add('pve_hidden');
+ 	}
+ 
+ 	if (me.consoletype === 'shell' || me.consoletype === 'upgrade') {
+ 	    document.getElementById('pve_commands_button')
+-		.classList.add('noVNC_hidden');
++		.classList.add('pve_hidden');
+ 	}
+ 
+ 	// add command logic
+@@ -326,7 +326,7 @@ PVEUI.prototype = {
+ 		    me.pve_vm_command(item.cmd);
+ 		};
+ 	    } else {
+-		el.classList.add('noVNC_hidden');
++		el.classList.add('pve_hidden');
+ 	    }
+ 	});
+     },
+diff --git a/app/styles/pve.css b/app/styles/pve.css
+index eaeb5cb..18126b0 100644
+--- a/app/styles/pve.css
++++ b/app/styles/pve.css
+@@ -40,3 +40,7 @@
+   border-color: rgba(0, 0, 0, 0.4);
+   background: #5BA8DF;
+ }
++
++.noVNC_button.pve_hidden {
++  display: none;
++}
+-- 
+2.30.2
+
-- 
2.30.2






More information about the pve-devel mailing list