From 69a0f7b24c86ad74f1dc252ff9ec60cf20472b59 Mon Sep 17 00:00:00 2001 From: kurihada Date: Sun, 1 Mar 2026 16:52:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=95=8C=E9=9D=A2=E5=85=A8=E9=83=A8?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=B8=AD=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 侧边栏导航:仪表盘、登录、内容浏览、发布、互动、API 测试、设置 - 7 个页面所有按钮、标签、提示、错误信息改为中文 - API 端点列表分类改为中文(登录、内容、发布、互动) - 组件内文本:展开/收起、复制、点赞、收藏、评论等 - 页面标题改为 Social MCP - 管理后台 --- web/index.html | 2 +- web/src/components/feed/CommentTree.tsx | 2 +- web/src/components/feed/FeedCard.tsx | 8 +-- web/src/components/feed/FeedDetail.tsx | 18 +++---- web/src/components/feed/FeedGrid.tsx | 2 +- web/src/components/feed/UserCard.tsx | 10 ++-- web/src/components/layout/Header.tsx | 6 +-- web/src/components/ui/JsonViewer.tsx | 4 +- web/src/lib/constants.ts | 40 +++++++------- web/src/pages/ApiTesterPage.tsx | 52 +++++++++--------- web/src/pages/BrowserPage.tsx | 66 +++++++++++------------ web/src/pages/DashboardPage.tsx | 38 ++++++------- web/src/pages/InteractionsPage.tsx | 72 ++++++++++++------------- web/src/pages/LoginPage.tsx | 50 ++++++++--------- web/src/pages/PublishPage.tsx | 60 ++++++++++----------- web/src/pages/SettingsPage.tsx | 36 ++++++------- 16 files changed, 233 insertions(+), 233 deletions(-) diff --git a/web/index.html b/web/index.html index 06d2012..46d11b7 100644 --- a/web/index.html +++ b/web/index.html @@ -3,7 +3,7 @@ - Social MCP - Admin Dashboard + Social MCP - 管理后台 diff --git a/web/src/components/feed/CommentTree.tsx b/web/src/components/feed/CommentTree.tsx index 569f3db..84c6dca 100644 --- a/web/src/components/feed/CommentTree.tsx +++ b/web/src/components/feed/CommentTree.tsx @@ -25,7 +25,7 @@ export function CommentTree({ comments, depth = 0 }: Props) {

{comment.content}

{comment.likeCount > 0 && ( - {comment.likeCount} likes + {comment.likeCount} 赞 )} diff --git a/web/src/components/feed/FeedCard.tsx b/web/src/components/feed/FeedCard.tsx index bd2a3ad..1208f58 100644 --- a/web/src/components/feed/FeedCard.tsx +++ b/web/src/components/feed/FeedCard.tsx @@ -23,15 +23,15 @@ export function FeedCard({ feed, onClick }: Props) { /> ) : (
- No Cover + 无封面
)} {feed.type === 'video' && ( - Video + 视频 )}
-

{feed.title || feed.description || 'Untitled'}

+

{feed.title || feed.description || '无标题'}

