Tweak display options for tempmon probe readings graph

This commit is contained in:
Lance Edgar 2023-07-07 17:56:45 -05:00
parent 4729785b05
commit a84bcf688b
2 changed files with 14 additions and 18 deletions

View file

@ -39,7 +39,13 @@
</b-field>
<b-field horizontal label="Showing">
${time_range}
<b-select v-model="currentTimeRange"
@input="timeRangeChanged">
<option value="last hour">Last Hour</option>
<option value="last 6 hours">Last 6 Hours</option>
<option value="last day">Last Day</option>
<option value="last week">Last Week</option>
</b-select>
</b-field>
</div>
@ -86,7 +92,9 @@
this.chart.destroy()
}
this.$http.get('${url('{}.graph_readings'.format(route_prefix), uuid=probe.uuid)}', {params: {'time-range': timeRange}}).then(({ data }) => {
let url = '${url(f'{route_prefix}.graph_readings', uuid=probe.uuid)}'
let params = {'time-range': timeRange}
this.$http.get(url, {params: params}).then(({ data }) => {
this.chart = new Chart(this.$refs.tempchart, {
type: 'scatter',