Show current graph period in drop down

This commit is contained in:
Herbert Wolverson 2023-06-14 18:49:28 +00:00
parent b305ff95fc
commit 3fc3dce54c
4 changed files with 64 additions and 60 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -40,9 +40,13 @@ window.setInterval(() => {
console.log("tick"); console.log("tick");
window.router.ontick(); window.router.ontick();
window.bus.updateConnected(); window.bus.updateConnected();
let btn = document.getElementById("graphPeriodBtn") as HTMLButtonElement;
btn.innerText = window.graphPeriod;
}, 1000); }, 1000);
function changeGraphPeriod(period: string) { function changeGraphPeriod(period: string) {
window.graphPeriod = period; window.graphPeriod = period;
localStorage.setItem('graphPeriod', period); localStorage.setItem('graphPeriod', period);
let btn = document.getElementById("graphPeriodBtn") as HTMLButtonElement;
btn.innerText = period;
} }

View File

@ -6,7 +6,7 @@
</a> </a>
<div class="dropdown" style="padding: 6px;"> <div class="dropdown" style="padding: 6px;">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false" id="graphPeriodBtn">
Graph Period Graph Period
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">