cmd/ursrv: Display more relevant data (#17)

This commit is contained in:
Simon Frei 2018-09-09 14:28:02 +02:00 committed by Jakob Borg
parent 37cd5a0bec
commit 0a29fa65ab
2 changed files with 18 additions and 14 deletions

View File

@ -61,7 +61,7 @@ var funcs = map[string]interface{}{
parts = append(parts, part)
}
if len(input) > 0 {
parts = append(parts, input[:len(input)])
parts = append(parts, input[:])
}
return parts[whichPart-1]
},
@ -1329,10 +1329,10 @@ func getReport(db *sql.DB) map[string]interface{} {
r["nodes"] = nodes
r["versionNodes"] = reports
r["categories"] = categories
r["versions"] = group(byVersion, analyticsFor(versions, 2000), 5)
r["versions"] = group(byVersion, analyticsFor(versions, 2000), 10)
r["versionPenetrations"] = penetrationLevels(analyticsFor(versions, 2000), []float64{50, 75, 90, 95})
r["platforms"] = group(byPlatform, analyticsFor(platforms, 2000), 5)
r["compilers"] = group(byCompiler, analyticsFor(compilers, 2000), 3)
r["compilers"] = group(byCompiler, analyticsFor(compilers, 2000), 5)
r["builders"] = analyticsFor(builders, 12)
r["featureOrder"] = featureOrder
r["locations"] = locations

View File

@ -385,18 +385,20 @@ found in the LICENSE file.
</thead>
<tbody>
{{range .versions}}
{{if gt .Percentage 0.5}}
{{if gt .Percentage 0.1}}
<tr class="main">
<td>{{.Key}}</td>
<td class="text-right">{{.Count}}</td>
<td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
</tr>
{{range .Items}}
<tr class="child">
<td class="first">{{.Key}}</td>
<td class="text-right">{{.Count}}</td>
<td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
</tr>
{{if gt .Percentage 0.1}}
<tr class="child">
<td class="first">{{.Key}}</td>
<td class="text-right">{{.Count}}</td>
<td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
</tr>
{{end}}
{{end}}
{{end}}
{{end}}
@ -470,11 +472,13 @@ found in the LICENSE file.
<td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
</tr>
{{range .Items}}
<tr class="child">
<td class="first">{{.Key}}</td>
<td class="text-right">{{.Count}}</td>
<td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
</tr>
{{if or (gt .Percentage 0.1) (eq .Key "Others")}}
<tr class="child">
<td class="first">{{.Key}}</td>
<td class="text-right">{{.Count}}</td>
<td class="text-right">{{.Percentage | printf "%.01f"}}%</td>
</tr>
{{end}}
{{end}}
{{end}}
</tbody>