From c047ec94ac5f6bb86d6f5834042828d3290cb88e Mon Sep 17 00:00:00 2001 From: Lili Date: Mon, 16 Jan 2023 13:30:43 +0100 Subject: [PATCH] add auto-refresh to dashboard + fix bug selected "tab"/"button" is now properly highlighted dashboard refreshes every 30 seconds --- tlapbot/static/dashboard.js | 8 ++++++-- tlapbot/templates/dashboard.html | 9 +++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/tlapbot/static/dashboard.js b/tlapbot/static/dashboard.js index 193529b..bc64174 100644 --- a/tlapbot/static/dashboard.js +++ b/tlapbot/static/dashboard.js @@ -15,5 +15,9 @@ function openTab(event, tabName) { // Show the current tab, and add an "active" class to the button that opened the tab document.getElementById(tabName).style.display = "block"; - evt.currentTarget.className += " active"; - } \ No newline at end of file + event.currentTarget.className += " active"; + } + +function refreshPage() { + window.location.reload(); +} \ No newline at end of file diff --git a/tlapbot/templates/dashboard.html b/tlapbot/templates/dashboard.html index 58ef153..74d8a35 100644 --- a/tlapbot/templates/dashboard.html +++ b/tlapbot/templates/dashboard.html @@ -110,10 +110,11 @@ + + - -