Ext.define('PVE.storage.VgSelector', {
extend: 'Ext.form.field.ComboBox',
alias: 'widget.pveVgSelector',
-
+ valueField: 'vg',
+ displayField: 'vg',
+ queryMode: 'local',
+ editable: false,
initComponent : function() {
var me = this;
}
});
+ store.sort('vg', 'ASC');
+
Ext.apply(me, {
store: store,
- valueField: 'vg',
- displayField: 'vg',
- queryMode: 'local',
- editable: false,
listConfig: {
- loadingText: gettext('Scanning...'),
- listeners: {
- // hack: call setHeight to show scroll bars correctly
- refresh: function(list) {
- var lh = PVE.Utils.gridLineHeigh();
- var count = store.getCount();
- list.setHeight(lh * ((count > 10) ? 10 : count));
- }
- }
+ loadingText: gettext('Scanning...')
}
});
alias: 'widget.pveBaseStorageSelector',
existingGroupsText: gettext("Existing volume groups"),
-
+ queryMode: 'local',
+ editable: false,
+ value: '',
+ valueField: 'storage',
+ displayField: 'text',
initComponent : function() {
var me = this;
store.loadData([{ storage: '' }], true);
+ store.sort('storage', 'ASC');
+
Ext.apply(me, {
- store: store,
- queryMode: 'local',
- editable: false,
- value: '',
- valueField: 'storage',
- displayField: 'text'
+ store: store
});
me.callParent();
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'lvm';
} else {
delete values.storage;
}
- values.disable = values.enable ? 0 : 1;
+ values.disable = values.enable ? 0 : 1;
delete values.enable;
-
+
return values;
},
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
- height: 22, // hack: set same height as text fields
value: me.storageId || '',
fieldLabel: 'ID',
vtype: 'StorageId',
- submitValue: !!me.create,
+ submitValue: !!me.isCreate,
allowBlank: false
}
];
- var vgnameField = Ext.createWidget(me.create ? 'textfield' : 'displayfield', {
- height: 22, // hack: set same height as text fields
+ var vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
name: 'vgname',
- hidden: !!me.create,
- disabled: !!me.create,
+ hidden: !!me.isCreate,
+ disabled: !!me.isCreate,
value: '',
fieldLabel: gettext('Volume group'),
allowBlank: false
});
- if (me.create) {
+ if (me.isCreate) {
var vgField = Ext.create('PVE.storage.VgSelector', {
name: 'vgname',
fieldLabel: gettext('Volume group'),
me.column1.push(vgnameField);
+ // here value is an array,
+ // while before it was a string
+ /*jslint confusion: true*/
me.column1.push({
xtype: 'pveContentTypeSelector',
cts: ['images', 'rootdir'],
multiSelect: true,
allowBlank: false
});
+ /*jslint confusion: false*/
me.column2 = [
{
xtype: 'pveNodeSelector',
name: 'nodes',
fieldLabel: gettext('Nodes'),
- emptyText: gettext('All') + ' (' +
+ emptyText: gettext('All') + ' (' +
gettext('No restrictions') +')',
multiSelect: true,
autoSelect: false
},
{
- xtype: 'pvecheckbox',
+ xtype: 'proxmoxcheckbox',
name: 'enable',
checked: true,
uncheckedValue: 0,
fieldLabel: gettext('Enable')
},
{
- xtype: 'pvecheckbox',
+ xtype: 'proxmoxcheckbox',
name: 'shared',
uncheckedValue: 0,
fieldLabel: gettext('Shared')
initComponent : function() {
var me = this;
-
- me.create = !me.storageId;
- if (me.create) {
+ me.isCreate = !me.storageId;
+
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
}
var ipanel = Ext.create('PVE.storage.LVMInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
-
+
Ext.apply(me, {
subject: PVE.Utils.format_storage_type('lvm'),
isAdd: true,
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;