Barchart filters

This commit is contained in:
2015-03-09 20:31:51 +07:00
parent 2191a0c246
commit c2fd42bed0
5 changed files with 191 additions and 63 deletions
+15 -15
View File
@@ -19,13 +19,13 @@ type (
login string
}
statRequest struct {
Org string `structs:"org"`
Team string `structs:"team"`
Author string `structs:"author"`
Repo string `structs:"repo"`
From int64 `structs:"from"`
To int64 `structs:"to"`
Item string `structs:"item"`
Org string `structs:"org"`
Team string `structs:"team"`
User string `structs:"user"`
Repo string `structs:"repo"`
From int64 `structs:"from"`
To int64 `structs:"to"`
Item string `structs:"item"`
}
)
@@ -76,7 +76,7 @@ func parseStatRequest(r *http.Request) *statRequest {
var item string
switch val := r.FormValue("item"); val {
case "author":
case "author", "user":
item = "c.author"
case "team":
item = "t.name"
@@ -85,13 +85,13 @@ func parseStatRequest(r *http.Request) *statRequest {
}
return &statRequest{
Org: r.FormValue("org"),
Team: r.FormValue("team"),
Author: r.FormValue("author"),
Repo: r.FormValue("repo"),
From: from,
To: to,
Item: item,
Org: r.FormValue("org"),
Team: r.FormValue("team"),
User: r.FormValue("user"),
Repo: r.FormValue("repo"),
From: from,
To: to,
Item: item,
}
}