swap TopicCountInForums's implementation out for a saner one...
clean up repetition in route legends
This commit is contained in:
parent
ae8c27fc2d
commit
b1c9e0d11c
|
@ -402,5 +402,8 @@ func ArgQToTopicCount(argList []interface{}, qlist string) (topicCount int, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func TopicCountInForums(forums []Forum) (topicCount int, err error) {
|
func TopicCountInForums(forums []Forum) (topicCount int, err error) {
|
||||||
return ArgQToTopicCount(ForumListToArgQ(forums))
|
for _, f := range forums {
|
||||||
|
topicCount += f.TopicCount
|
||||||
|
}
|
||||||
|
return topicCount, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -834,7 +834,7 @@ func AnalyticsRoutesPerf(w http.ResponseWriter, r *http.Request, user c.User) c.
|
||||||
if inEx(ovitem.name) {
|
if inEx(ovitem.name) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if strings.HasPrefix(ovitem.name,"panel.") {
|
if strings.HasPrefix(ovitem.name, "panel.") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
var viewList []int64
|
var viewList []int64
|
||||||
|
@ -842,8 +842,9 @@ func AnalyticsRoutesPerf(w http.ResponseWriter, r *http.Request, user c.User) c.
|
||||||
viewList = append(viewList, ovitem.viewMap[value])
|
viewList = append(viewList, ovitem.viewMap[value])
|
||||||
}
|
}
|
||||||
vList = append(vList, viewList)
|
vList = append(vList, viewList)
|
||||||
legendList = append(legendList, ovitem.name)
|
shortName := strings.Replace(ovitem.name, "routes.", "r.", -1)
|
||||||
if i >= 6 {
|
legendList = append(legendList, shortName)
|
||||||
|
if i >= 7 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
|
@ -1082,8 +1083,9 @@ func AnalyticsRoutes(w http.ResponseWriter, r *http.Request, user c.User) c.Rout
|
||||||
viewList = append(viewList, ovitem.viewMap[value])
|
viewList = append(viewList, ovitem.viewMap[value])
|
||||||
}
|
}
|
||||||
vList = append(vList, viewList)
|
vList = append(vList, viewList)
|
||||||
legendList = append(legendList, ovitem.name)
|
shortName := strings.Replace(ovitem.name, "routes.", "r.", -1)
|
||||||
if i >= 6 {
|
legendList = append(legendList, shortName)
|
||||||
|
if i >= 7 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
|
|
Loading…
Reference in New Issue