mirror of
https://github.com/umami-software/umami.git
synced 2026-02-14 09:35:36 +01:00
Add rrweb-based session recording feature.
Implements full session recording with rrweb for DOM capture and rrweb-player for playback. Includes: Prisma schema for SessionRecording model, chunked gzip-compressed storage, recorder script built via Rollup, collection API endpoint, recordings list/playback UI pages, website recording settings, and cascade delete support. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
b9eb5f9800
commit
72b5c658e2
36 changed files with 1131 additions and 21 deletions
|
|
@ -42,6 +42,17 @@ export async function POST(
|
|||
name: z.string().optional(),
|
||||
domain: z.string().optional(),
|
||||
shareId: z.string().max(50).nullable().optional(),
|
||||
recordingEnabled: z.boolean().optional(),
|
||||
recordingConfig: z
|
||||
.object({
|
||||
sampleRate: z.number().min(0).max(1).optional(),
|
||||
maskLevel: z.enum(['strict', 'moderate', 'relaxed']).optional(),
|
||||
maxDuration: z.number().int().positive().optional(),
|
||||
blockSelector: z.string().optional(),
|
||||
retentionDays: z.number().int().positive().optional(),
|
||||
})
|
||||
.nullable()
|
||||
.optional(),
|
||||
});
|
||||
|
||||
const { auth, body, error } = await parseRequest(request, schema);
|
||||
|
|
@ -51,14 +62,19 @@ export async function POST(
|
|||
}
|
||||
|
||||
const { websiteId } = await params;
|
||||
const { name, domain, shareId } = body;
|
||||
const { name, domain, shareId, recordingEnabled, recordingConfig } = body;
|
||||
|
||||
if (!(await canUpdateWebsite(auth, websiteId))) {
|
||||
return unauthorized();
|
||||
}
|
||||
|
||||
try {
|
||||
const website = await updateWebsite(websiteId, { name, domain });
|
||||
const website = await updateWebsite(websiteId, {
|
||||
name,
|
||||
domain,
|
||||
...(recordingEnabled !== undefined && { recordingEnabled }),
|
||||
...(recordingConfig !== undefined && { recordingConfig }),
|
||||
});
|
||||
|
||||
if (shareId === null) {
|
||||
await deleteSharesByEntityId(website.id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue