]> git.proxmox.com Git - pve-manager.git/blobdiff - www/manager6/storage/ZFSPoolEdit.js
ui: eslint: fix various spacing related issues
[pve-manager.git] / www / manager6 / storage / ZFSPoolEdit.js
index bbc478babd4e27ef3c3d4eae07759b4d05f5d7bb..8e689f0c63b11c9c8411bac69f5de3527b6bd8ed 100644 (file)
@@ -6,9 +6,9 @@ Ext.define('PVE.storage.ZFSPoolSelector', {
     queryMode: 'local',
     editable: false,
     listConfig: {
-       loadingText: gettext('Scanning...')
+       loadingText: gettext('Scanning...'),
     },
-    initComponent : function() {
+    initComponent: function() {
        var me = this;
 
        if (!me.nodename) {
@@ -17,167 +17,77 @@ Ext.define('PVE.storage.ZFSPoolSelector', {
 
        var store = Ext.create('Ext.data.Store', {
            autoLoad: {}, // true,
-           fields: [ 'pool', 'size', 'free' ],
+           fields: ['pool', 'size', 'free'],
            proxy: {
-               type: 'pve',
-               url: '/api2/json/nodes/' + me.nodename + '/scan/zfs'
-           }
+               type: 'proxmox',
+               url: '/api2/json/nodes/' + me.nodename + '/scan/zfs',
+           },
        });
 
        store.sort('pool', 'ASC');
 
        Ext.apply(me, {
-           store: store
+           store: store,
        });
 
        me.callParent();
-    }
+    },
 });
 
 Ext.define('PVE.storage.ZFSPoolInputPanel', {
-    extend: 'PVE.panel.InputPanel',
-
-    onGetValues: function(values) {
-       var me = this;
-
-       if (me.isCreate) {
-           values.type = 'zfspool';
-       } else {
-           delete values.storage;
-       }
+    extend: 'PVE.panel.StorageBase',
 
-       values.disable = values.enable ? 0 : 1;
-       delete values.enable;
-
-       return values;
-    },
+    onlineHelp: 'storage_zfspool',
 
-    initComponent : function() {
+    initComponent: function() {
        var me = this;
 
-       me.column1 = [
-           {
-               xtype: me.isCreate ? 'textfield' : 'displayfield',
-               name: 'storage',
-               value: me.storageId || '',
-               fieldLabel: 'ID',
-               vtype: 'StorageId',
-               allowBlank: false
-           }
-       ];
+       me.column1 = [];
 
        if (me.isCreate) {
            me.column1.push(Ext.create('PVE.storage.ZFSPoolSelector', {
                name: 'pool',
                fieldLabel: gettext('ZFS Pool'),
-               allowBlank: false
+               allowBlank: false,
            }));
        } else {
            me.column1.push(Ext.createWidget('displayfield', {
                name: 'pool',
                value: '',
                fieldLabel: gettext('ZFS Pool'),
-               allowBlank: false
+               allowBlank: false,
            }));
        }
 
        // value is an array,
        // while before it was a string
-       /*jslint confusion: true*/
        me.column1.push(
-           {xtype: 'pveContentTypeSelector',
+           {
+xtype: 'pveContentTypeSelector',
             cts: ['images', 'rootdir'],
             fieldLabel: gettext('Content'),
             name: 'content',
             value: ['images', 'rootdir'],
             multiSelect: true,
-            allowBlank: false
+            allowBlank: false,
        });
-       /*jslint confusion: false*/
        me.column2 = [
-           {
-               xtype: 'proxmoxcheckbox',
-               name: 'enable',
-               checked: true,
-               uncheckedValue: 0,
-               fieldLabel: gettext('Enable')
-           },
            {
                xtype: 'proxmoxcheckbox',
                name: 'sparse',
                checked: false,
                uncheckedValue: 0,
-               fieldLabel: gettext('Thin provision')
+               fieldLabel: gettext('Thin provision'),
            },
            {
                xtype: 'textfield',
                name: 'blocksize',
                emptyText: '8k',
                fieldLabel: gettext('Block Size'),
-               allowBlank: true
-           }
+               allowBlank: true,
+           },
        ];
 
-       if (me.isCreate || me.storageId !== 'local') {
-           me.column2.unshift({
-               xtype: 'pveNodeSelector',
-               name: 'nodes',
-               fieldLabel: gettext('Nodes'),
-               emptyText: gettext('All') + ' (' +
-                   gettext('No restrictions') +')',
-               multiSelect: true,
-               autoSelect: false
-           });
-       }
-
        me.callParent();
-    }
-});
-
-Ext.define('PVE.storage.ZFSPoolEdit', {
-    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.ZFSPoolInputPanel', {
-           isCreate: me.isCreate,
-           storageId: me.storageId
-       });
-
-       Ext.apply(me, {
-            subject: PVE.Utils.format_storage_type('zfspool'),
-           isAdd: true,
-           items: [ ipanel ]
-       });
-
-       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);
-                }
-            });
-        }
-    }
+    },
 });