]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/storage/LVMEdit.js
use Checkbox from widget toolkit
[pve-manager.git] / www / manager6 / storage / LVMEdit.js
index 365d5af9d7200b14e609380e9e86eb29a6a4750b..531b735a78d1c76e145858912f4bfc7a24d739bf 100644 (file)
@@ -21,10 +21,12 @@ Ext.define('PVE.storage.VgSelector', {
            }
        });
 
+       store.sort('vg', 'ASC');
+
        Ext.apply(me, {
            store: store,
            listConfig: {
-               loadingText: gettext('Scanning...'),
+               loadingText: gettext('Scanning...')
            }
        });
 
@@ -71,8 +73,10 @@ Ext.define('PVE.storage.BaseStorageSelector', {
 
        store.loadData([{ storage: '' }], true);
 
+       store.sort('storage', 'ASC');
+
        Ext.apply(me, {
-           store: store,
+           store: store
        });
 
        me.callParent();
@@ -85,7 +89,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
     onGetValues: function(values) {
        var me = this;
 
-       if (me.create) {
+       if (me.isCreate) {
            values.type = 'lvm';
        } else {
            delete values.storage;
@@ -102,26 +106,26 @@ Ext.define('PVE.storage.LVMInputPanel', {
 
        me.column1 = [
            {
-               xtype: me.create ? 'textfield' : 'displayfield',
+               xtype: me.isCreate ? 'textfield' : 'displayfield',
                name: 'storage',
                value: me.storageId || '',
                fieldLabel: 'ID',
                vtype: 'StorageId',
-               submitValue: !!me.create,
+               submitValue: !!me.isCreate,
                allowBlank: false
            }
        ];
 
-       var vgnameField = Ext.createWidget(me.create ? 'textfield' : 'displayfield', {
+       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'),
@@ -172,6 +176,9 @@ Ext.define('PVE.storage.LVMInputPanel', {
 
        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'],
@@ -181,6 +188,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
            multiSelect: true,
            allowBlank: false
        });
+       /*jslint confusion: false*/
 
        me.column2 = [
            {
@@ -193,14 +201,14 @@ Ext.define('PVE.storage.LVMInputPanel', {
                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')
@@ -217,9 +225,9 @@ Ext.define('PVE.storage.LVMEdit', {
     initComponent : function() {
        var me = this;
 
-       me.create = !me.storageId;
+       me.isCreate = !me.storageId;
 
-       if (me.create) {
+       if (me.isCreate) {
             me.url = '/api2/extjs/storage';
             me.method = 'POST';
         } else {
@@ -228,7 +236,7 @@ Ext.define('PVE.storage.LVMEdit', {
         }
 
        var ipanel = Ext.create('PVE.storage.LVMInputPanel', {
-           create: me.create,
+           isCreate: me.isCreate,
            storageId: me.storageId
        });
 
@@ -240,7 +248,7 @@ Ext.define('PVE.storage.LVMEdit', {
 
        me.callParent();
 
-       if (!me.create) {
+       if (!me.isCreate) {
            me.load({
                success:  function(response, options) {
                    var values = response.result.data;