better authenticarion
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user