mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-09 23:48:36 +01:00
update dashboard + server
This commit is contained in:
@@ -4,12 +4,12 @@ import { executeAdvancedTimelineAggregation, fillAndMergeTimelineAggregationV2 }
|
||||
|
||||
export default defineEventHandler(async event => {
|
||||
|
||||
const data = await getRequestDataOld(event, { requireSchema: false, requireSlice: true });
|
||||
const data = await getRequestData(event, ['SLICE', 'GUEST', 'DOMAIN', 'RANGE']);
|
||||
if (!data) return;
|
||||
|
||||
const { pid, from, to, slice, project_id, timeOffset } = data;
|
||||
const { pid, from, to, slice, project_id, timeOffset, domain } = data;
|
||||
|
||||
const cacheKey = `timeline:sessions_duration:${pid}:${slice}:${from}:${to}`;
|
||||
const cacheKey = `timeline:sessions_duration:${pid}:${slice}:${from}:${to}:${domain}`;
|
||||
const cacheExp = 60;
|
||||
|
||||
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
|
||||
@@ -17,6 +17,7 @@ export default defineEventHandler(async event => {
|
||||
projectId: project_id,
|
||||
model: SessionModel,
|
||||
from, to, slice,
|
||||
domain,
|
||||
customGroup: {
|
||||
duration: { $sum: '$duration' }
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user