diff --git a/dashboard/layouts/dashboard.vue b/dashboard/layouts/dashboard.vue
index cc15f5c..1ceb293 100644
--- a/dashboard/layouts/dashboard.vue
+++ b/dashboard/layouts/dashboard.vue
@@ -107,9 +107,12 @@ const { isOpen, close, open } = useMenu();
-
+
+
+
+
+
-
diff --git a/dashboard/server/ai/functions/AI_Visits.ts b/dashboard/server/ai/functions/AI_Visits.ts
index 495c201..38a242d 100644
--- a/dashboard/server/ai/functions/AI_Visits.ts
+++ b/dashboard/server/ai/functions/AI_Visits.ts
@@ -14,7 +14,8 @@ const getVisitsCountsTool: AIPlugin_TTool<'getVisitsCount'> = {
from: { type: 'string', description: 'ISO string of start date' },
to: { type: 'string', description: 'ISO string of end date' },
website: { type: 'string', description: 'The website of the visits' },
- page: { type: 'string', description: 'The page of the visit' }
+ page: { type: 'string', description: 'The page of the visit' },
+ domain: { type: 'string', description: 'Used only to filter a specific domain' }
},
required: ['from', 'to']
}
@@ -33,6 +34,7 @@ const getVisitsTimelineTool: AIPlugin_TTool<'getVisitsTimeline'> = {
to: { type: 'string', description: 'ISO string of end date' },
website: { type: 'string', description: 'The website of the visits' },
page: { type: 'string', description: 'The page of the visit' },
+ domain: { type: 'string', description: 'Used only to filter a specific domain' }
},
required: ['from', 'to']
}
@@ -45,14 +47,15 @@ export class AiVisits extends AIPlugin<['getVisitsCount', 'getVisitsTimeline']>
super({
'getVisitsCount': {
- handler: async (data: { project_id: string, from: string, to: string, website?: string, page?: string }) => {
+ handler: async (data: { project_id: string, from: string, to: string, website?: string, page?: string, domain?: string }) => {
const query: any = {
project_id: data.project_id,
created_at: {
$gt: new Date(data.from),
$lt: new Date(data.to),
- }
+ },
+ website: data.domain || { $ne: '_NODOMAIN_' }
}
if (data.website) query.website = data.website;
@@ -67,7 +70,7 @@ export class AiVisits extends AIPlugin<['getVisitsCount', 'getVisitsTimeline']>
tool: getVisitsCountsTool
},
'getVisitsTimeline': {
- handler: async (data: { project_id: string, from: string, to: string, time_offset: number, website?: string, page?: string }) => {
+ handler: async (data: { project_id: string, from: string, to: string, time_offset: number, website?: string, page?: string, domain?: string }) => {
const timelineData = await executeTimelineAggregation({
projectId: new Types.ObjectId(data.project_id),
@@ -75,7 +78,8 @@ export class AiVisits extends AIPlugin<['getVisitsCount', 'getVisitsTimeline']>
from: data.from,
to: data.to,
slice: 'day',
- timeOffset: data.time_offset
+ timeOffset: data.time_offset,
+ domain: data.domain || { $ne: '_NODOMAIN_' } as any
});
return { data: timelineData };
},