better authenticarion

This commit is contained in:
2026-08-30 11:33:13 +02:00
parent fcae3569fc
commit ea591fc8fb
10 changed files with 299 additions and 16 deletions
+5 -2
View File
@@ -24,14 +24,17 @@
{% endfor %}
</main>
<script>
const graphUrlTemplate = {{ graph_url_template|tojson }};
const buttons = document.querySelectorAll('button[data-period]');
buttons.forEach(button => button.addEventListener('click', () => {
buttons.forEach(item => item.classList.toggle('active', item === button));
document.querySelectorAll('img[data-name]').forEach(image => {
image.src = `/graph/${image.dataset.name}/${button.dataset.period}?t=${Date.now()}`;
const graphUrl = graphUrlTemplate
.replace('__name__', encodeURIComponent(image.dataset.name))
.replace('__period__', encodeURIComponent(button.dataset.period));
image.src = `${graphUrl}?t=${Date.now()}`;
});
}));
</script>
</body>
</html>