token-validator: update dashboard: include visualization for individual student

This commit is contained in:
nemunaire 2020-04-26 23:56:44 +02:00
parent 9f909b9cba
commit 85ad80a671
5 changed files with 130 additions and 39 deletions

View file

@ -7,7 +7,6 @@ import (
"net/http"
"path"
"strings"
"strconv"
"github.com/julienschmidt/httprouter"
)
@ -91,14 +90,10 @@ func init() {
}
})
Router().GET("/dashboard/:where", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
if _, err := strconv.ParseInt(string(ps.ByName("where")), 10, 64); err != nil {
http.NotFound(w, r)
if data, err := Asset("htdocs/dashboard.html"); err != nil {
fmt.Fprintf(w, "{\"errmsg\":%q}", err)
} else {
if data, err := Asset("htdocs/dashboard.html"); err != nil {
fmt.Fprintf(w, "{\"errmsg\":%q}", err)
} else {
w.Write(data)
}
w.Write(data)
}
})
Router().GET("/dashboard/:where/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {