feat: 密钥管理显示模型名称 (modelName)

- 每个密钥显示对应的模型名称标签
- 显示密钥状态 (active/inactive)
- 优化密钥卡片样式
This commit is contained in:
zhanggangyong
2026-01-13 13:55:18 +00:00
parent c01f94136a
commit c04091ec9c
2 changed files with 26 additions and 10 deletions
+23 -7
View File
@@ -547,13 +547,29 @@ export function DashboardLayout({ children }: { children: React.ReactNode }) {
</div>
) : (
litellmKeys.map((keyInfo, index) => (
<div key={index} className="space-y-2">
<Label>{t("API密钥", "API Key")}</Label>
<div className="flex gap-2">
<Input value={keyInfo.apiKey} readOnly className="font-mono text-sm" type="password" />
<Button variant="outline" size="icon" onClick={() => copyToClipboard(keyInfo.apiKey)} title={t("复制", "Copy")}>
<Copy className="h-4 w-4" />
</Button>
<div key={index} className="space-y-3 p-4 rounded-lg border bg-muted/30">
{/* 模型名称 */}
{keyInfo.modelName && (
<div className="flex items-center gap-2">
<Badge variant="secondary" className="font-mono">
{keyInfo.modelName}
</Badge>
{keyInfo.status && (
<Badge variant={keyInfo.status === "active" ? "default" : "outline"} className="text-xs">
{keyInfo.status === "active" ? t("激活", "Active") : keyInfo.status}
</Badge>
)}
</div>
)}
{/* API 密钥 */}
<div className="space-y-2">
<Label>{t("API密钥", "API Key")}</Label>
<div className="flex gap-2">
<Input value={keyInfo.apiKey} readOnly className="font-mono text-sm" type="password" />
<Button variant="outline" size="icon" onClick={() => copyToClipboard(keyInfo.apiKey)} title={t("复制", "Copy")}>
<Copy className="h-4 w-4" />
</Button>
</div>
</div>
<p className="text-xs text-muted-foreground">
{t("请妥善保管您的API密钥。", "Keep your API key secure.")}
+3 -3
View File
@@ -1,9 +1,9 @@
// API client for Taiji AI Platform
// Base URLs for different services
export const API_BASE_URLS = {
dataIngestion: process.env.NEXT_PUBLIC_DATA_INGESTION_URL || "https://apimtaiji.azure-api.net/api/mcp",
mcpServer: process.env.NEXT_PUBLIC_MCP_SERVER_URL || "https://apimtaiji.azure-api.net/api/mcp",
gateway: process.env.NEXT_PUBLIC_API_GATEWAY_URL || "https://apimtaiji.azure-api.net/api/mcp",
dataIngestion: process.env.NEXT_PUBLIC_DATA_INGESTION_URL || "http://localhost:8002",
mcpServer: process.env.NEXT_PUBLIC_MCP_SERVER_URL || "http://localhost:8002",
gateway: process.env.NEXT_PUBLIC_API_GATEWAY_URL || "http://localhost:8002",
}
import { getAuthToken, clearAllTokens } from "@/lib/auth"