1
0
Fork 0
mirror of https://github.com/koniu/recoll-webui.git synced 2025-10-05 10:39:27 +02:00

add a setting for local access url paths

This commit is contained in:
koniu 2012-12-19 11:02:56 +00:00
parent 8fe7918ff6
commit 68ca48cf80
3 changed files with 25 additions and 10 deletions

View file

@ -13,6 +13,7 @@ import StringIO
import ConfigParser
import string
import shlex
import urllib
from pprint import pprint
#}}}
#{{{ settings
@ -111,6 +112,11 @@ def get_config():
# get config from cookies or defaults
for k, v in DEFAULTS.items():
config[k] = select([bottle.request.get_cookie(k), v])
# get mountpoints
config['mounts'] = {}
for d in config['dirs']:
name = 'mount_%s' % urllib.quote(d,'')
config['mounts'][d] = select([bottle.request.get_cookie(name), 'file://%s' % d], [None, ''])
return config
#}}}
#{{{ get_dirs
@ -237,8 +243,12 @@ def settings():
@bottle.route('/set')
def set():
config = get_config()
for k, v in DEFAULTS.items():
bottle.response.set_cookie(k, str(bottle.request.query.get(k)), max_age=3153600000)
for d in config['dirs']:
cookie_name = 'mount_%s' % urllib.quote(d, '')
bottle.response.set_cookie(cookie_name, str(bottle.request.query.get('mount_%s' % d)), max_age=3153600000)
bottle.redirect('..')
#}}}
#}}}