]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/NFSEdit.js
1 Ext
.define('PVE.storage.NFSScan', {
2 extend
: 'Ext.form.field.ComboBox',
3 alias
: 'widget.pveNFSScan',
9 matchFieldWidth
: false,
11 loadingText
: gettext('Scanning...'),
14 doRawQuery: function() {
17 onTriggerClick: function() {
20 if (!me
.queryCaching
|| me
.lastQuery
!== me
.nfsServer
) {
24 me
.allQuery
= me
.nfsServer
;
29 setServer: function(server
) {
32 me
.nfsServer
= server
;
35 initComponent : function() {
39 me
.nodename
= 'localhost';
42 var store
= Ext
.create('Ext.data.Store', {
43 fields
: [ 'path', 'options' ],
46 url
: '/api2/json/nodes/' + me
.nodename
+ '/scan/nfs',
50 store
.sort('path', 'ASC');
60 Ext
.define('PVE.storage.NFSInputPanel', {
61 extend
: 'PVE.panel.StorageBase',
63 onlineHelp
: 'storage_nfs',
67 onGetValues: function(values
) {
72 for (i
= 0; i
< me
.options
.length
; i
++) {
73 var item
= me
.options
[i
];
74 if (!item
.match(/^vers=(.*)$/)) {
78 if (values
.nfsversion
&& values
.nfsversion
!== '__default__') {
79 res
.push('vers=' + values
.nfsversion
);
81 delete values
.nfsversion
;
82 values
.options
= res
.join(',');
83 if (values
.options
=== '') {
84 delete values
.options
;
86 values
["delete"] = "options";
90 return me
.callParent([values
]);
93 setValues: function(values
) {
96 var res
= values
.options
;
97 me
.options
= values
.options
.split(',');
98 me
.options
.forEach(function(item
) {
99 var match
= item
.match(/^vers=(.*)$/);
101 values
.nfsversion
= match
[1];
105 return me
.callParent([values
]);
108 initComponent : function() {
114 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
117 fieldLabel
: gettext('Server'),
120 change: function(f
, value
) {
122 var exportField
= me
.down('field[name=export]');
123 exportField
.setServer(value
);
124 exportField
.setValue('');
130 xtype
: me
.isCreate
? 'pveNFSScan' : 'displayfield',
133 fieldLabel
: 'Export',
137 xtype
: 'pveContentTypeSelector',
141 fieldLabel
: gettext('Content'),
146 me
.advancedColumn1
= [
148 xtype
: 'proxmoxKVComboBox',
149 fieldLabel
: gettext('NFS Version'),
151 value
: '__default__',
154 ['__default__', Proxmox
.Utils
.defaultText
],