Nicer looking value selector
This commit is contained in:
parent
50664ca965
commit
0eb945f3e0
8 changed files with 125 additions and 11 deletions
7
main.go
7
main.go
|
|
@ -724,6 +724,13 @@ func pageDatapointValues(w http.ResponseWriter, r *http.Request, _ *session.T) {
|
|||
return
|
||||
}
|
||||
|
||||
// Apply an optionally set offset (in seconds).
|
||||
var offsetTime int
|
||||
offsetTimeStr := r.URL.Query().Get("offset-time")
|
||||
offsetTime, err = strconv.Atoi(offsetTimeStr)
|
||||
timeFrom = timeFrom.Add(time.Second * time.Duration(offsetTime))
|
||||
timeTo = timeTo.Add(time.Second * time.Duration(offsetTime))
|
||||
|
||||
// Fetch data point values according to the times.
|
||||
var values []DatapointValue
|
||||
values, err = DatapointValues(id, timeFrom, timeTo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue