Bumped to v8

This commit is contained in:
Magnus Åhall 2024-05-20 13:19:22 +02:00
parent 787009c621
commit ff1c848c58
3 changed files with 24 additions and 1 deletions

View File

@ -26,7 +26,7 @@ import (
"time" "time"
) )
const VERSION = "v7" const VERSION = "v8"
var ( var (
logger *slog.Logger logger *slog.Logger

View File

@ -5,6 +5,18 @@
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
{{ template "fonts" }} {{ template "fonts" }}
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/main.css"> <link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/main.css">
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.2.1/dist/chart.umd.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luxon@3.3.0/build/global/luxon.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon@1.3.1"></script>
<script type="importmap">
{
"imports": {
"chart.js": "/js/{{ .VERSION }}/lib/chartjs/index.d.ts"
}
}
</script>
</head> </head>
<body> <body>
<div id="layout"> <div id="layout">

View File

@ -2,8 +2,19 @@
{{ $version := .VERSION }} {{ $version := .VERSION }}
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/datapoints.css"> <link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/datapoints.css">
<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>
{{ block "page_label" . }}{{end}} {{ block "page_label" . }}{{end}}
<div>
<canvas id="chart"></canvas>
</div>
<div id="values"> <div id="values">
{{ range .Data.Values }} {{ range .Data.Values }}
<div class="value">{{ format_time .Ts }}</div> <div class="value">{{ format_time .Ts }}</div>