From d5c31f8728d00f314832caa7f87c55d379ba1cda Mon Sep 17 00:00:00 2001 From: NFish Date: Wed, 8 Jan 2025 17:58:51 +0800 Subject: [PATCH] fix: update billing i18n in setting modal --- web/app/components/billing/config.ts | 7 +++++-- web/app/components/billing/plan/index.tsx | 10 +++++----- web/app/components/billing/type.ts | 3 ++- web/app/components/billing/usage-info/apps-info.tsx | 2 +- .../billing/usage-info/vector-space-info.tsx | 4 ++-- web/i18n/en-US/billing.ts | 9 +++++++++ web/i18n/ja-JP/billing.ts | 8 ++++++++ web/i18n/zh-Hans/billing.ts | 8 ++++++++ 8 files changed, 40 insertions(+), 11 deletions(-) diff --git a/web/app/components/billing/config.ts b/web/app/components/billing/config.ts index 53eb72c560..9affe76bee 100644 --- a/web/app/components/billing/config.ts +++ b/web/app/components/billing/config.ts @@ -20,6 +20,7 @@ export const ALL_PLANS: Record = { buildApps: 5, documents: 50, vectorSpace: '50MB', + documentsUploadQuota: 0, documentsRequestQuota: 10, documentProcessingPriority: Priority.standard, messageRequest: 200, @@ -35,6 +36,7 @@ export const ALL_PLANS: Record = { buildApps: 50, documents: 500, vectorSpace: '5GB', + documentsUploadQuota: 0, documentsRequestQuota: 10, documentProcessingPriority: Priority.priority, messageRequest: 5000, @@ -50,6 +52,7 @@ export const ALL_PLANS: Record = { buildApps: 200, documents: 1000, vectorSpace: '20GB', + documentsUploadQuota: 0, documentsRequestQuota: 2000, documentProcessingPriority: Priority.topPriority, messageRequest: 10000, @@ -66,7 +69,7 @@ export const defaultPlan = { buildApps: 1, teamMembers: 1, annotatedResponse: 1, - documentsRequestQuota: 1, + documentsUploadQuota: 0, }, total: { documents: 50, @@ -74,6 +77,6 @@ export const defaultPlan = { buildApps: 10, teamMembers: 1, annotatedResponse: 10, - documentsRequestQuota: 50, + documentsUploadQuota: 0, }, } diff --git a/web/app/components/billing/plan/index.tsx b/web/app/components/billing/plan/index.tsx index baf4110127..63493eefa7 100644 --- a/web/app/components/billing/plan/index.tsx +++ b/web/app/components/billing/plan/index.tsx @@ -2,7 +2,7 @@ import type { FC } from 'react' import React from 'react' import { useTranslation } from 'react-i18next' -import { Plan } from '../type' +import { Plan, SelfHostedPlan } from '../type' import VectorSpaceInfo from '../usage-info/vector-space-info' import AppsInfo from '../usage-info/apps-info' import UpgradeBtn from '../upgrade-btn' @@ -26,7 +26,7 @@ const typeStyle = { textClassNames: 'text-[#3538CD]', bg: 'linear-gradient(113deg, rgba(255, 255, 255, 0.51) 3.51%, rgba(255, 255, 255, 0.00) 111.71%), #E0EAFF', }, - [Plan.enterprise]: { + [SelfHostedPlan.enterprise]: { textClassNames: 'text-[#DC6803]', bg: 'linear-gradient(113deg, rgba(255, 255, 255, 0.51) 3.51%, rgba(255, 255, 255, 0.00) 111.71%), #FFEED3', }, @@ -89,7 +89,7 @@ const PlanComp: FC = ({ @@ -98,14 +98,14 @@ const PlanComp: FC = ({ diff --git a/web/app/components/billing/type.ts b/web/app/components/billing/type.ts index 29dd4985f7..c5f4e9da66 100644 --- a/web/app/components/billing/type.ts +++ b/web/app/components/billing/type.ts @@ -17,6 +17,7 @@ export type PlanInfo = { buildApps: number documents: number vectorSpace: string + documentsUploadQuota: number documentsRequestQuota: number documentProcessingPriority: Priority logHistory: number @@ -46,7 +47,7 @@ export type SelfHostedPlanInfo = { annotatedResponse: number } -export type UsagePlanInfo = Pick +export type UsagePlanInfo = Pick & { vectorSpace: number } export enum DocumentProcessingPriority { standard = 'standard', diff --git a/web/app/components/billing/usage-info/apps-info.tsx b/web/app/components/billing/usage-info/apps-info.tsx index d0d7f54a09..5261d2cec4 100644 --- a/web/app/components/billing/usage-info/apps-info.tsx +++ b/web/app/components/billing/usage-info/apps-info.tsx @@ -23,7 +23,7 @@ const AppsInfo: FC = ({ diff --git a/web/app/components/billing/usage-info/vector-space-info.tsx b/web/app/components/billing/usage-info/vector-space-info.tsx index bb14800cae..bb434c27a2 100644 --- a/web/app/components/billing/usage-info/vector-space-info.tsx +++ b/web/app/components/billing/usage-info/vector-space-info.tsx @@ -23,8 +23,8 @@ const VectorSpaceInfo: FC = ({