feat: add server-sent events for logging and activity tracking
- Implemented a custom tracing layer (`AppLogLayer`) to capture log events and broadcast them to SSE clients. - Created admin routes for streaming server logs and listing recent activity logs. - Added an activity log repository interface and SQLite implementation for persisting activity events. - Integrated activity logging into user authentication and channel CRUD operations. - Developed frontend components for displaying server logs and activity logs in the admin panel. - Enhanced the video player with a stats overlay for monitoring streaming metrics.
This commit is contained in:
@@ -59,6 +59,32 @@ pub struct ConfigResponse {
|
||||
pub provider_capabilities: domain::ProviderCapabilities,
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Admin DTOs
|
||||
// ============================================================================
|
||||
|
||||
/// An activity log entry returned by GET /admin/activity.
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct ActivityEventResponse {
|
||||
pub id: Uuid,
|
||||
pub timestamp: DateTime<Utc>,
|
||||
pub event_type: String,
|
||||
pub detail: String,
|
||||
pub channel_id: Option<Uuid>,
|
||||
}
|
||||
|
||||
impl From<domain::ActivityEvent> for ActivityEventResponse {
|
||||
fn from(e: domain::ActivityEvent) -> Self {
|
||||
Self {
|
||||
id: e.id,
|
||||
timestamp: e.timestamp,
|
||||
event_type: e.event_type,
|
||||
detail: e.detail,
|
||||
channel_id: e.channel_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Channel DTOs
|
||||
// ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user