Refresh index button

This commit is contained in:
Ruben van de Ven 2022-01-19 11:15:55 +01:00
parent 96c4f6aec9
commit 24f9876274
2 changed files with 9 additions and 0 deletions

View file

@ -38,6 +38,9 @@
<li>{{ annotation }}</li>
{% end %}
</ul> -->
<hr>
<a href="?refresh">Reload index</a>
</body>
<script>
let images = document.querySelectorAll('[data-audio]');

View file

@ -345,6 +345,12 @@ class IndexHandler(tornado.web.RequestHandler):
self.index = index
def get(self):
do_refresh = bool(self.get_query_argument('refresh', False))
if do_refresh:
self.logger.info("Reloading Annotation Index")
self.index.refresh()
self.logger.info("\treloaded annotation index")
self.render("templates/index.html", index=self.index)
class Server: