]> git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/ZFSPoolEdit.js
ui: eslint: fix various spacing related issues
[pve-manager.git] / www / manager6 / storage / ZFSPoolEdit.js
1 Ext.define('PVE.storage.ZFSPoolSelector', {
2 extend: 'Ext.form.field.ComboBox',
3 alias: 'widget.pveZFSPoolSelector',
4 valueField: 'pool',
5 displayField: 'pool',
6 queryMode: 'local',
7 editable: false,
8 listConfig: {
9 loadingText: gettext('Scanning...'),
10 },
11 initComponent: function() {
12 var me = this;
13
14 if (!me.nodename) {
15 me.nodename = 'localhost';
16 }
17
18 var store = Ext.create('Ext.data.Store', {
19 autoLoad: {}, // true,
20 fields: ['pool', 'size', 'free'],
21 proxy: {
22 type: 'proxmox',
23 url: '/api2/json/nodes/' + me.nodename + '/scan/zfs',
24 },
25 });
26
27 store.sort('pool', 'ASC');
28
29 Ext.apply(me, {
30 store: store,
31 });
32
33 me.callParent();
34 },
35 });
36
37 Ext.define('PVE.storage.ZFSPoolInputPanel', {
38 extend: 'PVE.panel.StorageBase',
39
40 onlineHelp: 'storage_zfspool',
41
42 initComponent: function() {
43 var me = this;
44
45 me.column1 = [];
46
47 if (me.isCreate) {
48 me.column1.push(Ext.create('PVE.storage.ZFSPoolSelector', {
49 name: 'pool',
50 fieldLabel: gettext('ZFS Pool'),
51 allowBlank: false,
52 }));
53 } else {
54 me.column1.push(Ext.createWidget('displayfield', {
55 name: 'pool',
56 value: '',
57 fieldLabel: gettext('ZFS Pool'),
58 allowBlank: false,
59 }));
60 }
61
62 // value is an array,
63 // while before it was a string
64 me.column1.push(
65 {
66 xtype: 'pveContentTypeSelector',
67 cts: ['images', 'rootdir'],
68 fieldLabel: gettext('Content'),
69 name: 'content',
70 value: ['images', 'rootdir'],
71 multiSelect: true,
72 allowBlank: false,
73 });
74 me.column2 = [
75 {
76 xtype: 'proxmoxcheckbox',
77 name: 'sparse',
78 checked: false,
79 uncheckedValue: 0,
80 fieldLabel: gettext('Thin provision'),
81 },
82 {
83 xtype: 'textfield',
84 name: 'blocksize',
85 emptyText: '8k',
86 fieldLabel: gettext('Block Size'),
87 allowBlank: true,
88 },
89 ];
90
91 me.callParent();
92 },
93 });