diff --git a/frontend/src/components/ConnectionTracker/ConnectionTracker.tsx b/frontend/src/components/ConnectionTracker/ConnectionTracker.tsx
new file mode 100644
index 0000000..c4e5780
--- /dev/null
+++ b/frontend/src/components/ConnectionTracker/ConnectionTracker.tsx
@@ -0,0 +1,203 @@
+import { useState, useEffect } from 'react';
+import { settingsApi } from '../../services/apiClient';
+
+const formatTime = (minutes: number): string => {
+ if (minutes < 1) {
+ return `${Math.round(minutes * 60)}s`;
+ }
+ if (minutes < 60) {
+ return `${Math.round(minutes)}m`;
+ }
+ const hours = Math.floor(minutes / 60);
+ const mins = Math.round(minutes % 60);
+ if (mins === 0) {
+ return `${hours}h`;
+ }
+ return `${hours}h ${mins}m`;
+};
+
+interface Connection {
+ sessionId: string;
+ userId?: number;
+ username?: string;
+ route?: string;
+ videoTitle?: string;
+ videoChannel?: string;
+ timeUsed?: number;
+ dailyLimit?: number;
+ lastHeartbeat: number;
+ connectedAt: number;
+}
+
+interface ConnectionStats {
+ total: number;
+ authenticated: number;
+ anonymous: number;
+ connections?: Connection[];
+}
+
+export function ConnectionTracker() {
+ const [stats, setStats] = useState Loading...
+ Number of users currently connected to the app
+ Active Connections
+ Active Connections
+ Connection Details
+
+ View active user connections and routes +
+ ); diff --git a/frontend/src/pages/StatsAdminPage.tsx b/frontend/src/pages/StatsAdminPage.tsx new file mode 100644 index 0000000..949f80c --- /dev/null +++ b/frontend/src/pages/StatsAdminPage.tsx @@ -0,0 +1,23 @@ +import { Link } from 'react-router-dom'; +import { ConnectionTracker } from '../components/ConnectionTracker/ConnectionTracker'; + +export function StatsAdminPage() { + return ( +View active user connections and their current routes
+