{feed.user.avatar && ( @@ -39,7 +39,7 @@ export function FeedCard({ feed, onClick }: Props) { )} {feed.user.nickname}
- {formatNumber(feed.likeCount)} likes + {formatNumber(feed.likeCount)} 赞
diff --git a/web/src/components/feed/FeedDetail.tsx b/web/src/components/feed/FeedDetail.tsx index 8a952f9..7de3523 100644 --- a/web/src/components/feed/FeedDetail.tsx +++ b/web/src/components/feed/FeedDetail.tsx @@ -40,7 +40,7 @@ export function FeedDetail({ feedId, xsecToken, onClose, onUserClick }: Props) {
-

Feed Detail

+

笔记详情

@@ -85,7 +85,7 @@ export function FeedDetail({ feedId, xsecToken, onClose, onUserClick }: Props) { {/* Video */} {detail.videoUrl && (
- Video Note + 视频笔记

{detail.videoUrl}

)} @@ -108,10 +108,10 @@ export function FeedDetail({ feedId, xsecToken, onClose, onUserClick }: Props) { {/* Stats */}
{[ - { label: 'Likes', value: detail.likeCount }, - { label: 'Collects', value: detail.collectCount }, - { label: 'Comments', value: detail.commentCount }, - { label: 'Shares', value: detail.shareCount }, + { label: '点赞', value: detail.likeCount }, + { label: '收藏', value: detail.collectCount }, + { label: '评论', value: detail.commentCount }, + { label: '分享', value: detail.shareCount }, ].map((s) => (

{formatNumber(s.value)}

@@ -145,14 +145,14 @@ export function FeedDetail({ feedId, xsecToken, onClose, onUserClick }: Props) { variant="ghost" onClick={() => void navigator.clipboard.writeText(detail.id)} > - Copy Feed ID + 复制 Feed ID
@@ -161,7 +161,7 @@ export function FeedDetail({ feedId, xsecToken, onClose, onUserClick }: Props) { {detail.comments.length > 0 && (

- Comments ({detail.comments.length}) + 评论 ({detail.comments.length})

diff --git a/web/src/components/feed/FeedGrid.tsx b/web/src/components/feed/FeedGrid.tsx index 62f329c..fb23eee 100644 --- a/web/src/components/feed/FeedGrid.tsx +++ b/web/src/components/feed/FeedGrid.tsx @@ -9,7 +9,7 @@ interface Props { emptyText?: string; } -export function FeedGrid({ feeds, loading, onSelect, emptyText = 'No feeds found' }: Props) { +export function FeedGrid({ feeds, loading, onSelect, emptyText = '暂无内容' }: Props) { if (loading) { return (
diff --git a/web/src/components/feed/UserCard.tsx b/web/src/components/feed/UserCard.tsx index c2936b9..a087317 100644 --- a/web/src/components/feed/UserCard.tsx +++ b/web/src/components/feed/UserCard.tsx @@ -56,10 +56,10 @@ export function UserCard({ userId, xsecToken, onFeedSelect }: Props) { {/* Stats */}
{[ - { label: 'Follows', value: profile.follows }, - { label: 'Fans', value: profile.fans }, - { label: 'Interactions', value: profile.interaction }, - { label: 'Notes', value: profile.feedCount }, + { label: '关注', value: profile.follows }, + { label: '粉丝', value: profile.fans }, + { label: '获赞与收藏', value: profile.interaction }, + { label: '笔记', value: profile.feedCount }, ].map((s) => (

{formatNumber(s.value)}

@@ -72,7 +72,7 @@ export function UserCard({ userId, xsecToken, onFeedSelect }: Props) { {profile.feeds.length > 0 && (

- Recent Notes ({profile.feeds.length}) + 最近笔记 ({profile.feeds.length})

diff --git a/web/src/components/layout/Header.tsx b/web/src/components/layout/Header.tsx index 4a30ec1..19399dc 100644 --- a/web/src/components/layout/Header.tsx +++ b/web/src/components/layout/Header.tsx @@ -20,17 +20,17 @@ export function Header() { - Token 未配置 — 点击前往 Settings + Token 未配置 — 点击前往设置 )}
{health && ( - {health.healthy ? 'Healthy' : 'Unhealthy'} + {health.healthy ? '正常' : '异常'} )} - {!health && Connecting...} + {!health && 连接中...}
); diff --git a/web/src/components/ui/JsonViewer.tsx b/web/src/components/ui/JsonViewer.tsx index a56c345..c91a515 100644 --- a/web/src/components/ui/JsonViewer.tsx +++ b/web/src/components/ui/JsonViewer.tsx @@ -17,13 +17,13 @@ export function JsonViewer({ data, collapsed = false, maxHeight = '400px' }: Pro onClick={() => setIsCollapsed(!isCollapsed)} className="text-xs text-dark-muted hover:text-dark-text" > - {isCollapsed ? 'Expand' : 'Collapse'} + {isCollapsed ? '展开' : '收起'}
{!isCollapsed && ( diff --git a/web/src/lib/constants.ts b/web/src/lib/constants.ts index 9c3e250..34a7028 100644 --- a/web/src/lib/constants.ts +++ b/web/src/lib/constants.ts @@ -1,25 +1,25 @@ export const NAV_ITEMS = [ - { path: '/', label: 'Dashboard', icon: 'dashboard' }, - { path: '/login', label: 'Login', icon: 'login' }, - { path: '/browser', label: 'Browser', icon: 'browser' }, - { path: '/publish', label: 'Publish', icon: 'publish' }, - { path: '/interactions', label: 'Interactions', icon: 'interactions' }, - { path: '/api-tester', label: 'API Tester', icon: 'api' }, - { path: '/settings', label: 'Settings', icon: 'settings' }, + { path: '/', label: '仪表盘', icon: 'dashboard' }, + { path: '/login', label: '登录', icon: 'login' }, + { path: '/browser', label: '内容浏览', icon: 'browser' }, + { path: '/publish', label: '发布', icon: 'publish' }, + { path: '/interactions', label: '互动', icon: 'interactions' }, + { path: '/api-tester', label: 'API 测试', icon: 'api' }, + { path: '/settings', label: '设置', icon: 'settings' }, ] as const; export const API_ENDPOINTS = [ - { key: 'login_status', method: 'GET', path: '/api/xhs/login/status', label: 'Check Login Status', category: 'Login' }, - { key: 'login_qrcode', method: 'GET', path: '/api/xhs/login/qrcode', label: 'Get Login QR Code', category: 'Login' }, - { key: 'login_delete', method: 'DELETE', path: '/api/xhs/login/cookies', label: 'Delete Cookies (Logout)', category: 'Login' }, - { key: 'feeds', method: 'GET', path: '/api/xhs/feeds', label: 'List Feeds', category: 'Content' }, - { key: 'search', method: 'POST', path: '/api/xhs/search', label: 'Search', category: 'Content', body: { keyword: '', filters: { sort: 'general', type: 'all', time: 'all' } } }, - { key: 'feed_detail', method: 'POST', path: '/api/xhs/feeds/detail', label: 'Feed Detail', category: 'Content', body: { feed_id: '', xsec_token: '', load_all_comments: false } }, - { key: 'user_profile', method: 'POST', path: '/api/xhs/user/profile', label: 'User Profile', category: 'Content', body: { user_id: '', xsec_token: '' } }, - { key: 'publish_image', method: 'POST', path: '/api/xhs/publish/image', label: 'Publish Image Note', category: 'Publish', body: { title: '', content: '', images: [], tags: [], is_original: false, visibility: 'public' } }, - { key: 'publish_video', method: 'POST', path: '/api/xhs/publish/video', label: 'Publish Video Note', category: 'Publish', body: { title: '', content: '', video: '', tags: [], visibility: 'public' } }, - { key: 'comment', method: 'POST', path: '/api/xhs/comment', label: 'Post Comment', category: 'Interaction', body: { feed_id: '', xsec_token: '', content: '' } }, - { key: 'comment_reply', method: 'POST', path: '/api/xhs/comment/reply', label: 'Reply Comment', category: 'Interaction', body: { feed_id: '', xsec_token: '', content: '', comment_id: '', user_id: '' } }, - { key: 'like', method: 'POST', path: '/api/xhs/like', label: 'Like/Unlike', category: 'Interaction', body: { feed_id: '', xsec_token: '', unlike: false } }, - { key: 'favorite', method: 'POST', path: '/api/xhs/favorite', label: 'Favorite/Unfavorite', category: 'Interaction', body: { feed_id: '', xsec_token: '', unfavorite: false } }, + { key: 'login_status', method: 'GET', path: '/api/xhs/login/status', label: '检查登录状态', category: '登录' }, + { key: 'login_qrcode', method: 'GET', path: '/api/xhs/login/qrcode', label: '获取登录二维码', category: '登录' }, + { key: 'login_delete', method: 'DELETE', path: '/api/xhs/login/cookies', label: '删除 Cookie(登出)', category: '登录' }, + { key: 'feeds', method: 'GET', path: '/api/xhs/feeds', label: '获取推荐列表', category: '内容' }, + { key: 'search', method: 'POST', path: '/api/xhs/search', label: '搜索', category: '内容', body: { keyword: '', filters: { sort: 'general', type: 'all', time: 'all' } } }, + { key: 'feed_detail', method: 'POST', path: '/api/xhs/feeds/detail', label: '笔记详情', category: '内容', body: { feed_id: '', xsec_token: '', load_all_comments: false } }, + { key: 'user_profile', method: 'POST', path: '/api/xhs/user/profile', label: '用户主页', category: '内容', body: { user_id: '', xsec_token: '' } }, + { key: 'publish_image', method: 'POST', path: '/api/xhs/publish/image', label: '发布图文笔记', category: '发布', body: { title: '', content: '', images: [], tags: [], is_original: false, visibility: 'public' } }, + { key: 'publish_video', method: 'POST', path: '/api/xhs/publish/video', label: '发布视频笔记', category: '发布', body: { title: '', content: '', video: '', tags: [], visibility: 'public' } }, + { key: 'comment', method: 'POST', path: '/api/xhs/comment', label: '发表评论', category: '互动', body: { feed_id: '', xsec_token: '', content: '' } }, + { key: 'comment_reply', method: 'POST', path: '/api/xhs/comment/reply', label: '回复评论', category: '互动', body: { feed_id: '', xsec_token: '', content: '', comment_id: '', user_id: '' } }, + { key: 'like', method: 'POST', path: '/api/xhs/like', label: '点赞/取消', category: '互动', body: { feed_id: '', xsec_token: '', unlike: false } }, + { key: 'favorite', method: 'POST', path: '/api/xhs/favorite', label: '收藏/取消', category: '互动', body: { feed_id: '', xsec_token: '', unfavorite: false } }, ] as const; diff --git a/web/src/pages/ApiTesterPage.tsx b/web/src/pages/ApiTesterPage.tsx index d361736..849e765 100644 --- a/web/src/pages/ApiTesterPage.tsx +++ b/web/src/pages/ApiTesterPage.tsx @@ -52,12 +52,12 @@ export function ApiTesterPage() { return (
-

API Tester

+

API 测试

setMode(k as 'rest' | 'mcp')} @@ -87,11 +87,11 @@ export function ApiTesterPage() { {response !== null && (
-

Response

+

响应

{responseStatus && ( - {responseStatus} + {responseStatus === 'success' ? '成功' : '失败'} )} {duration !== null && ( @@ -108,11 +108,11 @@ export function ApiTesterPage() {
-

History

- +

历史记录

+
{history.length === 0 ? ( -

No requests yet

+

暂无请求

) : (
{history.map((entry) => ( @@ -136,7 +136,7 @@ export function ApiTesterPage() {
- {entry.status} + {entry.status === 'success' ? '成功' : '失败'} {entry.time} {entry.duration}ms @@ -227,10 +227,10 @@ function RestPanel({ return ( <> -

REST Request

+

REST 请求