implement session stats, fixes last (admin|user) left at won't work for any provider that removed users after logout.

This commit is contained in:
Miroslav Šedivý
2024-09-07 18:55:27 +02:00
parent 356a566bc6
commit 4f401ac2b6
7 changed files with 124 additions and 21 deletions
+39
View File
@@ -125,6 +125,21 @@ paths:
schema:
$ref: '#/components/schemas/MemberProfile'
required: true
/api/stats:
get:
summary: stats
operationId: stats
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/Stats'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/Forbidden'
#
# sessions
@@ -1145,6 +1160,30 @@ components:
is_watching:
type: boolean
Stats:
type: object
properties:
has_host:
type: boolean
host_id:
type: string
optional: true
server_started_at:
type: string
format: date-time
total_users:
type: integer
last_user_left_at:
type: string
format: date-time
optional: true
total_admins:
type: integer
last_admin_left_at:
type: string
format: date-time
optional: true
#
# room
#