]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/dc/StorageView.js
9255c6e6c938895427be8c79bdc1b2d4e27eb42e
2 Ext
.define('PVE.dc.StorageView', {
3 extend
: 'Ext.grid.GridPanel',
5 alias
: ['widget.pveStorageView'],
7 onlineHelp
: 'chapter_storage',
10 stateId
: 'grid-dc-storage',
12 initComponent : function() {
15 var store
= new Ext
.data
.Store({
19 url
: "/api2/json/storage"
27 var reload = function() {
31 var sm
= Ext
.create('Ext.selection.RowModel', {});
33 var run_editor = function() {
34 var rec
= sm
.getSelection()[0];
38 var type
= rec
.data
.type
;
42 editor
= 'PVE.storage.DirEdit';
43 } else if (type
=== 'nfs') {
44 editor
= 'PVE.storage.NFSEdit';
45 } else if (type
=== 'glusterfs') {
46 editor
= 'PVE.storage.GlusterFsEdit';
47 } else if (type
=== 'lvm') {
48 editor
= 'PVE.storage.LVMEdit';
49 } else if (type
=== 'lvmthin') {
50 editor
= 'PVE.storage.LvmThinEdit';
51 } else if (type
=== 'iscsi') {
52 editor
= 'PVE.storage.IScsiEdit';
53 } else if (type
=== 'rbd') {
54 editor
= 'PVE.storage.RBDEdit';
55 } else if (type
=== 'sheepdog') {
56 editor
= 'PVE.storage.SheepdogEdit';
57 } else if (type
=== 'zfs') {
58 editor
= 'PVE.storage.ZFSEdit';
59 } else if (type
=== 'zfspool') {
60 editor
= 'PVE.storage.ZFSPoolEdit';
64 var win
= Ext
.create(editor
, {
65 storageId
: rec
.data
.storage
,
66 pveceph
: !rec
.data
.monhost
70 win
.on('destroy', reload
);
73 var edit_btn
= new PVE
.button
.Button({
74 text
: gettext('Edit'),
80 var remove_btn
= Ext
.create('Proxmox.button.StdRemoveButton', {
83 callback: function() {
97 menu
: new Ext
.menu
.Menu({
100 text
: PVE
.Utils
.format_storage_type('dir'),
101 iconCls
: 'fa fa-fw fa-folder',
102 handler: function() {
103 var win
= Ext
.create('PVE.storage.DirEdit', {});
104 win
.on('destroy', reload
);
110 text
: PVE
.Utils
.format_storage_type('lvm'),
111 iconCls
: 'fa fa-fw fa-folder',
112 handler: function() {
113 var win
= Ext
.create('PVE.storage.LVMEdit', {});
114 win
.on('destroy', reload
);
119 text
: PVE
.Utils
.format_storage_type('lvmthin'),
120 iconCls
: 'fa fa-fw fa-folder',
121 handler: function() {
122 var win
= Ext
.create('PVE.storage.LvmThinEdit', {});
123 win
.on('destroy', reload
);
128 text
: PVE
.Utils
.format_storage_type('nfs'),
129 iconCls
: 'fa fa-fw fa-building',
130 handler: function() {
131 var win
= Ext
.create('PVE.storage.NFSEdit', {});
132 win
.on('destroy', reload
);
137 text
: PVE
.Utils
.format_storage_type('iscsi'),
138 iconCls
: 'fa fa-fw fa-building',
139 handler: function() {
140 var win
= Ext
.create('PVE.storage.IScsiEdit', {});
141 win
.on('destroy', reload
);
146 text
: PVE
.Utils
.format_storage_type('glusterfs'),
147 iconCls
: 'fa fa-fw fa-building',
148 handler: function() {
149 var win
= Ext
.create('PVE.storage.GlusterFsEdit', {});
150 win
.on('destroy', reload
);
155 text
: PVE
.Utils
.format_storage_type('pveceph'),
156 iconCls
: 'fa fa-fw fa-building',
157 handler: function() {
158 var win
= Ext
.create('PVE.storage.RBDEdit', {
161 win
.on('destroy', reload
);
166 text
: PVE
.Utils
.format_storage_type('rbd_ext'),
167 iconCls
: 'fa fa-fw fa-building',
168 handler: function() {
169 var win
= Ext
.create('PVE.storage.RBDEdit', {});
170 win
.on('destroy', reload
);
175 text
: PVE
.Utils
.format_storage_type('zfs'),
176 iconCls
: 'fa fa-fw fa-building',
177 handler: function() {
178 var win
= Ext
.create('PVE.storage.ZFSEdit', {});
179 win
.on('destroy', reload
);
184 text
: PVE
.Utils
.format_storage_type('zfspool'),
185 iconCls
: 'fa fa-fw fa-folder',
186 handler: function() {
187 var win
= Ext
.create('PVE.storage.ZFSPoolEdit', {});
188 win
.on('destroy', reload
);
193 /* the following type are conidered unstable
194 * so we do not enable that on the GUI for now
196 text: PVE.Utils.format_storage_type('sheepdog'),
197 iconCls: 'fa fa-fw fa-building',
198 handler: function() {
199 var win = Ext.create('PVE.storage.SheepdogEdit', {});
200 win.on('destroy', reload);
219 header
: gettext('Type'),
223 renderer
: PVE
.Utils
.format_storage_type
226 header
: gettext('Content'),
229 dataIndex
: 'content',
230 renderer
: PVE
.Utils
.format_content_types
233 header
: gettext('Path') + '/' + gettext('Target'),
237 renderer: function(value
, metaData
, record
) {
238 if (record
.data
.target
) {
239 return record
.data
.target
;
245 header
: gettext('Shared'),
249 renderer
: PVE
.Utils
.format_boolean
252 header
: gettext('Enabled'),
255 dataIndex
: 'disable',
256 renderer
: PVE
.Utils
.format_neg_boolean
261 itemdblclick
: run_editor
269 Ext
.define('pve-storage', {
270 extend
: 'Ext.data.Model',
272 'path', 'type', 'content', 'server', 'portal', 'target', 'export', 'storage',
273 { name
: 'shared', type
: 'boolean'},
274 { name
: 'disable', type
: 'boolean'}
276 idProperty
: 'storage'