monitoring setup, project dashboard, account page

This commit is contained in:
simon987
2019-02-09 13:16:58 -05:00
parent f577e76afa
commit 4ef4752c14
28 changed files with 629 additions and 160 deletions

View File

@@ -49,6 +49,12 @@ type GetAllProjectsResponse struct {
Projects *[]storage.Project `json:"projects,omitempty"`
}
type GetAssigneeStatsResponse struct {
Ok bool `json:"ok"`
Message string `json:"message,omitempty"`
Assignees *[]storage.AssignedTasks `json:"assignees"`
}
func (api *WebAPI) ProjectCreate(r *Request) {
createReq := &CreateProjectRequest{}
@@ -203,3 +209,16 @@ func (api *WebAPI) ProjectGetAllProjects(r *Request) {
Projects: projects,
})
}
func (api *WebAPI) ProjectGetAssigneeStats(r *Request) {
id, err := strconv.ParseInt(r.Ctx.UserValue("id").(string), 10, 64)
handleErr(err, r) //todo handle invalid id
stats := api.Database.GetAssigneeStats(id, 16)
r.OkJson(GetAssigneeStatsResponse{
Ok: true,
Assignees: stats,
})
}