[pve-devel] r5963 - in pve-manager/pve2/www/new: . qemu

svn-commits at proxmox.com svn-commits at proxmox.com
Wed May 11 13:03:40 CEST 2011


Author: dietmar
Date: 2011-05-11 13:03:40 +0200 (Wed, 11 May 2011)
New Revision: 5963

Modified:
   pve-manager/pve2/www/new/VNCConsole.js
   pve-manager/pve2/www/new/qemu/Config.js
Log:
confirm shutdown


Modified: pve-manager/pve2/www/new/VNCConsole.js
===================================================================
--- pve-manager/pve2/www/new/VNCConsole.js	2011-05-11 11:00:48 UTC (rev 5962)
+++ pve-manager/pve2/www/new/VNCConsole.js	2011-05-11 11:03:40 UTC (rev 5963)
@@ -224,11 +224,14 @@
 	    { 
 		text: 'Shutdown',
 		handler: function() {
-		    // normally, the OS ask the user, so we do not 
-		    // need a confirm here
-		    vm_command("shutdown"); 
-		}
-	    },
+		    var msg = "Do you really want to shutdown the VM?";
+		    Ext.Msg.confirm('Confirm', msg, function(btn) {
+			if (btn !== 'yes')
+			    return;
+			vm_command('shutdown');
+		    });
+		}			    
+	    }, 
 	    { 
 		text: 'Suspend',
 		handler: function() {

Modified: pve-manager/pve2/www/new/qemu/Config.js
===================================================================
--- pve-manager/pve2/www/new/qemu/Config.js	2011-05-11 11:00:48 UTC (rev 5962)
+++ pve-manager/pve2/www/new/qemu/Config.js	2011-05-11 11:03:40 UTC (rev 5963)
@@ -71,7 +71,12 @@
 			{ 
 			    text: 'Shutdown',
 			    handler: function() {
-				vm_command('shutdown');
+				var msg = "Do you really want to shutdown the VM?";
+				Ext.Msg.confirm('Confirm', msg, function(btn) {
+				    if (btn !== 'yes')
+					return;
+				    vm_command('shutdown');
+				});
 			    }			    
 			}, 
 			{ 




More information about the pve-devel mailing list