mirror of
https://github.com/Fasthei/taiji-pda-v0.git
synced 2026-09-26 20:21:56 +00:00
feat: 密钥管理显示模型名称 (modelName)
- 每个密钥显示对应的模型名称标签 - 显示密钥状态 (active/inactive) - 优化密钥卡片样式
This commit is contained in:
@@ -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
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user