From c3904ebd550d3911f005bdf73473555a43bae7db Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 16 Sep 2024 01:03:49 +0200 Subject: [PATCH] Add advanced ai --- .../components/analyst/ComposableChart.vue | 121 ++++++++++++++++++ dashboard/components/analyst/LineChart.vue | 110 ++++++++++++++++ dashboard/components/settings/billing.vue | 8 ++ dashboard/layouts/dashboard.vue | 2 +- dashboard/package.json | 2 +- dashboard/pages/analyst.vue | 34 +++-- dashboard/pnpm-lock.yaml | 73 ++++++----- dashboard/server/ai/Plugin.ts | 30 +++++ .../server/ai/functions/AI_ComposableChart.ts | 67 ++++++++++ dashboard/server/ai/functions/AI_Events.ts | 80 ++++++++++++ dashboard/server/ai/functions/AI_Visits.ts | 87 +++++++++++++ .../api/ai/[project_id]/[chat_id]/delete.ts | 3 - .../ai/[project_id]/[chat_id]/get_messages.ts | 22 ++-- .../api/ai/[project_id]/send_message.post.ts | 3 +- .../server/api/ai/functions/AI_Events.ts | 51 -------- .../server/api/ai/functions/AI_Visits.ts | 14 -- dashboard/server/init.ts | 5 - dashboard/server/services/AiService.ts | 105 ++++++--------- dashboard/server/services/StripeService.ts | 18 ++- 19 files changed, 641 insertions(+), 194 deletions(-) create mode 100644 dashboard/components/analyst/ComposableChart.vue create mode 100644 dashboard/components/analyst/LineChart.vue create mode 100644 dashboard/server/ai/Plugin.ts create mode 100644 dashboard/server/ai/functions/AI_ComposableChart.ts create mode 100644 dashboard/server/ai/functions/AI_Events.ts create mode 100644 dashboard/server/ai/functions/AI_Visits.ts delete mode 100644 dashboard/server/api/ai/functions/AI_Events.ts delete mode 100644 dashboard/server/api/ai/functions/AI_Visits.ts diff --git a/dashboard/components/analyst/ComposableChart.vue b/dashboard/components/analyst/ComposableChart.vue new file mode 100644 index 0000000..c9b4443 --- /dev/null +++ b/dashboard/components/analyst/ComposableChart.vue @@ -0,0 +1,121 @@ + + + + diff --git a/dashboard/components/analyst/LineChart.vue b/dashboard/components/analyst/LineChart.vue new file mode 100644 index 0000000..070ac00 --- /dev/null +++ b/dashboard/components/analyst/LineChart.vue @@ -0,0 +1,110 @@ + + + + diff --git a/dashboard/components/settings/billing.vue b/dashboard/components/settings/billing.vue index d3f72c8..0aba666 100644 --- a/dashboard/components/settings/billing.vue +++ b/dashboard/components/settings/billing.vue @@ -73,12 +73,17 @@ watch(activeProject, () => { const entries: SettingsTemplateEntry[] = [ + // { id: 'info', title: 'Billing informations', text: 'Manage billing informations for this project' }, { id: 'plan', title: 'Current plan', text: 'Manage current plat for this project' }, { id: 'usage', title: 'Usage', text: 'Show usage of current project' }, { id: 'invoices', title: 'Invoices', text: 'Manage invoices of current project' }, ] +const currentBillingInfo = ref({ + address: '' +}); + const { visible } = usePricingDrawer(); @@ -114,6 +119,9 @@ const { visible } = usePricingDrawer();
€ {{ getPremiumPrice(planData.premium_type) }}
per month
+
+ +
diff --git a/dashboard/layouts/dashboard.vue b/dashboard/layouts/dashboard.vue index f933c8c..9074038 100644 --- a/dashboard/layouts/dashboard.vue +++ b/dashboard/layouts/dashboard.vue @@ -31,7 +31,7 @@ const sections: Section[] = [ label: 'Slack support', icon: 'fab fa-slack', premiumOnly: true, action() { - if (isGuest) return; + if (isGuest.value === true) return; if (isPremium.value === true) { window.open('https://join.slack.com/t/litlyx/shared_invite/zt-2q3oawn29-hZlu_fBUBlc4052Ooe3FZg', '_blank'); } else { diff --git a/dashboard/package.json b/dashboard/package.json index 0e881a3..f17f88d 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -26,7 +26,7 @@ "nodemailer": "^6.9.13", "nuxt": "^3.11.2", "nuxt-vue3-google-signin": "^0.0.11", - "openai": "^4.47.1", + "openai": "^4.61.0", "pdfkit": "^0.15.0", "primevue": "^3.52.0", "redis": "^4.6.13", diff --git a/dashboard/pages/analyst.vue b/dashboard/pages/analyst.vue index fe432ce..d06829b 100644 --- a/dashboard/pages/analyst.vue +++ b/dashboard/pages/analyst.vue @@ -1,10 +1,15 @@