Files
social-mcp/web/src/pages/SettingsPage.tsx
T
kurihada 69a0f7b24c feat: 界面全部改为中文
- 侧边栏导航:仪表盘、登录、内容浏览、发布、互动、API 测试、设置
- 7 个页面所有按钮、标签、提示、错误信息改为中文
- API 端点列表分类改为中文(登录、内容、发布、互动)
- 组件内文本:展开/收起、复制、点赞、收藏、评论等
- 页面标题改为 Social MCP - 管理后台
2026-03-01 16:52:57 +08:00

84 lines
2.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { Card } from '@/components/ui/Card';
import { Input } from '@/components/ui/Input';
import { Button } from '@/components/ui/Button';
import { useAuth } from '@/context/AuthContext';
import { useToast } from '@/context/ToastContext';
export function SettingsPage() {
const { token, serverUrl, setToken, setServerUrl } = useAuth();
const { toast } = useToast();
return (
<div className="max-w-2xl space-y-6">
<h1 className="text-2xl font-bold"></h1>
{/* Server Connection */}
<Card>
<h2 className="text-sm font-semibold text-dark-muted uppercase tracking-wider mb-4"></h2>
<div className="space-y-4">
<Input
label="服务器地址"
value={serverUrl}
onChange={(e) => setServerUrl(e.target.value)}
placeholder="留空则使用同源地址(默认)"
/>
<p className="text-xs text-dark-muted">
Dashboard Express {' '}
<code className="text-dark-accent">http://192.168.1.100:3000</code> 用于远程服务器。
</p>
</div>
</Card>
{/* Authentication */}
<Card>
<h2 className="text-sm font-semibold text-dark-muted uppercase tracking-wider mb-4"></h2>
<div className="space-y-4">
<Input
label="Bearer Token"
type="password"
value={token}
onChange={(e) => setToken(e.target.value)}
placeholder="输入 API Token"
/>
<p className="text-xs text-dark-muted">
Token <code className="text-dark-accent">BEARER_TOKEN</code> {' '}
<code className="text-dark-accent">.social-mcp/bearer-token</code>
</p>
<div className="flex gap-2">
<Button
variant="secondary"
size="sm"
onClick={() => {
toast('success', '设置已保存');
}}
>
</Button>
<Button
variant="ghost"
size="sm"
onClick={() => {
setToken('');
setServerUrl('');
toast('info', '设置已清除');
}}
>
</Button>
</div>
</div>
</Card>
{/* About */}
<Card>
<h2 className="text-sm font-semibold text-dark-muted uppercase tracking-wider mb-4"></h2>
<div className="space-y-2 text-sm text-dark-muted">
<p><span className="text-dark-text">Social MCP</span> </p>
<p>0.1.0</p>
<p>React 19 + TypeScript + Tailwind CSS</p>
</div>
</Card>
</div>
);
}