More work on UI

This commit is contained in:
simon987
2019-01-23 19:38:33 -05:00
parent cbd32daf02
commit 1d656099f5
31 changed files with 288 additions and 131 deletions

View File

@@ -33,6 +33,12 @@ type GetProjectStatsResponse struct {
Stats *storage.ProjectStats `json:"stats,omitempty"`
}
type GetAllProjectsStatsResponse struct {
Ok bool `json:"ok"`
Message string `json:"message,omitempty"`
Stats *[]storage.ProjectStats `json:"stats,omitempty"`
}
func (api *WebAPI) ProjectCreate(r *Request) {
createReq := &CreateProjectRequest{}
@@ -125,3 +131,13 @@ func (api *WebAPI) ProjectGetStats(r *Request) {
}, 404)
}
}
func (api *WebAPI) ProjectGetAllStats(r *Request) {
stats := api.Database.GetAllProjectsStats()
r.OkJson(GetAllProjectsStatsResponse{
Ok: true,
Stats: stats,
})
}