This commit is contained in:
Magnus Åhall 2026-08-23 10:20:02 +02:00
parent e68a66f5ce
commit 24befcce36
3 changed files with 22 additions and 10 deletions

20
main.go
View file

@ -431,7 +431,25 @@ func pageIndex(w http.ResponseWriter, r *http.Request) { // {{{
page.Render(w, r)
} // }}}
func actionDashboardValues(w http.ResponseWriter, r *http.Request) { // {{{
values, err := DatapointsValue([]int{13, 15})
name := "start"
dashboard, err := DashboardGet(name)
if err != nil {
logger.Error("dashboard", "error", err)
httpError(w, err)
return
}
idMap := make(map[int]bool)
var ids []int
for _, w := range dashboard.Widgets {
idMap[w.DatapointID] = true
}
for id := range idMap {
ids = append(ids, id)
}
values, err := DatapointsValue(ids)
if err != nil {
logger.Error("dashboard", "error", err)
httpError(w, err)