Only show graphs on INT datatype

This commit is contained in:
Magnus Åhall 2024-06-26 12:01:47 +02:00
parent f0a6ce7b95
commit b6e1139e8a

View File

@ -5,14 +5,7 @@
{{ block "page_label" . }}{{end}} {{ block "page_label" . }}{{end}}
{{ if eq .Data.Display "list" }} {{ if and (eq .Data.Display "graph") (eq .Data.Datapoint.Datatype "INT") }}
<div id="values">
{{ range .Data.Values }}
<div class="value">{{ format_time .Ts }}</div>
<div class="value">{{ .Value }}</div>
{{ end }}
</div>
{{ else }}
<div class="graph" id="tester"></div> <div class="graph" id="tester"></div>
<script type="text/javascript"> <script type="text/javascript">
const tester = document.getElementById('tester'); const tester = document.getElementById('tester');
@ -31,5 +24,12 @@
} }
); );
</script> </script>
{{ else }}
<div id="values">
{{ range .Data.Values }}
<div class="value">{{ format_time .Ts }}</div>
<div class="value">{{ .Value }}</div>
{{ end }}
</div>
{{ end }} {{ end }}
{{ end }} {{ end }}