1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Add total moderators/admins in stats

This commit is contained in:
Chocobozzz 2024-02-23 14:52:35 +01:00
parent bb7cb0d2fd
commit 0165786f65
No known key found for this signature in database
GPG key ID: 583A612D890159BE
8 changed files with 88 additions and 29 deletions

View file

@ -49,7 +49,14 @@ class StatsManager {
async getStats () {
const { totalLocalVideos, totalLocalVideoViews, totalVideos } = await VideoModel.getStats()
const { totalLocalVideoComments, totalVideoComments } = await VideoCommentModel.getStats()
const { totalUsers, totalDailyActiveUsers, totalWeeklyActiveUsers, totalMonthlyActiveUsers } = await UserModel.getStats()
const {
totalUsers,
totalDailyActiveUsers,
totalWeeklyActiveUsers,
totalMonthlyActiveUsers,
totalAdmins,
totalModerators
} = await UserModel.getStats()
const { totalInstanceFollowers, totalInstanceFollowing } = await ActorFollowModel.getStats()
const { totalLocalVideoFilesSize } = await VideoFileModel.getStats()
const {
@ -68,6 +75,14 @@ class StatsManager {
totalWeeklyActiveUsers,
totalMonthlyActiveUsers,
totalModerators: CONFIG.STATS.TOTAL_MODERATORS.ENABLED
? totalModerators
: null,
totalAdmins: CONFIG.STATS.TOTAL_ADMINS.ENABLED
? totalAdmins
: null,
totalLocalVideos,
totalLocalVideoViews,
totalLocalVideoComments,