smon/views/pages/datapoint_values.gotmpl

25 lines
605 B
Go Template
Raw Normal View History

2024-05-05 20:16:28 +02:00
{{ define "page" }}
{{ $version := .VERSION }}
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/datapoints.css">
2024-05-20 13:19:22 +02:00
<script type="module" defer>
import { DataGraph } from "/js/{{ .VERSION }}/datapoint_graph.mjs"
const graph = new DataGraph({{ .Data.Datapoint }})
graph.setData({{ .Data.Values }})
graph.render('chart')
</script>
2024-05-05 20:16:28 +02:00
{{ block "page_label" . }}{{end}}
2024-05-20 13:19:22 +02:00
<div>
<canvas id="chart"></canvas>
</div>
2024-05-05 20:16:28 +02:00
<div id="values">
{{ range .Data.Values }}
<div class="value">{{ format_time .Ts }}</div>
<div class="value">{{ .Value }}</div>
{{ end }}
</div>
{{ end }}