@@ -35,7 +37,7 @@ export const Dashboard: React.FC = React.memo(() => {
@@ -43,7 +45,7 @@ export const Dashboard: React.FC = React.memo(() => {
@@ -51,7 +53,7 @@ export const Dashboard: React.FC = React.memo(() => {
@@ -59,7 +61,7 @@ export const Dashboard: React.FC = React.memo(() => {
@@ -67,7 +69,7 @@ export const Dashboard: React.FC = React.memo(() => {
diff --git a/server/admin/app/ra/i18n/custom.ts b/server/admin/app/ra/i18n/custom.ts
index 0c42f4a4..61ee9f04 100644
--- a/server/admin/app/ra/i18n/custom.ts
+++ b/server/admin/app/ra/i18n/custom.ts
@@ -5,6 +5,24 @@ export const englishCustom = {
panel: 'Panel',
name: 'Name',
permission: 'Permission',
+ confirmTitle: 'Are you sure you want to perform this operation?',
+ confirmContent: 'This action cannot be undone',
+ },
+ menu: {
+ network: 'Tailchat Network',
+ socket: 'Socket.IO TCP',
+ },
+ dashboard: {
+ welcomeTitle: 'Welcome to Tailchat Admin',
+ welcomeDesc:
+ 'Tailchat is a completely open source instant messaging application',
+ welcomeHomepage: 'Visit the official website',
+ welcomeSourcecode: 'Browse the source code',
+ userCount: 'User Count',
+ tempUserCount: 'Temp User Count',
+ messageCount: 'Message Count',
+ groupCount: 'Group Count',
+ fileCount: 'File Count',
},
users: {
search: 'Search nickname or email',
@@ -27,6 +45,22 @@ export const englishCustom = {
groupPanel: 'Panel Group',
pluginPanel: 'Plugin Panel',
},
+ network: {
+ nodeList: 'Node List',
+ id: 'ID',
+ hostname: 'Host Name',
+ cpuUsage: 'CPU Usage',
+ ipList: 'IP List',
+ sdkVersion: 'SDK Version',
+ serviceList: 'Service List',
+ actionList: 'Action List',
+ eventList: 'Event List',
+ },
+ socketio: {
+ tip1: 'The server URL is:',
+ tip2: 'The account password is the account password of Tailchat Admin',
+ btn: 'Open the Admin platform',
+ },
},
};
@@ -37,6 +71,23 @@ export const chineseCustom = {
panel: '面板',
name: '名称',
permission: '权限',
+ confirmTitle: '确认要进行该操作么?',
+ confirmContent: '该操作不可撤回',
+ },
+ menu: {
+ network: 'Tailchat 网络',
+ socket: 'Socket.IO 长链接',
+ },
+ dashboard: {
+ welcomeTitle: '欢迎使用 Tailchat 后台管理程序',
+ welcomeDesc: 'Tailchat 是一个完全开源的即时通讯应用',
+ welcomeHomepage: '访问官网',
+ welcomeSourcecode: '浏览源码',
+ userCount: '用户数',
+ tempUserCount: '临时用户数',
+ messageCount: '总消息数',
+ groupCount: '总群组数',
+ fileCount: '总文件数',
},
users: {
search: '搜索昵称或邮箱',
@@ -58,5 +109,21 @@ export const chineseCustom = {
groupPanel: '面板分组',
pluginPanel: '插件面板',
},
+ network: {
+ nodeList: '节点列表',
+ id: 'ID',
+ hostname: '主机名',
+ cpuUsage: 'CPU占用',
+ ipList: 'IP地址列表',
+ sdkVersion: 'SDK版本',
+ serviceList: '服务列表',
+ actionList: '操作列表',
+ eventList: '事件列表',
+ },
+ socketio: {
+ tip1: '服务器URL为:',
+ tip2: '账号密码为Tailchat后台的账号密码',
+ btn: '打开管理平台',
+ },
},
};
diff --git a/server/admin/app/ra/layout/Menu.tsx b/server/admin/app/ra/layout/Menu.tsx
index 08f39202..e6753472 100644
--- a/server/admin/app/ra/layout/Menu.tsx
+++ b/server/admin/app/ra/layout/Menu.tsx
@@ -4,12 +4,14 @@ import {
MenuProps,
ResourceMenuItem,
useResourceDefinitions,
+ useTranslate,
} from 'react-admin';
import FilterDramaIcon from '@mui/icons-material/FilterDrama';
import LinkIcon from '@mui/icons-material/Link';
export const TailchatMenu: React.FC
= React.memo((props) => {
const resources = useResourceDefinitions();
+ const translate = useTranslate();
return (
diff --git a/server/admin/app/ra/routes/network/index.tsx b/server/admin/app/ra/routes/network/index.tsx
index fa98b1ef..e7090c46 100644
--- a/server/admin/app/ra/routes/network/index.tsx
+++ b/server/admin/app/ra/routes/network/index.tsx
@@ -13,11 +13,13 @@ import {
} from '@mui/material';
import _uniq from 'lodash/uniq';
import { ChipItems } from '../../components/ChipItems';
+import { useTranslate } from 'react-admin';
/**
* Tailchat 网络状态
*/
export const TailchatNetwork: React.FC = React.memo(() => {
+ const translate = useTranslate();
const { data, loading } = useRequest(async () => {
const { data } = await request('/network/all');
@@ -37,16 +39,16 @@ export const TailchatNetwork: React.FC = React.memo(() => {
}}
>
- 节点列表
+ {translate('custom.network.nodeList')}
- ID
- 主机名
- CPU占用
- IP地址列表
- SDK版本
+ {translate('custom.network.id')}
+ {translate('custom.network.hostname')}
+ {translate('custom.network.cpuUsage')}
+ {translate('custom.network.ipList')}
+ {translate('custom.network.sdkVersion')}
@@ -71,21 +73,21 @@ export const TailchatNetwork: React.FC = React.memo(() => {
- 服务列表
+ {translate('custom.network.serviceList')}
(data.services ?? [])} />
- 操作列表
+ {translate('custom.network.actionList')}
(data.actions ?? [])} />
- 事件列表
+ {translate('custom.network.eventList')}
(data.events ?? [])} />
diff --git a/server/admin/app/ra/routes/socketio.tsx b/server/admin/app/ra/routes/socketio.tsx
index 77a1f266..202950bd 100644
--- a/server/admin/app/ra/routes/socketio.tsx
+++ b/server/admin/app/ra/routes/socketio.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import { useTranslate } from 'react-admin';
import { Typography, CardActions, Button, Box } from '@mui/material';
import { Card, CardContent } from '@mui/material';
@@ -6,6 +7,7 @@ import { Card, CardContent } from '@mui/material';
* SocketIO 管理
*/
export const SocketIOAdmin: React.FC = React.memo(() => {
+ const translate = useTranslate();
const protocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
return (
@@ -13,13 +15,13 @@ export const SocketIOAdmin: React.FC = React.memo(() => {
- 服务器URL为:{' '}
+ {translate('custom.socketio.tip1')}{' '}
{protocol}://{window.location.host}
- 账号密码为Tailchat后台的账号密码
+ {translate('custom.socketio.tip2')}
@@ -29,7 +31,7 @@ export const SocketIOAdmin: React.FC = React.memo(() => {
window.open('https://admin.socket.io/');
}}
>
- 打开管理平台
+ {translate('custom.socketio.btn')}