]>
Commit | Line | Data |
---|---|---|
6cbcc546 DM |
1 | Ext.define('PVE.storage.ZFSPoolSelector', { |
2 | extend: 'Ext.form.field.ComboBox', | |
3 | alias: 'widget.pveZFSPoolSelector', | |
c2317525 DC |
4 | valueField: 'pool', |
5 | displayField: 'pool', | |
6 | queryMode: 'local', | |
7 | editable: false, | |
8 | listConfig: { | |
f6710aac | 9 | loadingText: gettext('Scanning...'), |
c2317525 | 10 | }, |
6cbcc546 DM |
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: { | |
56a353b9 | 22 | type: 'proxmox', |
f6710aac TL |
23 | url: '/api2/json/nodes/' + me.nodename + '/scan/zfs', |
24 | }, | |
6cbcc546 DM |
25 | }); |
26 | ||
9e9ab96f WL |
27 | store.sort('pool', 'ASC'); |
28 | ||
6cbcc546 | 29 | Ext.apply(me, { |
f6710aac | 30 | store: store, |
6cbcc546 DM |
31 | }); |
32 | ||
33 | me.callParent(); | |
f6710aac | 34 | }, |
6cbcc546 DM |
35 | }); |
36 | ||
37 | Ext.define('PVE.storage.ZFSPoolInputPanel', { | |
f28ec3e4 | 38 | extend: 'PVE.panel.StorageBase', |
6cbcc546 | 39 | |
96988dfa DC |
40 | onlineHelp: 'storage_zfspool', |
41 | ||
6cbcc546 DM |
42 | initComponent : function() { |
43 | var me = this; | |
44 | ||
f28ec3e4 | 45 | me.column1 = []; |
6cbcc546 | 46 | |
d5e771ce | 47 | if (me.isCreate) { |
6cbcc546 DM |
48 | me.column1.push(Ext.create('PVE.storage.ZFSPoolSelector', { |
49 | name: 'pool', | |
50 | fieldLabel: gettext('ZFS Pool'), | |
f6710aac | 51 | allowBlank: false, |
6cbcc546 DM |
52 | })); |
53 | } else { | |
54 | me.column1.push(Ext.createWidget('displayfield', { | |
6cbcc546 DM |
55 | name: 'pool', |
56 | value: '', | |
57 | fieldLabel: gettext('ZFS Pool'), | |
f6710aac | 58 | allowBlank: false, |
6cbcc546 DM |
59 | })); |
60 | } | |
61 | ||
ec0bd652 DC |
62 | // value is an array, |
63 | // while before it was a string | |
6cbcc546 DM |
64 | me.column1.push( |
65 | {xtype: 'pveContentTypeSelector', | |
66 | cts: ['images', 'rootdir'], | |
67 | fieldLabel: gettext('Content'), | |
68 | name: 'content', | |
69 | value: ['images', 'rootdir'], | |
70 | multiSelect: true, | |
f6710aac | 71 | allowBlank: false, |
ec0bd652 | 72 | }); |
6cbcc546 | 73 | me.column2 = [ |
6cbcc546 | 74 | { |
896c0d50 | 75 | xtype: 'proxmoxcheckbox', |
6cbcc546 DM |
76 | name: 'sparse', |
77 | checked: false, | |
78 | uncheckedValue: 0, | |
f6710aac | 79 | fieldLabel: gettext('Thin provision'), |
4e31f56f FG |
80 | }, |
81 | { | |
82 | xtype: 'textfield', | |
83 | name: 'blocksize', | |
84 | emptyText: '8k', | |
85 | fieldLabel: gettext('Block Size'), | |
f6710aac TL |
86 | allowBlank: true, |
87 | }, | |
6cbcc546 DM |
88 | ]; |
89 | ||
6cbcc546 | 90 | me.callParent(); |
f6710aac | 91 | }, |
6cbcc546 | 92 | }); |