use the aggregated data and show it, the same way as in summary #428
This commit is contained in:
parent
00fd1bd361
commit
3bf2384451
|
|
@ -84,10 +84,23 @@ HTMLRenderer.prototype.renderRules = function (cb) {
|
|||
renderHtmlToFile('rules', renderData, cb);
|
||||
};
|
||||
|
||||
HTMLRenderer.prototype.renderSites = function (sitesAggregates, cb) {
|
||||
HTMLRenderer.prototype.renderSites = function(sitesAggregates, cb) {
|
||||
|
||||
var sitesAndAggregates = [];
|
||||
|
||||
// Add all sites data sorted
|
||||
Object.keys(sitesAggregates).forEach(function(site) {
|
||||
sitesAndAggregates.push({
|
||||
"site": site,
|
||||
"aggregates": sitesAggregates[site].filter(function(box) {
|
||||
return (config.sitesColumns.indexOf(box.id) > -1);
|
||||
}).sort(function(box, box2) {
|
||||
return config.sitesColumns.indexOf(box.id) - config.sitesColumns.indexOf(box2.id);
|
||||
})
|
||||
});
|
||||
});
|
||||
var renderData = {
|
||||
"sites": Object.keys(sitesAggregates),
|
||||
"aggregates": sitesAggregates,
|
||||
"sitesAndAggregates": sitesAndAggregates,
|
||||
"columns": config.sitesColumns,
|
||||
"config": config,
|
||||
"pageMeta": {
|
||||
|
|
@ -95,7 +108,8 @@ HTMLRenderer.prototype.renderSites = function (sitesAggregates, cb) {
|
|||
"description": "",
|
||||
}
|
||||
};
|
||||
renderHtmlToFile('sites', renderData, cb, 'sites.html', '..');
|
||||
|
||||
renderHtmlToFile('sites', renderData, cb, 'sites.html', '..');
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each sites}}
|
||||
{{#each sitesAndAggregates}}
|
||||
<tr>
|
||||
<td>
|
||||
<a href="{{getHostname this}}/index.html">{{this}}</a>
|
||||
<a href="{{getHostname this.site}}/index.html">{{this.site}}</a>
|
||||
</td>
|
||||
{{#each ../columns}}
|
||||
<td>{{getSiteAggregatedValue .. 'median' this ../../aggregates }}</td>
|
||||
{{#each aggregates}}
|
||||
<td data-sort-value="{{stats.median}}">{{getHumanReadable this stats.median true}}</td>
|
||||
{{/each}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue