feat: add admin dashboard with usage stats

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-05 09:26:55 +02:00
parent 78f1659db4
commit 5dedb8fac0
9 changed files with 636 additions and 1 deletions
+25
View File
@@ -0,0 +1,25 @@
const ADMIN_ENV_KEY = 'ADMIN_USER_IDS'
export function getAdminUserIds(): Set<string> {
const raw = process.env[ADMIN_ENV_KEY]
if (!raw) {
return new Set()
}
const ids = raw
.split(',')
.map((id) => id.trim())
.filter((id) => id.length > 0)
if (ids.length === 0) {
return new Set()
}
return new Set(ids)
}
export function isAdminUserId(userId: string): boolean {
const adminIds = getAdminUserIds()
return adminIds.has(userId)
}