mirror of
https://github.com/koniu/recoll-webui.git
synced 2025-10-03 17:59:50 +02:00
enable global configuration of path rewrites (fixes #78)
This commit is contained in:
parent
4e748d6544
commit
c3151abc2b
1 changed files with 10 additions and 1 deletions
11
webui.py
11
webui.py
|
@ -40,6 +40,15 @@ DEFAULTS = {
|
||||||
'perpage': 25,
|
'perpage': 25,
|
||||||
'csvfields': 'filename title author size time mtype url',
|
'csvfields': 'filename title author size time mtype url',
|
||||||
'title_link': 'download',
|
'title_link': 'download',
|
||||||
|
'mounts': {
|
||||||
|
# Override default links for directories.
|
||||||
|
# Useful for rewriting links to access the files on a server.
|
||||||
|
# If not specified, the url will be dir path prefixed with 'file://'.
|
||||||
|
#
|
||||||
|
# Path in recoll.conf : Remote url
|
||||||
|
# '/media/data/docs' : 'https://media.server.com/docs',
|
||||||
|
# '/var/www/data' : 'file:///192.168.1.2/data',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
# sort fields/labels
|
# sort fields/labels
|
||||||
|
@ -123,7 +132,7 @@ def get_config():
|
||||||
config['mounts'] = {}
|
config['mounts'] = {}
|
||||||
for d in config['dirs']:
|
for d in config['dirs']:
|
||||||
name = 'mount_%s' % urllib.quote(d,'')
|
name = 'mount_%s' % urllib.quote(d,'')
|
||||||
config['mounts'][d] = select([bottle.request.get_cookie(name), 'file://%s' % d], [None, ''])
|
config['mounts'][d] = select([bottle.request.get_cookie(name), DEFAULTS['mounts'].get(d), 'file://%s' % d], [None, ''])
|
||||||
return config
|
return config
|
||||||
#}}}
|
#}}}
|
||||||
#{{{ get_dirs
|
#{{{ get_dirs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue