Merged
This commit is contained in:
parent
e68a66f5ce
commit
24befcce36
3 changed files with 22 additions and 10 deletions
20
main.go
20
main.go
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue