Refresh index button
This commit is contained in:
parent
96c4f6aec9
commit
24f9876274
2 changed files with 9 additions and 0 deletions
|
@ -38,6 +38,9 @@
|
||||||
<li>{{ annotation }}</li>
|
<li>{{ annotation }}</li>
|
||||||
{% end %}
|
{% end %}
|
||||||
</ul> -->
|
</ul> -->
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
<a href="?refresh">Reload index</a>
|
||||||
</body>
|
</body>
|
||||||
<script>
|
<script>
|
||||||
let images = document.querySelectorAll('[data-audio]');
|
let images = document.querySelectorAll('[data-audio]');
|
||||||
|
|
|
@ -345,6 +345,12 @@ class IndexHandler(tornado.web.RequestHandler):
|
||||||
self.index = index
|
self.index = index
|
||||||
|
|
||||||
def get(self):
|
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)
|
self.render("templates/index.html", index=self.index)
|
||||||
|
|
||||||
class Server:
|
class Server:
|
||||||
|
|
Loading…
Reference in a new issue