]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/ZFSPoolEdit.js
1 Ext
.define('PVE.storage.ZFSPoolSelector', {
2 extend
: 'Ext.form.field.ComboBox',
3 alias
: 'widget.pveZFSPoolSelector',
9 loadingText
: gettext('Scanning...')
11 initComponent : function() {
15 me
.nodename
= 'localhost';
18 var store
= Ext
.create('Ext.data.Store', {
19 autoLoad
: {}, // true,
20 fields
: [ 'pool', 'size', 'free' ],
23 url
: '/api2/json/nodes/' + me
.nodename
+ '/scan/zfs'
27 store
.sort('pool', 'ASC');
37 Ext
.define('PVE.storage.ZFSPoolInputPanel', {
38 extend
: 'Proxmox.panel.InputPanel',
40 onGetValues: function(values
) {
44 values
.type
= 'zfspool';
46 delete values
.storage
;
49 values
.disable
= values
.enable
? 0 : 1;
55 initComponent : function() {
60 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
62 value
: me
.storageId
|| '',
70 me
.column1
.push(Ext
.create('PVE.storage.ZFSPoolSelector', {
72 fieldLabel
: gettext('ZFS Pool'),
76 me
.column1
.push(Ext
.createWidget('displayfield', {
79 fieldLabel
: gettext('ZFS Pool'),
85 // while before it was a string
86 /*jslint confusion: true*/
88 {xtype
: 'pveContentTypeSelector',
89 cts
: ['images', 'rootdir'],
90 fieldLabel
: gettext('Content'),
92 value
: ['images', 'rootdir'],
96 /*jslint confusion: false*/
99 xtype
: 'proxmoxcheckbox',
103 fieldLabel
: gettext('Enable')
106 xtype
: 'proxmoxcheckbox',
110 fieldLabel
: gettext('Thin provision')
116 fieldLabel
: gettext('Block Size'),
121 if (me
.isCreate
|| me
.storageId
!== 'local') {
123 xtype
: 'pveNodeSelector',
125 fieldLabel
: gettext('Nodes'),
126 emptyText
: gettext('All') + ' (' +
127 gettext('No restrictions') +')',
137 Ext
.define('PVE.storage.ZFSPoolEdit', {
138 extend
: 'Proxmox.window.Edit',
140 initComponent : function() {
143 me
.isCreate
= !me
.storageId
;
146 me
.url
= '/api2/extjs/storage';
149 me
.url
= '/api2/extjs/storage/' + me
.storageId
;
153 var ipanel
= Ext
.create('PVE.storage.ZFSPoolInputPanel', {
154 isCreate
: me
.isCreate
,
155 storageId
: me
.storageId
159 subject
: PVE
.Utils
.format_storage_type('zfspool'),
168 success: function(response
, options
) {
169 var values
= response
.result
.data
;
170 var ctypes
= values
.content
|| '';
172 values
.content
= ctypes
.split(',');
175 values
.nodes
= values
.nodes
.split(',');
177 values
.enable
= values
.disable
? 0 : 1;
178 ipanel
.setValues(values
);