fields: [ 'lv' ],
proxy: {
type: 'proxmox',
- url: '/api2/json/nodes/' + me.nodename + '/scan/lvmthin'
- }
+ url: '/api2/json/nodes/' + me.nodename + '/scan/lvmthin',
+ },
});
store.sort('lv', 'ASC');
Ext.apply(me, {
store: store,
listConfig: {
- loadingText: gettext('Scanning...')
- }
+ loadingText: gettext('Scanning...'),
+ },
});
me.callParent();
- }
+ },
});
Ext.define('PVE.storage.BaseVGSelector', {
fields: [ 'vg', 'size', 'free'],
proxy: {
type: 'proxmox',
- url: '/api2/json/nodes/' + me.nodename + '/scan/lvm'
- }
+ url: '/api2/json/nodes/' + me.nodename + '/scan/lvm',
+ },
});
Ext.apply(me, {
store: store,
listConfig: {
- loadingText: gettext('Scanning...')
- }
+ loadingText: gettext('Scanning...'),
+ },
});
me.callParent();
- }
+ },
});
Ext.define('PVE.storage.LvmThinInputPanel', {
- extend: 'Proxmox.panel.InputPanel',
+ extend: 'PVE.panel.StorageBase',
- onGetValues: function(values) {
- var me = this;
-
- if (me.isCreate) {
- values.type = 'lvmthin';
- } else {
- delete values.storage;
- }
-
- values.disable = values.enable ? 0 : 1;
- delete values.enable;
-
- return values;
- },
+ onlineHelp: 'storage_lvmthin',
initComponent : function() {
var me = this;
- me.column1 = [
- {
- xtype: me.isCreate ? 'textfield' : 'displayfield',
- name: 'storage',
- value: me.storageId || '',
- fieldLabel: 'ID',
- vtype: 'StorageId',
- submitValue: !!me.isCreate,
- allowBlank: false
- }
- ];
+ me.column1 = [];
var vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
name: 'vgname',
disabled: !!me.isCreate,
value: '',
fieldLabel: gettext('Volume group'),
- allowBlank: false
+ allowBlank: false,
});
var thinpoolField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
disabled: !!me.isCreate,
value: '',
fieldLabel: gettext('Thin Pool'),
- allowBlank: false
+ allowBlank: false,
});
if (me.isCreate) {
var vgField = Ext.create('PVE.storage.TPoolSelector', {
name: 'thinpool',
fieldLabel: gettext('Thin Pool'),
- allowBlank: false
+ allowBlank: false,
});
me.column1.push({
vgField.setVG(value);
vgField.setValue('');
}
- }
- }
+ },
+ },
});
me.column1.push(vgField);
// here value is an array,
// while before it was a string
- /*jslint confusion: true*/
me.column1.push({
xtype: 'pveContentTypeSelector',
cts: ['images', 'rootdir'],
name: 'content',
value: ['images', 'rootdir'],
multiSelect: true,
- allowBlank: false
+ allowBlank: false,
});
- /*jslint confusion: false*/
-
- me.column2 = [
- {
- xtype: 'pveNodeSelector',
- name: 'nodes',
- fieldLabel: gettext('Nodes'),
- emptyText: gettext('All') + ' (' +
- gettext('No restrictions') +')',
- multiSelect: true,
- autoSelect: false
- },
- {
- xtype: 'proxmoxcheckbox',
- name: 'enable',
- checked: true,
- uncheckedValue: 0,
- fieldLabel: gettext('Enable')
- }
- ];
-
- me.callParent();
- }
-});
-Ext.define('PVE.storage.LvmThinEdit', {
- extend: 'Proxmox.window.Edit',
-
- initComponent : function() {
- var me = this;
-
- me.isCreate = !me.storageId;
-
- if (me.isCreate) {
- me.url = '/api2/extjs/storage';
- me.method = 'POST';
- } else {
- me.url = '/api2/extjs/storage/' + me.storageId;
- me.method = 'PUT';
- }
-
- var ipanel = Ext.create('PVE.storage.LvmThinInputPanel', {
- isCreate: me.isCreate,
- storageId: me.storageId
- });
-
- Ext.apply(me, {
- subject: PVE.Utils.format_storage_type('lvmthin'),
- isAdd: true,
- items: [ ipanel ]
- });
+ me.column2 = [];
me.callParent();
-
- if (!me.isCreate) {
- me.load({
- success: function(response, options) {
- var values = response.result.data;
- var ctypes = values.content || '';
-
- values.content = ctypes.split(',');
-
- if (values.nodes) {
- values.nodes = values.nodes.split(',');
- }
- values.enable = values.disable ? 0 : 1;
- ipanel.setValues(values);
- }
- });
- }
- }
+ },
});