[pve-devel] [PATCH pve-manager v2] Do not use the term 'VM' as a generic name for containers and qemu VMs

Emmanuel Kasper e.kasper at proxmox.com
Mon Mar 21 15:50:32 CET 2016


and get the Window text to display from the calling function
---
 www/manager6/lxc/Config.js         | 11 +++++++++--
 www/manager6/qemu/Config.js        | 10 ++++++++--
 www/manager6/window/SafeDestroy.js | 12 ++++++------
 3 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 1eafdb5..493ec74 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -88,9 +88,16 @@ Ext.define('PVE.lxc.Config', {
 	    text: gettext('Remove'),
 	    disabled: !caps.vms['VM.Allocate'],
 	    handler: function() {
+
+		var msg = Ext.String.format(gettext('Are you sure you want to remove CT {0} ? This will permanently erase everything in this CT.'),
+		    vmid);
+		var inputLabel = gettext('Please enter the CT ID to confirm');
+
 		Ext.create('PVE.window.SafeDestroy', {
-		    vmid: vmid,
-		    base_url: base_url
+		    base_url: base_url,
+		    inputLabel: inputLabel,
+		    msg: msg,
+		    vmid: vmid
 		}).show();
 	    }
 	});
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index dce4792..b616cae 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -99,9 +99,15 @@ Ext.define('PVE.qemu.Config', {
 	    text: gettext('Remove'),
 	    disabled: !caps.vms['VM.Allocate'],
 	    handler: function() {
+		var msg = Ext.String.format(gettext('Are you sure you want to remove VM {0} ? This will permanently erase everything in this VM.'),
+		    vmid);
+		var inputLabel = gettext('Please enter the VM ID to confirm');
+
 		Ext.create('PVE.window.SafeDestroy', {
-		    vmid: vmid,
-		    base_url: base_url
+		    base_url: base_url,
+		    inputLabel: inputLabel,
+		    msg: msg,
+		    vmid: vmid
 		}).show();
 	    }
 	});
diff --git a/www/manager6/window/SafeDestroy.js b/www/manager6/window/SafeDestroy.js
index aa0e478..dedb42c 100644
--- a/www/manager6/window/SafeDestroy.js
+++ b/www/manager6/window/SafeDestroy.js
@@ -28,8 +28,6 @@ Ext.define('PVE.window.SafeDestroy', {
 			{
 			    itemId: 'input',
 			    xtype: 'numberfield',
-			    name: 'VM id',
-			    fieldLabel: gettext('Please enter the VM ID to confirm'),
 			    hideTrigger:true,
 			    allowBlank: false,
 			    listeners: {
@@ -74,13 +72,15 @@ Ext.define('PVE.window.SafeDestroy', {
 	var me = this;
 	me.callParent();
 
-	var msg = Ext.String.format(gettext('Are you sure you want to remove VM {0}? This will permanently erase all VM data.'), me.vmid);
-	me.getComponent('safepanel').getComponent('message').setValue(msg);
+	me.getComponent('safepanel').getComponent('message').setValue(me.msg);
 
 	var submitBtn = me.down('toolbar').getComponent('removeButton');
 	submitBtn.base_url= me.base_url;
 
-	me.getComponent('safepanel').getComponent('input').vmid = me.vmid;
-	me.getComponent('safepanel').getComponent('input').submitBtn = submitBtn;
+	Ext.apply(me.getComponent('safepanel').getComponent('input'), {
+	    fieldLabel: me.inputLabel,
+	    vmid: me.vmid,
+	    submitBtn: submitBtn
+	});
     }
 });
\ No newline at end of file
-- 
2.1.4





More information about the pve-devel mailing list