[pve-devel] [PATCH pve-manager] 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 13:42:07 CET 2016
instead get the machine type ('CT' or 'VM') from the calling
function
---
www/manager6/lxc/Config.js | 3 ++-
www/manager6/qemu/Config.js | 3 ++-
www/manager6/window/SafeDestroy.js | 16 +++++++++++-----
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/www/manager6/lxc/Config.js b/www/manager6/lxc/Config.js
index 1eafdb5..47e968b 100644
--- a/www/manager6/lxc/Config.js
+++ b/www/manager6/lxc/Config.js
@@ -90,7 +90,8 @@ Ext.define('PVE.lxc.Config', {
handler: function() {
Ext.create('PVE.window.SafeDestroy', {
vmid: vmid,
- base_url: base_url
+ base_url: base_url,
+ machineType: 'CT'
}).show();
}
});
diff --git a/www/manager6/qemu/Config.js b/www/manager6/qemu/Config.js
index dce4792..d9fd0ad 100644
--- a/www/manager6/qemu/Config.js
+++ b/www/manager6/qemu/Config.js
@@ -101,7 +101,8 @@ Ext.define('PVE.qemu.Config', {
handler: function() {
Ext.create('PVE.window.SafeDestroy', {
vmid: vmid,
- base_url: base_url
+ base_url: base_url,
+ machineType: 'VM'
}).show();
}
});
diff --git a/www/manager6/window/SafeDestroy.js b/www/manager6/window/SafeDestroy.js
index aa0e478..7574583 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,21 @@ 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);
+ var msg = Ext.String.format(gettext('Are you sure you want to remove') + ' '
+ + me.machineType + ' ' + '{0}' +' ? '
+ + gettext('This will permanently erase everything in this') + ' '
+ + me.machineType + '.'
+ , me.vmid);
+ var inputLabel = gettext('Please enter the' + ' ' + me.machineType + ' ' + 'ID to confirm');
me.getComponent('safepanel').getComponent('message').setValue(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: inputLabel,
+ vmid: me.vmid,
+ submitBtn: submitBtn
+ });
}
});
\ No newline at end of file
--
2.1.4
More information about the pve-devel
mailing list