]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/IScsiEdit.js
1 Ext
.define('PVE.storage.IScsiScan', {
2 extend
: 'Ext.form.field.ComboBox',
3 alias
: 'widget.pveIScsiScan',
7 displayField
: 'target',
8 matchFieldWidth
: false,
10 loadingText
: gettext('Scanning...'),
13 doRawQuery: function() {
16 onTriggerClick: function() {
19 if (!me
.queryCaching
|| me
.lastQuery
!== me
.portal
) {
23 me
.allQuery
= me
.portal
;
28 setPortal: function(portal
) {
34 initComponent : function() {
38 me
.nodename
= 'localhost';
41 var store
= Ext
.create('Ext.data.Store', {
42 fields
: [ 'target', 'portal' ],
45 url
: '/api2/json/nodes/' + me
.nodename
+ '/scan/iscsi'
49 store
.sort('target', 'ASC');
59 Ext
.define('PVE.storage.IScsiInputPanel', {
60 extend
: 'PVE.panel.InputPanel',
62 onGetValues: function(values
) {
66 values
.type
= 'iscsi';
68 delete values
.storage
;
71 values
.content
= values
.luns
? 'images' : 'none';
74 values
.disable
= values
.enable
? 0 : 1;
80 initComponent : function() {
86 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
88 value
: me
.storageId
|| '',
94 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
100 change: function(f
, value
) {
102 var exportField
= me
.down('field[name=target]');
103 exportField
.setPortal(value
);
104 exportField
.setValue('');
110 readOnly
: !me
.isCreate
,
111 xtype
: me
.isCreate
? 'pveIScsiScan' : 'displayfield',
114 fieldLabel
: 'Target',
121 xtype
: 'pveNodeSelector',
123 fieldLabel
: gettext('Nodes'),
124 emptyText
: gettext('All') + ' (' +
125 gettext('No restrictions') +')',
130 xtype
: 'proxmoxcheckbox',
134 fieldLabel
: gettext('Enable')
140 fieldLabel
: gettext('Use LUNs directly')
148 Ext
.define('PVE.storage.IScsiEdit', {
149 extend
: 'Proxmox.window.Edit',
151 initComponent : function() {
154 me
.isCreate
= !me
.storageId
;
157 me
.url
= '/api2/extjs/storage';
160 me
.url
= '/api2/extjs/storage/' + me
.storageId
;
164 var ipanel
= Ext
.create('PVE.storage.IScsiInputPanel', {
165 isCreate
: me
.isCreate
,
166 storageId
: me
.storageId
170 subject
: PVE
.Utils
.format_storage_type('iscsi'),
179 success: function(response
, options
) {
180 var values
= response
.result
.data
;
181 var ctypes
= values
.content
|| '';
183 if (values
.storage
=== 'local') {
184 values
.content
= ctypes
.split(',');
187 values
.nodes
= values
.nodes
.split(',');
189 values
.enable
= values
.disable
? 0 : 1;
190 values
.luns
= (values
.content
=== 'images') ? true : false;
192 ipanel
.setValues(values
);