From 36264fa90429825a411b89927c0f93e9fb24af79 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sat, 19 Feb 2022 23:35:25 +0800 Subject: [PATCH] =?UTF-8?q?perf(web):=20=E4=BC=98=E5=8C=96PluginPanel?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/i18n/langs/en-US/translation.json | 4 ++++ shared/i18n/langs/zh-CN/translation.json | 4 ++++ .../components/Panel/group/PluginPanel.tsx | 21 +++++++++++++++---- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/shared/i18n/langs/en-US/translation.json b/shared/i18n/langs/en-US/translation.json index f2fedd98..7bf24d63 100644 --- a/shared/i18n/langs/en-US/translation.json +++ b/shared/i18n/langs/en-US/translation.json @@ -5,6 +5,7 @@ "k1596c75c": "Only allow specified users to speak", "k162e37f1": "Plugin is successfully uninstalled, and it needs to be restarted to take effect", "k1704ea49": "Install", + "k17777797": "The panel is provided by the plugin", "k18580d81": "Create a link and send it to external friends", "k1885734a": "Effective after refreshing the page", "k18c716ce": "Password cannot be less than 6 digits", @@ -141,6 +142,7 @@ "kbef5b92e": "Copy Link", "kc14b2ea3": "Back", "kc1afdd08": "Don't worry, you can make changes anytime after this", + "kc2d30ab7": "Plugin Name", "kc60cf4b4": "Top", "kc625cd59": "Summary", "kc654b275": "Email", @@ -163,6 +165,7 @@ "kd983a61a": "{{nickname}} recall a message", "kda0e155e": "Create multiplayer converse", "kda67b115": "Unknown panel type", + "kdae72bb7": "Unable to get panel info", "kdb57357d": "Connection failed", "kdc18deca": "Invite users", "kdc4b4f92": "Public", @@ -190,6 +193,7 @@ "kf7d6acd4": "Create Guest", "kf7d829eb": "Wait to process", "kf87f3059": "Plugin Store", + "kf8de33b7": "Plugin provider not found", "kf98fbe5e": "Forbid everyone to speak", "kfa01c850": "No private message found", "kfa493f3f": "Reply", diff --git a/shared/i18n/langs/zh-CN/translation.json b/shared/i18n/langs/zh-CN/translation.json index e71b08f2..d05a222d 100644 --- a/shared/i18n/langs/zh-CN/translation.json +++ b/shared/i18n/langs/zh-CN/translation.json @@ -5,6 +5,7 @@ "k1596c75c": "仅允许指定用户发言", "k162e37f1": "插件卸载成功, 需要重启后生效", "k1704ea49": "安装", + "k17777797": "该面板由插件提供", "k18580d81": "创建链接并发送给外部好友", "k1885734a": "刷新页面后生效", "k18c716ce": "密码不能低于6位", @@ -141,6 +142,7 @@ "kbef5b92e": "复制链接", "kc14b2ea3": "返回", "kc1afdd08": "不要担心, 在此之后你可以随时进行变更", + "kc2d30ab7": "插件名", "kc60cf4b4": "到顶了", "kc625cd59": "概述", "kc654b275": "邮箱", @@ -163,6 +165,7 @@ "kd983a61a": "{{nickname}} 撤回了一条消息", "kda0e155e": "创建多人会话", "kda67b115": "未知的面板类型", + "kdae72bb7": "无法获取面板信息", "kdb57357d": "连接失败", "kdc18deca": "邀请用户", "kdc4b4f92": "公共", @@ -190,6 +193,7 @@ "kf7d6acd4": "创建访客", "kf7d829eb": "待处理", "kf87f3059": "插件中心", + "kf8de33b7": "未找到插件的提供者", "kf98fbe5e": "禁止所有人发言", "kfa01c850": "找不到私信会话", "kfa493f3f": "回复", diff --git a/web/src/components/Panel/group/PluginPanel.tsx b/web/src/components/Panel/group/PluginPanel.tsx index e35c85b3..38b9374a 100644 --- a/web/src/components/Panel/group/PluginPanel.tsx +++ b/web/src/components/Panel/group/PluginPanel.tsx @@ -1,7 +1,7 @@ import { findPluginPanelInfoByName } from '@/utils/plugin-helper'; import { Alert } from 'antd'; import React, { useMemo } from 'react'; -import { isValidStr, useGroupPanel } from 'tailchat-shared'; +import { isValidStr, t, useGroupPanel } from 'tailchat-shared'; import { GroupPanelWrapper } from './Wrapper'; interface GroupPluginPanelProps { @@ -18,13 +18,16 @@ export const GroupPluginPanel: React.FC = React.memo( if (!panelInfo) { return ( - + ); } if (typeof panelInfo.provider !== 'string') { return ( - + ); } @@ -42,7 +45,17 @@ export const GroupPluginPanel: React.FC = React.memo( return ( +

{t('该面板由插件提供')}

+

+ {t('插件名')}: {panelInfo.provider} +

+

+ {t('面板名')}: {panelInfo.pluginPanelName} +

+ + } /> ); }