perf: connection pooling, query consolidation, inline chart data, batch milestones
This commit is contained in:
@@ -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 %}
|
||||
Reference in New Issue
Block a user