mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
feat: basic implementation of branch statistics
This commit is contained in:
@@ -105,6 +105,7 @@ func (h *BadgeHandler) Get(w http.ResponseWriter, r *http.Request) {
|
||||
case "label":
|
||||
permitEntity = user.ShareLabels
|
||||
filters = models.NewFiltersWith(models.SummaryLabel, filterKey)
|
||||
// branches are intentionally omitted here, as only relevant in combination with a project filter
|
||||
default:
|
||||
permitEntity = true
|
||||
filters = &models.Filters{}
|
||||
|
@@ -77,6 +77,9 @@ func typeName(t uint8) string {
|
||||
if t == models.SummaryLabel {
|
||||
return "label"
|
||||
}
|
||||
if t == models.SummaryBranch {
|
||||
return "branch"
|
||||
}
|
||||
return "unknown"
|
||||
}
|
||||
|
||||
|
@@ -51,5 +51,8 @@ func ParseFilters(r *http.Request) *models.Filters {
|
||||
if q := r.URL.Query().Get("label"); q != "" {
|
||||
filters.With(models.SummaryLabel, q)
|
||||
}
|
||||
if q := r.URL.Query().Get("branch"); q != "" {
|
||||
filters.With(models.SummaryBranch, q)
|
||||
}
|
||||
return filters
|
||||
}
|
||||
|
Reference in New Issue
Block a user