]> git.proxmox.com Git - novnc-pve.git/commitdiff
don't require confirmation for starting a stopped vm from button
authorDominik Csapak <d.csapak@proxmox.com>
Wed, 9 Mar 2022 08:26:53 +0000 (09:26 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 26 Apr 2022 13:37:03 +0000 (15:37 +0200)
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>
debian/patches/0018-show-start-button-on-not-running-vm-ct.patch

index 1e9e73d79f628fe2621c4a012f4ee3b92de552c0..162acc4b2624322015d780ae3fd7617fcfb327e3 100644 (file)
@@ -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