-
AI Anomaly Detector
+
AI Anomaly Detector
diff --git a/dashboard/components/events/EventsStackedBarChart.vue b/dashboard/components/events/EventsStackedBarChart.vue
index a2d4acf..13212d7 100644
--- a/dashboard/components/events/EventsStackedBarChart.vue
+++ b/dashboard/components/events/EventsStackedBarChart.vue
@@ -8,15 +8,6 @@ const slice = computed(() => props.slice);
const { safeSnapshotDates } = useSnapshot()
-const body = computed(() => {
- return {
- from: safeSnapshotDates.value.from,
- to: safeSnapshotDates.value.to,
- slice: slice.value,
- }
-});
-
-
function transformResponse(input: { _id: string, name: string, count: number }[]) {
const fixed = fixMetrics({
@@ -90,9 +81,9 @@ function onResponse(e: any) {
}
const eventsStackedData = useFetch(`/api/timeline/events_stacked`, {
- method: 'POST', body, lazy: true, immediate: false,
+ lazy: true, immediate: false,
transform: transformResponse,
- headers: useComputedHeaders(),
+ headers: useComputedHeaders({slice}),
onResponseError,
onResponse
});
diff --git a/dashboard/components/settings/General.vue b/dashboard/components/settings/General.vue
index 9b6eca0..561c117 100644
--- a/dashboard/components/settings/General.vue
+++ b/dashboard/components/settings/General.vue
@@ -2,7 +2,7 @@
import type { TApiSettings } from '@schema/ApiSettingsSchema';
import type { SettingsTemplateEntry } from './Template.vue';
-const { project, actions, projectList } = useProject();
+const { project, actions, projectList, isGuest, projectId } = useProject();
const entries: SettingsTemplateEntry[] = [
{ id: 'pname', title: 'Name', text: 'Project name' },
@@ -107,7 +107,7 @@ async function deleteProject() {
const firstProjectId = projectList.value?.[0]?._id.toString();
if (firstProjectId) {
- await setActiveProject(firstProjectId);
+ await actions.setActiveProject(firstProjectId);
}
@@ -120,8 +120,6 @@ async function deleteProject() {
const { createAlert } = useAlert()
-const activeProjectId = useActiveProjectId()
-
function copyScript() {
if (!navigator.clipboard) alert('You can\'t copy in HTTP');
@@ -129,7 +127,7 @@ function copyScript() {
const createScriptText = () => {
return [
'
@@ -36,9 +22,9 @@ const eventsData = await useFetch(`/api/data/count`, { method: 'POST', headers,
- Total events: {{ eventsData.data.value?.[0]?.total || '0' }}
+ Total events: {{ eventsData.data.value?.[0]?.count || '0' }}
-
+
Waiting for your first event...
@@ -62,7 +48,7 @@ const eventsData = await useFetch(`/api/data/count`, { method: 'POST', headers,
-
+
@@ -71,7 +57,7 @@ const eventsData = await useFetch(`/api/data/count`, { method: 'POST', headers,
-
+
diff --git a/dashboard/pages/settings.vue b/dashboard/pages/settings.vue
index 3199208..54c4b2a 100644
--- a/dashboard/pages/settings.vue
+++ b/dashboard/pages/settings.vue
@@ -3,8 +3,6 @@
definePageMeta({ layout: 'dashboard' });
-const activeProject = useActiveProject();
-
const items = [
{ label: 'General', slot: 'general' },
{ label: 'Members', slot: 'members' },
@@ -20,16 +18,16 @@ const items = [
-
+
-
+
-
+
-
+
diff --git a/dashboard/server/api/data/browsers.ts b/dashboard/server/api/data/browsers.ts
index 0c4d34c..7b1a7c7 100644
--- a/dashboard/server/api/data/browsers.ts
+++ b/dashboard/server/api/data/browsers.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `browsers:${pid}:${from}:${to}`;
+ const cacheKey = `browsers:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/count.ts b/dashboard/server/api/data/count.ts
index a2ab9d5..419e031 100644
--- a/dashboard/server/api/data/count.ts
+++ b/dashboard/server/api/data/count.ts
@@ -5,7 +5,7 @@ import { getRequestData } from "~/server/utils/getRequestData";
export default defineEventHandler(async event => {
- const data = await getRequestData(event);
+ const data = await getRequestData(event, { requireSchema: true });
if (!data) return;
const { schemaName, pid, from, to, model, project_id } = data;
diff --git a/dashboard/server/api/data/countries.ts b/dashboard/server/api/data/countries.ts
index cfa59ff..9c7624c 100644
--- a/dashboard/server/api/data/countries.ts
+++ b/dashboard/server/api/data/countries.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `countries:${pid}:${from}:${to}`;
+ const cacheKey = `countries:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/devices.ts b/dashboard/server/api/data/devices.ts
index ba9f890..e1a89a4 100644
--- a/dashboard/server/api/data/devices.ts
+++ b/dashboard/server/api/data/devices.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `devices:${pid}:${from}:${to}`;
+ const cacheKey = `devices:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/events.ts b/dashboard/server/api/data/events.ts
index 07feda5..80dd639 100644
--- a/dashboard/server/api/data/events.ts
+++ b/dashboard/server/api/data/events.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `events:${pid}:${from}:${to}`;
+ const cacheKey = `events:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/oss.ts b/dashboard/server/api/data/oss.ts
index 6ec0ffa..4891c2f 100644
--- a/dashboard/server/api/data/oss.ts
+++ b/dashboard/server/api/data/oss.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `oss:${pid}:${from}:${to}`;
+ const cacheKey = `oss:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/referrers.ts b/dashboard/server/api/data/referrers.ts
index 3122f9a..6d2824c 100644
--- a/dashboard/server/api/data/referrers.ts
+++ b/dashboard/server/api/data/referrers.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `referrers:${pid}:${from}:${to}`;
+ const cacheKey = `referrers:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/websites.ts b/dashboard/server/api/data/websites.ts
index a20076b..4d3b90f 100644
--- a/dashboard/server/api/data/websites.ts
+++ b/dashboard/server/api/data/websites.ts
@@ -10,7 +10,7 @@ export default defineEventHandler(async event => {
const { pid, from, to, project_id, limit } = data;
- const cacheKey = `websites:${pid}:${from}:${to}`;
+ const cacheKey = `websites:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/data/websites_pages.ts b/dashboard/server/api/data/websites_pages.ts
index 0576f05..96aacba 100644
--- a/dashboard/server/api/data/websites_pages.ts
+++ b/dashboard/server/api/data/websites_pages.ts
@@ -12,7 +12,7 @@ export default defineEventHandler(async event => {
const websiteName = getHeader(event, 'x-website-name');
- const cacheKey = `websites_pages:${websiteName}:${pid}:${from}:${to}`;
+ const cacheKey = `websites_pages:${websiteName}:${pid}:${limit}:${from}:${to}`;
const cacheExp = 60;
return await Redis.useCacheV2(cacheKey, cacheExp, async () => {
diff --git a/dashboard/server/api/timeline/events_stacked.post.ts b/dashboard/server/api/timeline/events_stacked.ts
similarity index 100%
rename from dashboard/server/api/timeline/events_stacked.post.ts
rename to dashboard/server/api/timeline/events_stacked.ts
diff --git a/dashboard/tailwind.config.js b/dashboard/tailwind.config.js
index 44361a5..d53ce0b 100644
--- a/dashboard/tailwind.config.js
+++ b/dashboard/tailwind.config.js
@@ -40,7 +40,7 @@ module.exports = {
darker: '#6A6A6A'
},
"lyx-widget": {
- DEFAULT: '#151515',
+ DEFAULT: '#0E0E0E',
light: '#1E1E1E',
lighter: '#262626'
},