diff --git a/dashboard/components/dashboard/CountCard.vue b/dashboard/components/dashboard/CountCard.vue
index 1f13a29..9dec9d6 100644
--- a/dashboard/components/dashboard/CountCard.vue
+++ b/dashboard/components/dashboard/CountCard.vue
@@ -5,24 +5,18 @@ const props = defineProps<{
value: string,
text: string,
avg?: string,
- trend?: number,
color: string,
data?: number[],
labels?: string[],
ready?: boolean,
slow?: boolean,
- todayIndex: number
+ todayIndex: number,
+ tooltipText: string
}>();
const { snapshotDuration } = useSnapshot()
-const uTooltipText = computed(() => {
- const duration = snapshotDuration.value;
- if (!duration) return '';
- if (duration > 25) return 'Monthly trend';
- if (duration > 7) return 'Weekly trend';
- return 'Daily trend';
-})
+const { showDrawer } = useDrawer();
@@ -42,25 +36,18 @@ const uTooltipText = computed(() => {
{{ text }}
-
-
-
-
-
- {{ trend.toFixed(0) }} %
-
-
+
+
+
+
-
-
+
diff --git a/dashboard/components/dashboard/TopCards.vue b/dashboard/components/dashboard/TopCards.vue
index c8b77ff..7a80eb6 100644
--- a/dashboard/components/dashboard/TopCards.vue
+++ b/dashboard/components/dashboard/TopCards.vue
@@ -13,24 +13,19 @@ const chartSlice = computed(() => {
});
+function findFirstZeroOrNullIndex(arr: (number | null)[]) {
+ for (let i = 0; i < arr.length; i++) {
+ if (arr.slice(i).every(val => val === 0 || val === null)) return i;
+ }
+ return -1;
+}
+
function transformResponse(input: { _id: string, count: number }[]) {
const data = input.map(e => e.count || 0);
+ const labels = input.map(e => DateService.getChartLabelFromISO(e._id, new Date().getTimezoneOffset(), chartSlice.value));
- const labels = input.map(e => DateService.getChartLabelFromISO(e._id, new Date().getTimezoneOffset(), chartSlice.value));
-
- const pool = [...input.map(e => e.count || 0)];
-
- const avg = pool.reduce((a, e) => a + e, 0) / pool.length;
-
- const targets = input.slice(Math.floor(input.length / 4 * 3));
- const targetAvg = targets.reduce((a, e) => a + e.count, 0) / targets.length;
-
- const diffPercent: number = (100 / avg * (targetAvg)) - 100;
-
- const trend = Math.max(Math.min(diffPercent, 99), -99);
-
- return { data, labels, trend, input }
+ return { data, labels, input }
}
@@ -91,7 +86,7 @@ const avgSessionDuration = computed(() => {
return `${hours > 0 ? hours + 'h ' : ''}${minutes}m ${seconds.toFixed()}s`
});
-const todayIndex = computed(()=>{
+const todayIndex = computed(() => {
if (!visitsData.data.value) return -1;
return visitsData.data.value.input.findIndex(e => new Date(e._id).getTime() > (Date.now() - new Date().getTimezoneOffset() * 1000 * 60));
})
@@ -103,29 +98,33 @@ const todayIndex = computed(()=>{
-
+
-
+
-
+ tooltipText="Count of distinct users visiting your website."
+ :avg="formatNumberK(avgSessionsDay) + '/day'" :data="sessionsData.data.value?.data"
+ :labels="sessionsData.data.value?.labels" color="#4abde8">
-
+
diff --git a/dashboard/pages/analyst.vue b/dashboard/pages/analyst.vue
index 71fa4f4..e6b3c79 100644
--- a/dashboard/pages/analyst.vue
+++ b/dashboard/pages/analyst.vue
@@ -201,10 +201,10 @@ function onKeyDown(e: KeyboardEvent) {
const menuOpen = ref(false);
const defaultPrompts = [
- "Create a line chart with this data: \n[100, 200, 30, 300, 500, 40]",
- "Create a chart with Events (bar) and Visits (line) data from last week.",
+ "What can you do and how can you help me ?",
+ "Show me an example line chart with random data",
"How many visits did I get last week?",
- "Create a line chart of last week's visits."
+ "Create a line chart of last week's visits"
]
async function deleteChat(chat_id: string) {
@@ -232,6 +232,15 @@ async function clearAllChats() {
headers: useComputedHeaders({ useSnapshotDates: false }).value
});
await reloadChatsList();
+
+ menuOpen.value = false;
+ typer.stop();
+ canSend.value = true;
+ currentChatMessages.value = [];
+ currentChatMessageDelta.value = '';
+ currentChatId.value = '';
+
+
}
diff --git a/dashboard/pages/index.vue b/dashboard/pages/index.vue
index ce5ce15..a1016f0 100644
--- a/dashboard/pages/index.vue
+++ b/dashboard/pages/index.vue
@@ -33,16 +33,12 @@ const showDashboard = computed(() => project.value && firstInteraction.data.valu
const selfhosted = useSelfhosted();
-const { showDrawer } = useDrawer();
-
- test
-
diff --git a/dashboard/pages/project_creation.vue b/dashboard/pages/project_creation.vue
index e87c5f3..3cb4ef3 100644
--- a/dashboard/pages/project_creation.vue
+++ b/dashboard/pages/project_creation.vue
@@ -1,6 +1,5 @@