add ability to clear the cache
This commit is contained in:
parent
de5dd44d9a
commit
fc42cba8f8
|
@ -101,6 +101,13 @@
|
|||
=config_number('Port for the api server to listen on', 'bw_port', config.bw_port, 1024, 65535)
|
||||
=config_checkbox('Use an external api server', 'bw_external', config.bw_external)
|
||||
|
||||
%details.category.section open
|
||||
%summary << Maintenance
|
||||
.container.grid-container
|
||||
%span << Cache
|
||||
%span
|
||||
%a.button onclick='request("/action/clear-cache");' << Clear
|
||||
|
||||
%details.category.section open
|
||||
%summary << Advanced
|
||||
.container.grid-container
|
||||
|
|
|
@ -75,6 +75,13 @@ def about(handler, request):
|
|||
return request.page('about')
|
||||
|
||||
|
||||
### Actions ###
|
||||
@Local.route('/action/clear-cache')
|
||||
def action_clear_cache(handler, request):
|
||||
handler.app.context.clear_cache()
|
||||
return request.ok_or_redirect('Cleared cache')
|
||||
|
||||
|
||||
### Bookmarks ###
|
||||
@Local.route('/bookmarks')
|
||||
def bookmarks_home(handler, request):
|
||||
|
|
Reference in a new issue