add balloon GUI

bump version to 2.3-4
This commit is contained in:
Dietmar Maurer 2013-01-17 12:59:30 +01:00
parent a34da77ed4
commit db05e682d3
5 changed files with 160 additions and 16 deletions

View File

@ -1,3 +1,9 @@
pve-manager (2.3-4) unstable; urgency=low
* add balloon GUI (dynamic memory)
-- Proxmox Support Team <support@proxmox.com> Thu, 17 Jan 2013 12:58:58 +0100
pve-manager (2.3-3) unstable; urgency=low
* GUI: tasks - use better icon for open console

View File

@ -2,7 +2,7 @@ RELEASE=2.3
VERSION=2.3
PACKAGE=pve-manager
PACKAGERELEASE=3
PACKAGERELEASE=4
BINDIR=${DESTDIR}/usr/bin
PERLLIBDIR=${DESTDIR}/usr/share/perl5

View File

@ -19,6 +19,9 @@ Ext.define('PVE.qemu.CreateWizard', {
var cdpanel = Ext.create('PVE.qemu.CDInputPanel', {
title: 'CD/DVD',
confid: 'ide2',
fieldDefaults: {
labelWidth: 160
},
insideWizard: true
});

View File

@ -44,7 +44,13 @@ Ext.define('PVE.qemu.HardwareView', {
never_delete: true,
defaultValue: 512,
tdCls: 'pve-itype-icon-memory',
renderer: function(value) {
renderer: function(value, metaData, record) {
var balloon = me.getObjectValue('balloon');
if (balloon) {
return PVE.Utils.format_size(balloon*1024*1024) + "/" +
PVE.Utils.format_size(value*1024*1024);
}
return PVE.Utils.format_size(value*1024*1024);
}
},
@ -91,6 +97,9 @@ Ext.define('PVE.qemu.HardwareView', {
},
cpu: {
visible: false
},
balloon: {
visible: false
}
};

View File

@ -4,22 +4,132 @@ Ext.define('PVE.qemu.MemoryInputPanel', {
insideWizard: false,
onGetValues: function(values) {
var me = this;
console.dir(values);
var res;
if (values.memoryType === 'fixed') {
res = { memory: values.memory };
res.delete = "balloon,shares";
} else {
res = {
memory: values.maxmemory,
balloon: values.balloon
};
if (Ext.isDefined(values.shares) && (values.shares !== "")) {
res.shares = values.shares;
} else {
res.delete = "shares";
}
}
return res;
},
initComponent : function() {
var me = this;
var labelWidth = 120;
var labelWidth = 160;
var items = {
xtype: 'numberfield',
name: 'memory',
minValue: 32,
maxValue: 512*1024,
value: '512',
step: 32,
fieldLabel: gettext('Memory') + ' (MB)',
labelWidth: labelWidth,
allowBlank: false
};
var items = [
{
xtype: 'radiofield',
name: 'memoryType',
inputValue: 'fixed',
boxLabel: 'Use fixed size memory',
checked: true,
listeners: {
change: function(f, value) {
if (!me.rendered) {
return;
}
me.down('field[name=memory]').setDisabled(!value);
me.down('field[name=maxmemory]').setDisabled(value);
me.down('field[name=balloon]').setDisabled(value);
me.down('field[name=shares]').setDisabled(value);
}
}
},
{
xtype: 'numberfield',
name: 'memory',
minValue: 32,
maxValue: 512*1024,
value: '512',
step: 32,
fieldLabel: gettext('Memory') + ' (MB)',
labelAlign: 'right',
labelWidth: labelWidth,
allowBlank: false
},
{
xtype: 'radiofield',
name: 'memoryType',
inputValue: 'dynamic',
boxLabel: gettext('Automatically allocate memory within this range'),
listeners: {
change: function(f, value) {
if (!me.rendered) {
return;
}
}
}
},
{
xtype: 'numberfield',
name: 'maxmemory',
disabled: true,
minValue: 32,
maxValue: 512*1024,
value: '1024',
step: 32,
fieldLabel: gettext('Maximum memory') + ' (MB)',
labelAlign: 'right',
labelWidth: labelWidth,
allowBlank: false,
listeners: {
change: function(f, value) {
var bf = me.down('field[name=balloon]');
balloon = bf.getValue();
if (balloon>value) {
bf.setValue(value);
}
bf.setMaxValue(value);
}
}
},
{
xtype: 'numberfield',
name: 'balloon',
disabled: true,
minValue: 0,
maxValue: 512*1024,
value: '512',
step: 32,
fieldLabel: gettext('Minimum memory') + ' (MB)',
labelAlign: 'right',
labelWidth: labelWidth,
allowBlank: false
},
{
xtype: 'numberfield',
name: 'shares',
disabled: true,
minValue: 0,
maxValue: 50000,
value: '',
step: 10,
fieldLabel: gettext('Shares'),
labelAlign: 'right',
labelWidth: labelWidth,
allowBlank: true,
emptyText: PVE.Utils.defaultText + ' (1000)',
submitEmptyText: false
}
];
if (me.insideWizard) {
me.column1 = items;
@ -39,11 +149,27 @@ Ext.define('PVE.qemu.MemoryEdit', {
Ext.apply(me, {
subject: gettext('Memory'),
items: Ext.create('PVE.qemu.MemoryInputPanel')
items: Ext.create('PVE.qemu.MemoryInputPanel'),
width: 350
});
me.callParent();
me.load();
me.load({
success: function(response, options) {
var data = response.result.data;
console.dir(data);
var values = {
memory: data.memory,
maxmemory: data.memory,
balloon: data.balloon,
shares: data.shares,
memoryType: data.balloon ? 'dynamic' : 'fixed'
};
me.setValues(values);
}
});
}
});