perf: connection pooling, query consolidation, inline chart data, batch milestones

This commit is contained in:
Peter Stockings
2026-02-24 21:41:55 +11:00
parent 56168a182b
commit c76b4cd6fc
8 changed files with 219 additions and 88 deletions

View File

@@ -143,21 +143,18 @@
<script src="{{ url_for('static', filename='js/charts.js') }}"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
fetch('/api/chart-data/{{ user.id }}')
.then(r => r.json())
.then(data => {
if (data.labels.length > 0) {
createWeightChart('weightChart', data.labels, data.weights);
}
});
const chartLabels = {{ chart_labels | tojson
}};
const chartWeights = {{ chart_weights | tojson }};
const weeklyLabels = {{ weekly_labels | tojson }};
const weeklyChanges = {{ weekly_changes | tojson }};
fetch('/api/weekly-change/{{ user.id }}')
.then(r => r.json())
.then(data => {
if (data.labels.length > 0) {
createWeeklyChangeChart('weeklyChart', data.labels, data.changes);
}
});
if (chartLabels.length > 0) {
createWeightChart('weightChart', chartLabels, chartWeights);
}
if (weeklyLabels.length > 0) {
createWeeklyChangeChart('weeklyChart', weeklyLabels, weeklyChanges);
}
});
</script>
{% endblock %}