From f52be85176324b4a2528d875f69457602f146281 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 1 Jun 2024 16:35:36 +0200 Subject: [PATCH] add pricing plans --- dashboard/components/pricing/PricingCard.vue | 90 +++++++++++-------- .../components/pricing/PricingCard_old.vue | 58 ++++++++++++ .../components/pricing/PricingDrawer.vue | 89 ++++++++++++++++++ dashboard/layouts/dashboard.vue | 2 +- dashboard/pages/analyst.vue | 5 +- dashboard/pages/plans.vue | 38 +++++++- .../api/ai/[project_id]/chats_remaining.ts | 2 - 7 files changed, 239 insertions(+), 45 deletions(-) create mode 100644 dashboard/components/pricing/PricingCard_old.vue create mode 100644 dashboard/components/pricing/PricingDrawer.vue diff --git a/dashboard/components/pricing/PricingCard.vue b/dashboard/components/pricing/PricingCard.vue index 99fec1b..76dc437 100644 --- a/dashboard/components/pricing/PricingCard.vue +++ b/dashboard/components/pricing/PricingCard.vue @@ -1,58 +1,70 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/dashboard/components/pricing/PricingCard_old.vue b/dashboard/components/pricing/PricingCard_old.vue new file mode 100644 index 0000000..99fec1b --- /dev/null +++ b/dashboard/components/pricing/PricingCard_old.vue @@ -0,0 +1,58 @@ + + + + \ No newline at end of file diff --git a/dashboard/components/pricing/PricingDrawer.vue b/dashboard/components/pricing/PricingDrawer.vue new file mode 100644 index 0000000..4599154 --- /dev/null +++ b/dashboard/components/pricing/PricingDrawer.vue @@ -0,0 +1,89 @@ + + + \ No newline at end of file diff --git a/dashboard/layouts/dashboard.vue b/dashboard/layouts/dashboard.vue index ba67efd..0fabedb 100644 --- a/dashboard/layouts/dashboard.vue +++ b/dashboard/layouts/dashboard.vue @@ -35,7 +35,7 @@ const sections: Section[] = [ action() { Lit.event('docs_clicked') }, }, { - label: 'Github', to: 'https://github.com/botkalista/litlyx-javascript-lib', icon: 'fab fa-github', external: true, + label: 'Github', to: 'https://github.com/litlyx/litlyx', icon: 'fab fa-github', external: true, action() { Lit.event('git_clicked') }, }, { label: 'Plans', to: '/plans', icon: 'far fa-wallet' }, diff --git a/dashboard/pages/analyst.vue b/dashboard/pages/analyst.vue index 14a4d2a..709753f 100644 --- a/dashboard/pages/analyst.vue +++ b/dashboard/pages/analyst.vue @@ -46,7 +46,10 @@ async function sendMessage() { } catch (ex: any) { if (ex.message.includes('CHAT_LIMIT_REACHED')) { - currentChatMessages.value.push({ role: 'assistant', content: 'You have reached your free tier chat limit.\n Upgrade to an higher tier.' }); + currentChatMessages.value.push({ + role: 'assistant', + content: 'You have reached your current tier chat limit.\n Upgrade to an higher tier. Upgrade now. ', + }); } } diff --git a/dashboard/pages/plans.vue b/dashboard/pages/plans.vue index e3ba8bc..f922845 100644 --- a/dashboard/pages/plans.vue +++ b/dashboard/pages/plans.vue @@ -36,15 +36,28 @@ const prettyExpireDate = computed(() => { return dayjs(planData.value.billing_expire_at).format('DD/MM/YYYY'); }); + const router = useRouter(); +const showPricingDrawer = ref(false); function onPlanUpgradeClick() { - router.push('/book_demo'); + showPricingDrawer.value = true; } + + + diff --git a/dashboard/server/api/ai/[project_id]/chats_remaining.ts b/dashboard/server/api/ai/[project_id]/chats_remaining.ts index a00c9b8..596e8dd 100644 --- a/dashboard/server/api/ai/[project_id]/chats_remaining.ts +++ b/dashboard/server/api/ai/[project_id]/chats_remaining.ts @@ -1,6 +1,4 @@ import { getUserProjectFromId } from "~/server/LIVE_DEMO_DATA"; -import { ProjectCountModel } from "@schema/ProjectsCounts"; - import { checkProjectCount } from '@functions/UtilsProjectCounts'; export async function getAiChatRemainings(project_id: string) {