From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH novnc] don't require confirmation for starting a stopped vm from button
Date: Wed, 9 Mar 2022 09:26:53 +0100 [thread overview]
Message-ID: <20220309082653.834032-1-d.csapak@proxmox.com> (raw)
when the vm is stopped and the user clicks on the 'start now' button,
there really is no need for confirmation again
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
...ow-start-button-on-not-running-vm-ct.patch | 26 ++++++++++++++++---
1 file changed, 22 insertions(+), 4 deletions(-)
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 1e9e73d..162acc4 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
@@ -13,22 +13,40 @@ colors were adapted
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
- app/pve.js | 34 +++++++++++++++++++++++++--
+ app/pve.js | 38 ++++++++++++++++++++++++++----
app/styles/pve.css | 58 ++++++++++++++++++++++++++++++++++++++++++++++
vnc.html | 9 +++++++
- 3 files changed, 99 insertions(+), 2 deletions(-)
+ 3 files changed, 101 insertions(+), 4 deletions(-)
diff --git a/app/pve.js b/app/pve.js
-index 583a406..8144fdb 100644
+index 583a406..3eeaa47 100644
--- a/app/pve.js
+++ b/app/pve.js
+@@ -231,7 +231,7 @@ PVEUI.prototype = {
+
+ },
+
+- pve_vm_command: function(cmd, params, reload) {
++ pve_vm_command: function(cmd, params, reload, mustConfirm = true) {
+ var me = this;
+ var baseUrl;
+ var confirmMsg = "";
+@@ -255,7 +255,7 @@ PVEUI.prototype = {
+
+ confirmMsg = confirmMsg.replace('{0}', me.vmid);
+
+- if (confirmMsg !== "" && confirm(confirmMsg) !== true) {
++ if (confirmMsg !== "" && mustConfirm && confirm(confirmMsg) !== true) {
+ return;
+ }
+
@@ -320,6 +320,11 @@ PVEUI.prototype = {
.classList.add('pve_hidden');
}
+ document.getElementById("pve_start_button")
+ .addEventListener('click', function() {
-+ me.pve_vm_command('start');
++ me.pve_vm_command('start', {}, undefined, false);
+ });
+
// add command logic
--
2.30.2
next reply other threads:[~2022-03-09 8:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 8:26 Dominik Csapak [this message]
2022-04-25 14:27 ` Dominik Csapak
2022-04-26 14:04 ` [pve-devel] applied: " Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220309082653.834032-1-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal