chore: declare ttl property in schema

This commit is contained in:
Yohan Boniface 2024-06-03 17:35:59 +02:00
parent 16fd5d8ca3
commit dbafe19b7f
3 changed files with 13 additions and 14 deletions

View file

@ -478,8 +478,19 @@ export const SCHEMA = {
label: translate('To zoom'),
helpText: translate('Optional.'),
},
ttl: {
type: Number,
label: translate('Cache proxied request'),
choices: [
['', translate('No cache')],
['300', translate('5 min')],
['3600', translate('1 hour')],
['86400', translate('1 day')],
],
default: '300',
},
type: {
type: 'String',
type: String,
impacts: ['data'],
},
weight: {

View file

@ -340,15 +340,6 @@ L.FormBuilder.TextColorPicker = L.FormBuilder.ColorPicker.extend({
],
})
L.FormBuilder.ProxyTTLSelect = L.FormBuilder.Select.extend({
selectOptions: [
[undefined, L._('No cache')],
['300', L._('5 min')],
['3600', L._('1 hour')],
['86400', L._('1 day')],
],
})
L.FormBuilder.LayerTypeChooser = L.FormBuilder.Select.extend({
getOptions: function () {
const layer_classes = [

View file

@ -1407,10 +1407,7 @@ U.DataLayer = L.Evented.extend({
helpEntries: 'proxyRemoteData',
},
])
remoteDataFields.push([
'options.remoteData.ttl',
{ handler: 'ProxyTTLSelect', label: L._('Cache proxied request') },
])
remoteDataFields.push('options.remoteData.ttl')
}
const remoteDataContainer = L.DomUtil.createFieldset(container, L._('Remote data'))