]>
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 {xtype
: 'pveContentTypeSelector',
84 cts
: ['images', 'rootdir'],
85 fieldLabel
: gettext('Content'),
87 value
: ['images', 'rootdir'],
97 fieldLabel
: gettext('Enable')
100 xtype
: 'pvecheckbox',
104 fieldLabel
: gettext('Thin provision')
108 if (me
.create
|| me
.storageId
!== 'local') {
110 xtype
: 'pveNodeSelector',
112 fieldLabel
: gettext('Nodes'),
113 emptyText
: gettext('All') + ' (' +
114 gettext('No restrictions') +')',
124 Ext
.define('PVE.storage.ZFSPoolEdit', {
125 extend
: 'PVE.window.Edit',
127 initComponent : function() {
130 me
.create
= !me
.storageId
;
133 me
.url
= '/api2/extjs/storage';
136 me
.url
= '/api2/extjs/storage/' + me
.storageId
;
140 var ipanel
= Ext
.create('PVE.storage.ZFSPoolInputPanel', {
142 storageId
: me
.storageId
146 subject
: PVE
.Utils
.format_storage_type('zfspool'),
155 success: function(response
, options
) {
156 var values
= response
.result
.data
;
157 var ctypes
= values
.content
|| '';
159 values
.content
= ctypes
.split(',');
162 values
.nodes
= values
.nodes
.split(',');
164 values
.enable
= values
.disable
? 0 : 1;
165 ipanel
.setValues(values
);