]>
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'
35 Ext
.define('PVE.storage.ZFSPoolInputPanel', {
36 extend
: 'PVE.panel.InputPanel',
38 onGetValues: function(values
) {
42 values
.type
= 'zfspool';
44 delete values
.storage
;
47 values
.disable
= values
.enable
? 0 : 1;
53 initComponent : function() {
58 xtype
: me
.create
? 'textfield' : 'displayfield',
60 value
: me
.storageId
|| '',
68 me
.column1
.push(Ext
.create('PVE.storage.ZFSPoolSelector', {
70 fieldLabel
: gettext('ZFS Pool'),
74 me
.column1
.push(Ext
.createWidget('displayfield', {
77 fieldLabel
: gettext('ZFS Pool'),
83 // while before it was a string
84 /*jslint confusion: true*/
86 {xtype
: 'pveContentTypeSelector',
87 cts
: ['images', 'rootdir'],
88 fieldLabel
: gettext('Content'),
90 value
: ['images', 'rootdir'],
94 /*jslint confusion: false*/
101 fieldLabel
: gettext('Enable')
104 xtype
: 'pvecheckbox',
108 fieldLabel
: gettext('Thin provision')
112 if (me
.create
|| me
.storageId
!== 'local') {
114 xtype
: 'pveNodeSelector',
116 fieldLabel
: gettext('Nodes'),
117 emptyText
: gettext('All') + ' (' +
118 gettext('No restrictions') +')',
128 Ext
.define('PVE.storage.ZFSPoolEdit', {
129 extend
: 'PVE.window.Edit',
131 initComponent : function() {
134 me
.create
= !me
.storageId
;
137 me
.url
= '/api2/extjs/storage';
140 me
.url
= '/api2/extjs/storage/' + me
.storageId
;
144 var ipanel
= Ext
.create('PVE.storage.ZFSPoolInputPanel', {
146 storageId
: me
.storageId
150 subject
: PVE
.Utils
.format_storage_type('zfspool'),
159 success: function(response
, options
) {
160 var values
= response
.result
.data
;
161 var ctypes
= values
.content
|| '';
163 values
.content
= ctypes
.split(',');
166 values
.nodes
= values
.nodes
.split(',');
168 values
.enable
= values
.disable
? 0 : 1;
169 ipanel
.setValues(values
);