From 814aef4bbee01603ee04ddac3a9d0274005bc027 Mon Sep 17 00:00:00 2001 From: "nise.moe" Date: Fri, 8 Mar 2024 09:32:41 +0100 Subject: [PATCH] Added ban stats on frontpage --- nise-backend/src/main/kotlin/com/nisemoe/nise/Models.kt | 3 ++- .../main/kotlin/com/nisemoe/nise/database/StatisticsService.kt | 3 ++- nise-frontend/src/app/home/home.component.html | 3 +++ nise-frontend/src/app/home/home.component.ts | 1 + 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nise-backend/src/main/kotlin/com/nisemoe/nise/Models.kt b/nise-backend/src/main/kotlin/com/nisemoe/nise/Models.kt index c2bd258..019542c 100644 --- a/nise-backend/src/main/kotlin/com/nisemoe/nise/Models.kt +++ b/nise-backend/src/main/kotlin/com/nisemoe/nise/Models.kt @@ -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( diff --git a/nise-backend/src/main/kotlin/com/nisemoe/nise/database/StatisticsService.kt b/nise-backend/src/main/kotlin/com/nisemoe/nise/database/StatisticsService.kt index d958ea5..7998848 100644 --- a/nise-backend/src/main/kotlin/com/nisemoe/nise/database/StatisticsService.kt +++ b/nise-backend/src/main/kotlin/com/nisemoe/nise/database/StatisticsService.kt @@ -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)) ) } diff --git a/nise-frontend/src/app/home/home.component.html b/nise-frontend/src/app/home/home.component.html index 04cd255..e8462cb 100644 --- a/nise-frontend/src/app/home/home.component.html +++ b/nise-frontend/src/app/home/home.component.html @@ -1,5 +1,8 @@
Players: {{ this.statistics?.total_users | number }} | Beatmaps: {{ this.statistics?.total_beatmaps | number }} | Scores: {{ this.statistics?.total_scores | number }} + + | Bans: {{ this.statistics?.total_bans | number }} +
diff --git a/nise-frontend/src/app/home/home.component.ts b/nise-frontend/src/app/home/home.component.ts index 803cc3f..64f46e8 100644 --- a/nise-frontend/src/app/home/home.component.ts +++ b/nise-frontend/src/app/home/home.component.ts @@ -16,6 +16,7 @@ interface Statistics { total_scores: number; total_replay_scores: number; total_replay_similarity: number; + total_bans: number; } interface AnalyzeReplayResponse {