fix: 优化分站 API Key 页面显示细节

- 移除空状态冗余创建按钮,改为提示点击上方卡片
- 移除 My API Keys 标题栏多余的新建按钮
- ConfigExporter 无 key 时提示改为"请先创建 API Key"
- 修复 KeyGroupCard 推荐/折扣标签颜色适配所有主题

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
abingyydsandClaude Opus 4.6 committed 2026-03-31 23:51:38 +09:00
1 parent 3aeff2ede6
commit 179ee855be
34 files changed
+62 -63

No files matched your search

+2 -2
View File
@@ -247,8 +247,8 @@ print(message.content[0].text)`;
<svg className="w-8 h-8 mx-auto mb-3 text-page-muted" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
</svg>
<p className="text-sm text-page-secondary mb-1">{t('config.loginPrompt')}</p>
<p className="text-xs text-page-muted">{t('config.loginDesc')}</p>
<p className="text-sm text-page-secondary mb-1">{t('config.noKeyPrompt')}</p>
<p className="text-xs text-page-muted">{t('config.noKeyDesc')}</p>
</div>
);
}
+3
View File
@@ -112,6 +112,7 @@
"tokens.deleteConfirm": "Delete \"{{name}}\"? This cannot be undone.",
"tokens.delete": "Delete",
"tokens.noKeys": "No API keys yet",
"tokens.noKeysHint": "Click a card above to create one",
"tokens.createFirst": "Create Your First Key",
"tokens.enabled": "Enabled",
"tokens.disabled": "Disabled",
@@ -145,6 +146,8 @@
"config.loading": "Loading...",
"config.loginPrompt": "Log in to generate your config",
"config.loginDesc": "Select your API Key and model to auto-fill config files",
"config.noKeyPrompt": "Create an API Key first",
"config.noKeyDesc": "Config files will be generated once you have a key",
"config.searchModel": "Search models...",
"config.noModelMatch": "No models match your search",
+3
View File
@@ -112,6 +112,7 @@
"tokens.deleteConfirm": "删除 \"{{name}}\"?此操作不可撤销。",
"tokens.delete": "删除",
"tokens.noKeys": "暂无 API 密钥",
"tokens.noKeysHint": "点击上方卡片即可快速创建",
"tokens.createFirst": "创建您的第一个密钥",
"tokens.enabled": "已启用",
"tokens.disabled": "已禁用",
@@ -145,6 +146,8 @@
"config.loading": "加载中...",
"config.loginPrompt": "登录后可生成您的专属配置",
"config.loginDesc": "选择 API Key 和模型,自动填充到配置文件中",
"config.noKeyPrompt": "请先创建 API Key",
"config.noKeyDesc": "创建密钥后即可自动生成配置文件",
"config.searchModel": "搜索模型...",
"config.noModelMatch": "没有匹配的模型",
+7 -14
View File
@@ -290,24 +290,17 @@ export default function Tokens() {
<div>
<div className="flex items-center justify-between mb-4">
<h2 className="text-lg font-heading font-semibold text-page">{t('tokens.myKeys')}</h2>
{!hasGroups && (
<button onClick={openCreateDefault} className="btn-primary">
{t('tokens.newKey')}
</button>
)}
</div>
{tokens.length === 0 ? (
<div className="glass rounded-2xl p-12 text-center">
<div className="w-16 h-16 mx-auto mb-4 rounded-2xl bg-page-surface flex items-center justify-center">
<svg className="w-8 h-8 text-page-muted" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<div className="glass rounded-2xl p-8 text-center">
<div className="w-12 h-12 mx-auto mb-3 rounded-xl bg-page-surface flex items-center justify-center">
<svg className="w-6 h-6 text-page-muted" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={1.5} d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z" />
</svg>
</div>
<p className="text-page-secondary mb-4">{t('tokens.noKeys')}</p>
<button onClick={openCreateDefault} className="btn-primary">
{t('tokens.createFirst')}
</button>
<p className="text-sm text-page-secondary">{t('tokens.noKeys')}</p>
<p className="text-xs text-page-muted mt-1">{t('tokens.noKeysHint')}</p>
</div>
) : (
<div className="space-y-3">
@@ -387,7 +380,7 @@ function KeyGroupCard({ group, parseTags, onSelect, t }) {
<div className="flex items-center gap-2 flex-wrap">
<span className="font-semibold text-sm text-page">{group.name}</span>
{group.is_recommended && (
<span className="inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-amber-500/15 text-amber-600 dark:text-amber-400">
<span className="inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-amber-500/15 text-amber-500">
{t('tokens.recommended')}
</span>
)}
@@ -406,7 +399,7 @@ function KeyGroupCard({ group, parseTags, onSelect, t }) {
</span>
)}
{group.discount_label && (
<span className="text-[11px] font-semibold text-green-600 dark:text-green-400">
<span className="text-[11px] font-semibold text-page-success">
{group.discount_label}
</span>
)}