From b3e0a5c078a410b6be212b801b94f38bbdbb03e4 Mon Sep 17 00:00:00 2001 From: NFish Date: Thu, 7 Nov 2024 14:09:29 +0800 Subject: [PATCH] fix: update i18n & show warning tip on Login page when License is Inactive --- web/app/signin/normalForm.tsx | 14 ++++++++++++++ web/i18n/en-US/login.ts | 4 +++- web/i18n/zh-Hans/login.ts | 4 +++- web/types/feature.ts | 1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/web/app/signin/normalForm.tsx b/web/app/signin/normalForm.tsx index 032c10a301..b6a8b24584 100644 --- a/web/app/signin/normalForm.tsx +++ b/web/app/signin/normalForm.tsx @@ -97,6 +97,20 @@ const NormalForm = () => { } + if (systemFeatures.license_status === LicenseStatus.NONE) { + return
+
+
+
+ + +
+

{t('login.licenseInactive')}

+

{t('login.licenseInactiveTip')}

+
+
+
+ } return ( <> diff --git a/web/i18n/en-US/login.ts b/web/i18n/en-US/login.ts index b14bd1e2a0..3c7c6e3433 100644 --- a/web/i18n/en-US/login.ts +++ b/web/i18n/en-US/login.ts @@ -99,7 +99,9 @@ const translation = { noLoginMethod: 'Authentication method not configured', noLoginMethodTip: 'Please contact the system admin to add an authentication method.', licenseExpired: 'License Expired', - licenseExpiredTip: 'Your organization\'s Dify Enterprise license has expired.Please contact your administrator to continue using Dify.', + licenseExpiredTip: 'The Dify Enterprise license for your workspace has expired. Please contact your administrator to continue using Dify.', + licenseInactive: 'License Inactive', + licenseInactiveTip: 'Your organization\'s Dify Enterprise license Inactive.Please contact your administrator to continue using Dify.', } export default translation diff --git a/web/i18n/zh-Hans/login.ts b/web/i18n/zh-Hans/login.ts index 02959a2987..7113e714f3 100644 --- a/web/i18n/zh-Hans/login.ts +++ b/web/i18n/zh-Hans/login.ts @@ -100,7 +100,9 @@ const translation = { noLoginMethod: '未配置身份认证方式', noLoginMethodTip: '请联系系统管理员添加身份认证方式', licenseExpired: '许可证已过期', - licenseExpiredTip: '您的组织的 Dify 企业许可证已过期。请联系您的管理员续订继续使用 Dify。', + licenseExpiredTip: '您所在空间的 Dify Enterprise 许可证已过期,请联系管理员以继续使用 Dify。', + licenseInactive: '许可证未激活', + licenseInactiveTip: '您的组织的 Dify 企业许可证未激活。请联系您的管理员激活后继续使用 Dify。', } export default translation diff --git a/web/types/feature.ts b/web/types/feature.ts index aaba147540..fe1cf22a9d 100644 --- a/web/types/feature.ts +++ b/web/types/feature.ts @@ -7,6 +7,7 @@ export enum SSOProtocol { export enum LicenseStatus { NONE = 'none', ACTIVE = 'active', + INACTIVE = 'inactive', EXPIRED = 'expired', }