Added ban stats on frontpage

This commit is contained in:
nise.moe 2024-03-08 09:32:41 +01:00
parent 889d2c40e4
commit 814aef4bbe
4 changed files with 8 additions and 2 deletions

View File

@ -35,7 +35,8 @@ data class Statistics(
val total_users: Int,
val total_scores: Int,
val total_replay_scores: Int,
val total_replay_similarity: Int
val total_replay_similarity: Int,
val total_bans: Int,
)
data class SuspiciousScoreEntry(

View File

@ -17,7 +17,8 @@ class StatisticsService(private val dslContext: DSLContext) {
dslContext.fetchCount(USERS),
dslContext.fetchCount(SCORES),
dslContext.fetchCount(SCORES, SCORES.REPLAY.isNotNull),
dslContext.fetchCount(SCORES_SIMILARITY)
dslContext.fetchCount(SCORES_SIMILARITY),
dslContext.fetchCount(USERS, USERS.IS_BANNED.eq(true))
)
}

View File

@ -1,5 +1,8 @@
<div class="main term text-center statistics">
Players: {{ this.statistics?.total_users | number }} | Beatmaps: {{ this.statistics?.total_beatmaps | number }} | Scores: {{ this.statistics?.total_scores | number }}
<ng-container *ngIf="this.statistics?.total_bans">
| <a [routerLink]="['/banlist']">Bans: {{ this.statistics?.total_bans | number }}</a>
</ng-container>
</div>
<div class="main container">

View File

@ -16,6 +16,7 @@ interface Statistics {
total_scores: number;
total_replay_scores: number;
total_replay_similarity: number;
total_bans: number;
}
interface AnalyzeReplayResponse {