Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions messages/en/bigScreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
"status": {
"normal": "System Normal",
"lastUpdate": "Last Update"
},
"chart": {
"requestUnit": "requests",
"countLabel": "Count",
"switchLocale": "Switch language: {locale}"
}
}
6 changes: 6 additions & 0 deletions messages/en/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,12 @@
},
"keyListHeader": {
"todayUsage": "Today's Usage",
"userStatus": {
"disabled": "Disabled",
"expired": "Expired",
"expiringSoon": "Expiring soon",
"active": "Enabled"
},
"allowedModels": {
"label": "Allowed Models",
"noRestrictions": "Allowed Models: No restrictions"
Expand Down
1 change: 1 addition & 0 deletions messages/en/settings/providers/batchEdit.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"description": "Review changes before applying to {count} providers",
"providerHeader": "{name}",
"fieldChanged": "{field}: {before} -> {after}",
"nullValue": "null",
"fieldSkipped": "{field}: Skipped ({reason})",
"excludeProvider": "Exclude",
"summary": "{providerCount} providers, {fieldCount} changes, {skipCount} skipped",
Expand Down
3 changes: 2 additions & 1 deletion messages/en/settings/providers/form/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"routing": "Routing",
"limits": "Limits",
"network": "Network",
"testing": "Testing"
"testing": "Testing",
"stepProgress": "Step progress"
}
}
3 changes: 3 additions & 0 deletions messages/en/settings/providers/form/sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@
"title": "Model Allowlist"
},
"clientRestrictions": {
"toggleLabel": "Enable Client Restrictions",
"toggleDesc": "Clients are not restricted by default. Enable to configure allowlist/blocklist rules.",
"priorityNote": "Blocklist takes precedence over allowlist.",
"allowedLabel": "Allowed Clients",
"allowedPlaceholder": "e.g. claude-code-cli",
"blockedLabel": "Blocked Clients",
Expand Down
5 changes: 5 additions & 0 deletions messages/ja/bigScreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
"status": {
"normal": "システム正常",
"lastUpdate": "データ更新"
},
"chart": {
"requestUnit": "リクエスト",
"countLabel": "件数",
"switchLocale": "言語を切り替え: {locale}"
}
}
6 changes: 6 additions & 0 deletions messages/ja/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,12 @@
},
"keyListHeader": {
"todayUsage": "本日の使用量",
"userStatus": {
"disabled": "無効",
"expired": "期限切れ",
"expiringSoon": "まもなく期限切れ",
"active": "有効"
},
"allowedModels": {
"label": "許可モデル",
"noRestrictions": "許可されたクライアント:制限なし"
Expand Down
1 change: 1 addition & 0 deletions messages/ja/settings/providers/batchEdit.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"description": "{count} 件のプロバイダーに適用する前に変更内容を確認してください",
"providerHeader": "{name}",
"fieldChanged": "{field}: {before} -> {after}",
"nullValue": "なし",
"fieldSkipped": "{field}: スキップ ({reason})",
"excludeProvider": "除外",
"summary": "{providerCount} 件のプロバイダー, {fieldCount} 件の変更, {skipCount} 件スキップ",
Expand Down
3 changes: 2 additions & 1 deletion messages/ja/settings/providers/form/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"routing": "ルーティング",
"limits": "制限",
"network": "ネットワーク",
"testing": "テスト"
"testing": "テスト",
"stepProgress": "ステップ進捗"
}
}
3 changes: 3 additions & 0 deletions messages/ja/settings/providers/form/sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@
"title": "モデル許可リスト"
},
"clientRestrictions": {
"toggleLabel": "クライアント制限を有効化",
"toggleDesc": "既定ではクライアントを制限しません。有効化すると許可/拒否リストを設定できます。",
"priorityNote": "拒否リストは許可リストより優先されます。",
"allowedLabel": "許可クライアント",
"allowedPlaceholder": "例: claude-code-cli",
"blockedLabel": "ブロッククライアント",
Expand Down
5 changes: 5 additions & 0 deletions messages/ru/bigScreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
"status": {
"normal": "Система в норме",
"lastUpdate": "Последнее обновление"
},
"chart": {
"requestUnit": "запросов",
"countLabel": "Кол-во",
"switchLocale": "Переключить язык: {locale}"
}
}
6 changes: 6 additions & 0 deletions messages/ru/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,12 @@
},
"keyListHeader": {
"todayUsage": "Использование сегодня",
"userStatus": {
"disabled": "Отключен",
"expired": "Истек",
"expiringSoon": "Скоро истечет",
"active": "Активен"
},
"allowedModels": {
"label": "Разрешённые модели",
"noRestrictions": "Разрешённые модели: без ограничений"
Expand Down
1 change: 1 addition & 0 deletions messages/ru/settings/providers/batchEdit.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"description": "Проверьте изменения перед применением к {count} поставщикам",
"providerHeader": "{name}",
"fieldChanged": "{field}: {before} -> {after}",
"nullValue": "null",
"fieldSkipped": "{field}: Пропущено ({reason})",
"excludeProvider": "Исключить",
"summary": "{providerCount} поставщиков, {fieldCount} изменений, {skipCount} пропущено",
Expand Down
3 changes: 2 additions & 1 deletion messages/ru/settings/providers/form/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"routing": "Маршрутизация",
"limits": "Лимиты",
"network": "Сеть",
"testing": "Тестирование"
"testing": "Тестирование",
"stepProgress": "Прогресс шагов"
}
}
3 changes: 3 additions & 0 deletions messages/ru/settings/providers/form/sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@
"title": "Список разрешённых моделей"
},
"clientRestrictions": {
"toggleLabel": "Включить ограничения клиентов",
"toggleDesc": "По умолчанию клиенты не ограничиваются. Включите, чтобы настроить правила белого/чёрного списка.",
"priorityNote": "Чёрный список имеет приоритет над белым списком.",
"allowedLabel": "Разрешённые клиенты",
"allowedPlaceholder": "напр. claude-code-cli",
"blockedLabel": "Заблокированные клиенты",
Expand Down
5 changes: 5 additions & 0 deletions messages/zh-CN/bigScreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
"status": {
"normal": "系统正常",
"lastUpdate": "数据更新"
},
"chart": {
"requestUnit": "请求",
"countLabel": "数量",
"switchLocale": "切换语言: {locale}"
}
}
6 changes: 6 additions & 0 deletions messages/zh-CN/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,12 @@
},
"keyListHeader": {
"todayUsage": "今日用量",
"userStatus": {
"disabled": "已禁用",
"expired": "已过期",
"expiringSoon": "即将过期",
"active": "已启用"
},
Comment on lines +794 to +799
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

active 翻译值与同文件其他命名空间不一致,请确认是否有意为之

新增的 keyListHeader.userStatus.active 值为 "已启用",而同文件中 userManagement.userStatus.active(第 1749 行)和 userManagement.keyStatus.active(第 1737 行)的值为 "正常"

若两处语义有意区分(前者表示"启用状态标签",后者表示"运行状态"),则当前是正确的。若均表示同一状态,建议统一翻译用词以避免用户界面上出现相互矛盾的提示。

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@messages/zh-CN/dashboard.json` around lines 794 - 799,
keyListHeader.userStatus.active translation ("已启用") is inconsistent with
userManagement.userStatus.active and userManagement.keyStatus.active ("正常");
decide whether these represent different semantics (enable/disabled label vs
runtime/healthy status) and then make them consistent: if they refer to the same
state, change keyListHeader.userStatus.active (or the other two) to use the same
wording ("正常" or "已启用"); if they are intentionally different, add a comment in
the JSON or rename the key to clarify intent (e.g.,
keyListHeader.userStatusActiveLabel) and keep translations accordingly. Refer to
keys keyListHeader.userStatus.active, userManagement.userStatus.active, and
userManagement.keyStatus.active to locate and update the entries.

"allowedModels": {
"label": "允许的模型",
"noRestrictions": "允许的模型:无限制"
Expand Down
1 change: 1 addition & 0 deletions messages/zh-CN/settings/providers/batchEdit.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"description": "将变更应用到 {count} 个供应商前请先确认",
"providerHeader": "{name}",
"fieldChanged": "{field}: {before} -> {after}",
"nullValue": "空",
"fieldSkipped": "{field}: 已跳过 ({reason})",
"excludeProvider": "排除",
"summary": "{providerCount} 个供应商, {fieldCount} 项变更, {skipCount} 项跳过",
Expand Down
3 changes: 2 additions & 1 deletion messages/zh-CN/settings/providers/form/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"routing": "路由",
"limits": "限制",
"network": "网络",
"testing": "测试"
"testing": "测试",
"stepProgress": "步骤进度"
}
}
3 changes: 3 additions & 0 deletions messages/zh-CN/settings/providers/form/sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
"moreModels": "+{count} 更多"
},
"clientRestrictions": {
"toggleLabel": "启用客户端限制",
"toggleDesc": "默认不限制客户端。启用后可配置白名单/黑名单。",
"priorityNote": "黑名单优先级高于白名单。",
"allowedLabel": "白名单客户端",
"allowedPlaceholder": "例如 claude-code-cli",
"blockedLabel": "黑名单客户端",
Expand Down
5 changes: 5 additions & 0 deletions messages/zh-TW/bigScreen.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,10 @@
"status": {
"normal": "系統正常",
"lastUpdate": "資料更新"
},
"chart": {
"requestUnit": "請求",
"countLabel": "數量",
"switchLocale": "切換語言: {locale}"
}
}
6 changes: 6 additions & 0 deletions messages/zh-TW/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,12 @@
},
"keyListHeader": {
"todayUsage": "今日使用量",
"userStatus": {
"disabled": "已禁用",
"expired": "已過期",
"expiringSoon": "即將過期",
"active": "已啟用"
},
"allowedModels": {
"label": "允許的模型",
"noRestrictions": "允許的模型:無限制"
Expand Down
1 change: 1 addition & 0 deletions messages/zh-TW/settings/providers/batchEdit.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"description": "將變更應用到 {count} 個供應商前請先確認",
"providerHeader": "{name}",
"fieldChanged": "{field}: {before} -> {after}",
"nullValue": "空",
"fieldSkipped": "{field}: 已跳過 ({reason})",
"excludeProvider": "排除",
"summary": "{providerCount} 個供應商, {fieldCount} 項變更, {skipCount} 項跳過",
Expand Down
3 changes: 2 additions & 1 deletion messages/zh-TW/settings/providers/form/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"routing": "路由",
"limits": "限制",
"network": "網路",
"testing": "測試"
"testing": "測試",
"stepProgress": "步驟進度"
}
}
3 changes: 3 additions & 0 deletions messages/zh-TW/settings/providers/form/sections.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@
"title": "模型允許清單"
},
"clientRestrictions": {
"toggleLabel": "啟用用戶端限制",
"toggleDesc": "預設不限制用戶端。啟用後可設定白名單/黑名單。",
"priorityNote": "黑名單優先於白名單。",
"allowedLabel": "白名單客戶端",
"allowedPlaceholder": "例如 claude-code-cli",
"blockedLabel": "黑名單客戶端",
Expand Down
19 changes: 19 additions & 0 deletions scripts/copy-version-to-standalone.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
const fs = require("node:fs");
const path = require("node:path");

function copyDirIfExists(srcDir, dstDir) {
if (!fs.existsSync(srcDir)) {
console.warn(`[copy-standalone] Skip missing dir: ${srcDir}`);
return;
}

fs.mkdirSync(path.dirname(dstDir), { recursive: true });
fs.cpSync(srcDir, dstDir, { recursive: true, force: true });
console.log(`[copy-standalone] Copied ${srcDir} -> ${dstDir}`);
}

const src = path.resolve(process.cwd(), "VERSION");
const dstDir = path.resolve(process.cwd(), ".next", "standalone");
const dst = path.join(dstDir, "VERSION");
Expand All @@ -13,3 +24,11 @@ if (!fs.existsSync(src)) {
fs.mkdirSync(dstDir, { recursive: true });
fs.copyFileSync(src, dst);
console.log(`[copy-version] Copied VERSION -> ${dst}`);

// Make standalone output self-contained for local `node .next/standalone/server.js` runs.
// Next.js standalone requires `.next/static` and `public` to exist next to `server.js`.
copyDirIfExists(
path.resolve(process.cwd(), ".next", "static"),
path.resolve(dstDir, ".next", "static")
);
copyDirIfExists(path.resolve(process.cwd(), "public"), path.resolve(dstDir, "public"));
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,12 @@ export function StatisticsChartCard({
};

return (
<BentoCard className={cn("flex flex-col p-0 overflow-hidden max-h-[50vh]", className)}>
<BentoCard
className={cn(
"flex flex-col p-0 overflow-hidden max-h-[var(--cch-viewport-height-50)]",
className
)}
>
{/* Header */}
<div className="flex items-center justify-between border-b border-border/50 dark:border-white/[0.06]">
<div className="flex items-center gap-4 p-4">
Expand Down
6 changes: 5 additions & 1 deletion src/app/[locale]/dashboard/_components/dashboard-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ export function DashboardMain({ children }: DashboardMainProps) {
normalizedPathname.includes("/dashboard/sessions/") && normalizedPathname.endsWith("/messages");

if (isSessionMessagesPage) {
return <main className="h-[calc(100vh-64px)] w-full overflow-hidden">{children}</main>;
return (
<main className="h-[calc(var(--cch-viewport-height,100vh)-64px)] w-full overflow-hidden">
{children}
</main>
);
}

return <main className="mx-auto w-full max-w-7xl px-6 py-8">{children}</main>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function AddKeyDialog({

return (
<Dialog open={open} onOpenChange={handleClose}>
<DialogContent className="max-w-2xl max-h-[90dvh] max-h-[90vh] p-0 flex flex-col overflow-hidden">
<DialogContent className="max-w-2xl max-h-[var(--cch-viewport-height-90)] p-0 flex flex-col overflow-hidden">
{generatedKey ? (
<>
<DialogHeader className="px-6 pt-6 pb-4 border-b">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function AddUserDialog({
<ListPlus className="h-4 w-4" /> {t("addUser")}
</Button>
</DialogTrigger>
<DialogContent className="max-h-[85vh] overflow-y-auto">
<DialogContent className="max-h-[var(--cch-viewport-height-85)] overflow-y-auto">
<FormErrorBoundary>
<UserForm onSuccess={() => setOpen(false)} currentUser={currentUser} />
</FormErrorBoundary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ function BatchEditDialogInner({
</DialogDescription>
</DialogHeader>

<div className="max-h-[70vh] overflow-y-auto space-y-6 pr-1">
<div className="max-h-[var(--cch-viewport-height-70)] overflow-y-auto space-y-6 pr-1">
{selectedUsersCount > 0 ? (
<BatchUserSection
affectedUsersCount={selectedUsersCount}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ function CreateUserDialogInner({ onOpenChange, onSuccess }: CreateUserDialogProp
}

return (
<DialogContent className="w-full max-w-[95vw] sm:max-w-[85vw] md:max-w-[70vw] lg:max-w-3xl max-h-[90vh] max-h-[90dvh] p-0 flex flex-col overflow-hidden">
<DialogContent className="w-full max-w-[95vw] sm:max-w-[85vw] md:max-w-[70vw] lg:max-w-3xl max-h-[var(--cch-viewport-height-90)] p-0 flex flex-col overflow-hidden">
<form onSubmit={form.handleSubmit} className="flex flex-1 min-h-0 flex-col">
<DialogHeader className="px-6 pt-6 pb-4 border-b flex-shrink-0">
<div className="flex items-center gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function EditKeyDialog({

return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-w-2xl max-h-[90dvh] p-0 flex flex-col overflow-hidden">
<DialogContent className="max-w-2xl max-h-[var(--cch-viewport-height-90)] p-0 flex flex-col overflow-hidden">
<DialogHeader className="sr-only">
<DialogTitle>{t("title")}</DialogTitle>
<DialogDescription>{t("description")}</DialogDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ function EditUserDialogInner({ onOpenChange, user, onSuccess }: EditUserDialogPr
};

return (
<DialogContent className="w-full max-w-[95vw] sm:max-w-[85vw] md:max-w-[70vw] lg:max-w-3xl max-h-[90vh] max-h-[90dvh] p-0 flex flex-col overflow-hidden">
<DialogContent className="w-full max-w-[95vw] sm:max-w-[85vw] md:max-w-[70vw] lg:max-w-3xl max-h-[var(--cch-viewport-height-90,90vh)] p-0 flex flex-col overflow-hidden">
<form onSubmit={form.handleSubmit} className="flex flex-1 min-h-0 flex-col">
<DialogHeader className="px-6 pt-6 pb-4 border-b flex-shrink-0">
<div className="flex items-center gap-2">
Expand Down
4 changes: 2 additions & 2 deletions src/app/[locale]/dashboard/_components/user/key-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function KeyActions({
<SquarePen className="h-4 w-4" />
</button>
</DialogTrigger>
<DialogContent className="max-h-[80vh] flex flex-col overflow-hidden">
<DialogContent className="max-h-[var(--cch-viewport-height-80)] flex flex-col overflow-hidden">
<FormErrorBoundary>
<EditKeyForm
keyData={keyData}
Expand All @@ -75,7 +75,7 @@ export function KeyActions({
<Trash2 className="h-4 w-4" />
</button>
</DialogTrigger>
<DialogContent className="max-h-[80vh] flex flex-col overflow-hidden">
<DialogContent className="max-h-[var(--cch-viewport-height-80)] flex flex-col overflow-hidden">
<FormErrorBoundary>
<DeleteKeyConfirm keyData={keyData} onSuccess={() => setOpenDelete(false)} />
</FormErrorBoundary>
Expand Down
Loading