From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id DFD0D62B1B for ; Tue, 22 Feb 2022 16:33:52 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id DDC8726281 for ; Tue, 22 Feb 2022 16:33:52 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id DA75A26278 for ; Tue, 22 Feb 2022 16:33:51 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id B37C546335 for ; Tue, 22 Feb 2022 16:33:51 +0100 (CET) From: Dominik Csapak To: pve-devel@lists.proxmox.com Date: Tue, 22 Feb 2022 16:33:50 +0100 Message-Id: <20220222153350.1808592-1-d.csapak@proxmox.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.155 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pve-devel] [PATCH novnc] parse error 'already started' on guest start X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2022 15:33:52 -0000 when we start an already started container, we get an error instead of a task that fails so to have similar behaviour between vm and ct, we parse that error for the start command and behave like it was successful put it in the first patch and rebase the rest of them Signed-off-by: Dominik Csapak --- .../0001-add-PVE-specific-JS-code.patch | 19 ++++++++++++++----- .../0012-pass-custom-command-to-vnc.patch | 2 +- ...passing-deprecated-upgrade-parameter.patch | 2 +- ...-create-own-class-for-hidden-buttons.patch | 6 +++--- ...-button-on-isFullscreen-get-variable.patch | 4 ++-- ...ow-start-button-on-not-running-vm-ct.patch | 8 ++++---- 6 files changed, 25 insertions(+), 16 deletions(-) diff --git a/debian/patches/0001-add-PVE-specific-JS-code.patch b/debian/patches/0001-add-PVE-specific-JS-code.patch index 885b092..f1cd8da 100644 --- a/debian/patches/0001-add-PVE-specific-JS-code.patch +++ b/debian/patches/0001-add-PVE-specific-JS-code.patch @@ -12,18 +12,18 @@ for `autoresizing`, `commandstoggle`, etc., get setup. Signed-off-by: Dominik Csapak Signed-off-by: Thomas Lamprecht --- - app/pve.js | 418 +++++++++++++++++++++++++++++++++++++++++++++++++++++ + app/pve.js | 427 +++++++++++++++++++++++++++++++++++++++++++++++++++++ app/ui.js | 66 +++++++-- vnc.html | 10 +- - 3 files changed, 480 insertions(+), 14 deletions(-) + 3 files changed, 489 insertions(+), 14 deletions(-) create mode 100644 app/pve.js diff --git a/app/pve.js b/app/pve.js new file mode 100644 -index 0000000..e2c37fb +index 0000000..e3c7758 --- /dev/null +++ b/app/pve.js -@@ -0,0 +1,418 @@ +@@ -0,0 +1,427 @@ +/* + * PVE Utility functions for noVNC + * Copyright (C) 2017 Proxmox GmbH @@ -292,7 +292,16 @@ index 0000000..e2c37fb + url: baseUrl + "/status/" + cmd, + method: 'POST', + failure: function(msg) { -+ me.UI.showStatus(msg, 'warning'); ++ if (cmd === 'start' && msg.match(/already running/) !== null) { ++ // we wanted to start, but it was already running, so ++ // reload anyway ++ me.UI.showStatus("VM command '" + cmd +"' successful", 'normal'); ++ setTimeout(function() { ++ location.reload(); ++ }, 1000); ++ } else { ++ me.UI.showStatus(msg, 'warning'); ++ } + }, + success: function() { + me.UI.showStatus("VM command '" + cmd +"' successful", 'normal'); diff --git a/debian/patches/0012-pass-custom-command-to-vnc.patch b/debian/patches/0012-pass-custom-command-to-vnc.patch index b3aca0c..7c993e9 100644 --- a/debian/patches/0012-pass-custom-command-to-vnc.patch +++ b/debian/patches/0012-pass-custom-command-to-vnc.patch @@ -10,7 +10,7 @@ Signed-off-by: Dominik Csapak 1 file changed, 7 insertions(+) diff --git a/app/pve.js b/app/pve.js -index e2c37fb..9cf4b09 100644 +index e3c7758..446b85d 100644 --- a/app/pve.js +++ b/app/pve.js @@ -11,6 +11,7 @@ export default function PVEUI(UI){ diff --git a/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch b/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch index b84a5c3..7758e4a 100644 --- a/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch +++ b/debian/patches/0014-avoid-passing-deprecated-upgrade-parameter.patch @@ -9,7 +9,7 @@ Signed-off-by: Fabian Ebner 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/pve.js b/app/pve.js -index 9cf4b09..0ab825a 100644 +index 446b85d..dfff1b0 100644 --- a/app/pve.js +++ b/app/pve.js @@ -45,7 +45,7 @@ export default function PVEUI(UI){ diff --git a/debian/patches/0015-create-own-class-for-hidden-buttons.patch b/debian/patches/0015-create-own-class-for-hidden-buttons.patch index 76bc2cb..ebfbb26 100644 --- a/debian/patches/0015-create-own-class-for-hidden-buttons.patch +++ b/debian/patches/0015-create-own-class-for-hidden-buttons.patch @@ -13,10 +13,10 @@ Signed-off-by: Dominik Csapak 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/pve.js b/app/pve.js -index 0ab825a..486bd5c 100644 +index dfff1b0..4774e3a 100644 --- a/app/pve.js +++ b/app/pve.js -@@ -293,15 +293,15 @@ PVEUI.prototype = { +@@ -302,15 +302,15 @@ PVEUI.prototype = { // show/hide the buttons document.getElementById('noVNC_disconnect_button') @@ -35,7 +35,7 @@ index 0ab825a..486bd5c 100644 } // add command logic -@@ -326,7 +326,7 @@ PVEUI.prototype = { +@@ -335,7 +335,7 @@ PVEUI.prototype = { me.pve_vm_command(item.cmd); }; } else { diff --git a/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch b/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch index 1cdafd2..bb4dc78 100644 --- a/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch +++ b/debian/patches/0016-hide-fullscreen-button-on-isFullscreen-get-variable.patch @@ -13,7 +13,7 @@ Signed-off-by: Dominik Csapak 1 file changed, 7 insertions(+) diff --git a/app/pve.js b/app/pve.js -index 486bd5c..042eb7c 100644 +index 4774e3a..583a406 100644 --- a/app/pve.js +++ b/app/pve.js @@ -12,6 +12,7 @@ export default function PVEUI(UI){ @@ -24,7 +24,7 @@ index 486bd5c..042eb7c 100644 this.lastFBWidth = undefined; this.lastFBHeight = undefined; this.sizeUpdateTimer = undefined; -@@ -304,6 +305,12 @@ PVEUI.prototype = { +@@ -313,6 +314,12 @@ PVEUI.prototype = { .classList.add('pve_hidden'); } diff --git a/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch b/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch index 8531922..1e9e73d 100644 --- a/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch +++ b/debian/patches/0018-show-start-button-on-not-running-vm-ct.patch @@ -19,10 +19,10 @@ Signed-off-by: Dominik Csapak 3 files changed, 99 insertions(+), 2 deletions(-) diff --git a/app/pve.js b/app/pve.js -index 042eb7c..9da23ed 100644 +index 583a406..8144fdb 100644 --- a/app/pve.js +++ b/app/pve.js -@@ -311,6 +311,11 @@ PVEUI.prototype = { +@@ -320,6 +320,11 @@ PVEUI.prototype = { .classList.add('pve_hidden'); } @@ -34,7 +34,7 @@ index 042eb7c..9da23ed 100644 // add command logic var commandArray = [ { cmd: 'start', kvm: 1, lxc: 1}, -@@ -359,8 +364,8 @@ PVEUI.prototype = { +@@ -368,8 +373,8 @@ PVEUI.prototype = { return { width: ow, height: oh }; }, @@ -45,7 +45,7 @@ index 042eb7c..9da23ed 100644 me.API2Request({ url: me.url, method: 'POST', -@@ -382,6 +387,31 @@ PVEUI.prototype = { +@@ -391,6 +396,31 @@ PVEUI.prototype = { }); }, -- 2.30.2