]>
git.proxmox.com Git - pve-manager.git/blob - www/manager6/storage/NFSEdit.js
1 /*jslint confusion: true*/
2 Ext
.define('PVE.storage.NFSScan', {
3 extend
: 'Ext.form.field.ComboBox',
4 alias
: 'widget.pveNFSScan',
10 matchFieldWidth
: false,
12 loadingText
: gettext('Scanning...'),
15 doRawQuery: function() {
18 onTriggerClick: function() {
21 if (!me
.queryCaching
|| me
.lastQuery
!== me
.nfsServer
) {
25 me
.allQuery
= me
.nfsServer
;
30 setServer: function(server
) {
33 me
.nfsServer
= server
;
36 initComponent : function() {
40 me
.nodename
= 'localhost';
43 var store
= Ext
.create('Ext.data.Store', {
44 fields
: [ 'path', 'options' ],
47 url
: '/api2/json/nodes/' + me
.nodename
+ '/scan/nfs'
51 store
.sort('path', 'ASC');
61 Ext
.define('PVE.storage.NFSInputPanel', {
62 extend
: 'PVE.panel.StorageBase',
64 onlineHelp
: 'storage_nfs',
68 onGetValues: function(values
) {
73 for (i
= 0; i
< me
.options
.length
; i
++) {
74 var item
= me
.options
[i
];
75 if (!item
.match(/^vers=(.*)$/)) {
79 if (values
.nfsversion
&& values
.nfsversion
!== '__default__') {
80 res
.push('vers=' + values
.nfsversion
);
82 delete values
.nfsversion
;
83 values
.options
= res
.join(',');
84 if (values
.options
=== '') {
85 delete values
.options
;
87 values
["delete"] = "options";
91 return me
.callParent([values
]);
94 setValues: function(values
) {
97 var res
= values
.options
;
98 me
.options
= values
.options
.split(',');
99 me
.options
.forEach(function(item
) {
100 var match
= item
.match(/^vers=(.*)$/);
102 values
.nfsversion
= match
[1];
106 return me
.callParent([values
]);
109 initComponent : function() {
115 xtype
: me
.isCreate
? 'textfield' : 'displayfield',
118 fieldLabel
: gettext('Server'),
121 change: function(f
, value
) {
123 var exportField
= me
.down('field[name=export]');
124 exportField
.setServer(value
);
125 exportField
.setValue('');
131 xtype
: me
.isCreate
? 'pveNFSScan' : 'displayfield',
134 fieldLabel
: 'Export',
138 xtype
: 'pveContentTypeSelector',
142 fieldLabel
: gettext('Content'),
149 xtype
: 'proxmoxintegerfield',
150 fieldLabel
: gettext('Max Backups'),
153 reference
: 'maxfiles',
156 value
: me
.isCreate
? '1' : undefined,
161 me
.advancedColumn1
= [
163 xtype
: 'proxmoxKVComboBox',
164 fieldLabel
: gettext('NFS Version'),
166 value
: '__default__',
169 ['__default__', Proxmox
.Utils
.defaultText
],