perf(web): 优化PluginPanel提示

release/desktop
moonrailgun 5 years ago
parent 229a575ab5
commit 36264fa904

@ -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",

@ -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": "回复",

@ -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<GroupPluginPanelProps> = React.memo(
if (!panelInfo) {
return (
<Alert className="w-full text-center" message="无法获取面板信息" />
<Alert className="w-full text-center" message={t('无法获取面板信息')} />
);
}
if (typeof panelInfo.provider !== 'string') {
return (
<Alert className="w-full text-center" message="未找到插件的提供者" />
<Alert
className="w-full text-center"
message={t('未找到插件的提供者')}
/>
);
}
@ -42,7 +45,17 @@ export const GroupPluginPanel: React.FC<GroupPluginPanelProps> = React.memo(
return (
<Alert
className="w-full text-center"
message={`该面板由插件提供, 插件未安装: ${panelInfo.provider}`}
message={
<div>
<p>{t('该面板由插件提供')}</p>
<p>
{t('插件名')}: {panelInfo.provider}
</p>
<p>
{t('面板名')}: {panelInfo.pluginPanelName}
</p>
</div>
}
/>
);
}

Loading…
Cancel
Save