feat: limit hosts to 15 in stats query
This commit is contained in:
parent
dd9234af1b
commit
b70f29b6a8
|
@ -23,7 +23,7 @@
|
|||
let total = context.dataset.data.reduce((total, next) => total + next);
|
||||
let percentage = (context.raw / total * 100).toFixed(2);
|
||||
|
||||
return `${context.label} (${percentage}%)`;
|
||||
return `${context.label} (${context.raw}, ${percentage}%)`;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -117,7 +117,7 @@
|
|||
}
|
||||
|
||||
makeChart('duties', 'dutiesChart', 'pie', true);
|
||||
makeChart('hosts', 'hostsChart', 'pie', true);
|
||||
makeChart('hosts', 'hostsChart', 'pie');
|
||||
makeChart('hours', 'hoursChart', 'bar');
|
||||
makeChart('days', 'daysChart', 'bar');
|
||||
})();
|
||||
|
|
|
@ -49,6 +49,10 @@ impl Statistics {
|
|||
|
||||
format!("{} @ {}", aliases[0].name.text(), world).into()
|
||||
}
|
||||
|
||||
pub fn num_host_listings(&self) -> usize {
|
||||
self.hosts.iter().map(|info| info.count).sum()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
|
|
@ -58,6 +58,9 @@ lazy_static::lazy_static! {
|
|||
"$sort": {
|
||||
"count": -1
|
||||
}
|
||||
},
|
||||
{
|
||||
"$limit": 15
|
||||
}
|
||||
],
|
||||
"hours": [
|
||||
|
|
|
@ -64,6 +64,10 @@ Remote Party Finder
|
|||
<td>{{ info.count }}</td>
|
||||
</tr>
|
||||
{%- endfor %}
|
||||
<tr>
|
||||
<td>Other</td>
|
||||
<td>{{ stats.num_listings() - stats.num_host_listings() }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
|
|
Loading…
Reference in New Issue