diff --git a/messages/ja/dashboard.json b/messages/ja/dashboard.json index 7925b94c8..9f1a4370b 100644 --- a/messages/ja/dashboard.json +++ b/messages/ja/dashboard.json @@ -512,6 +512,27 @@ "placeholder": "空白の場合は無制限", "description": "5時間以内の最大消費金額" }, + "limitDailyUsd": { + "label": "1日の消費上限 (USD)", + "placeholder": "空白の場合は無制限", + "description": "1日あたりの最大消費金額" + }, + "dailyResetMode": { + "label": "毎日リセットモード", + "options": { + "fixed": "固定時間リセット", + "rolling": "ローリングウィンドウ (24時間)" + }, + "desc": { + "fixed": "毎日指定された時間にクォータをリセット", + "rolling": "最初のリクエストから24時間のローリングウィンドウ" + } + }, + "dailyResetTime": { + "label": "毎日リセット時間", + "placeholder": "HH:mm", + "description": "1日の制限がリセットされる時間 (システムタイムゾーンを使用)" + }, "limitWeeklyUsd": { "label": "週間消費上限 (USD)", "placeholder": "空白の場合は無制限", diff --git a/messages/ru/dashboard.json b/messages/ru/dashboard.json index baed50885..8190852d1 100644 --- a/messages/ru/dashboard.json +++ b/messages/ru/dashboard.json @@ -511,6 +511,27 @@ "placeholder": "Оставьте пустым для неограниченного", "description": "Максимальный расход в течение 5 часов" }, + "limitDailyUsd": { + "label": "Дневной лимит расходов (USD)", + "placeholder": "Оставьте пустым для неограниченного", + "description": "Максимальный расход в день" + }, + "dailyResetMode": { + "label": "Режим ежедневного сброса", + "options": { + "fixed": "Сброс в фиксированное время", + "rolling": "Скользящее окно (24 часа)" + }, + "desc": { + "fixed": "Сброс квоты в определенное время каждый день", + "rolling": "24-часовое скользящее окно от первого запроса" + } + }, + "dailyResetTime": { + "label": "Время ежедневного сброса", + "placeholder": "HH:mm", + "description": "Когда сбрасывается дневной лимит (использует системный часовой пояс)" + }, "limitWeeklyUsd": { "label": "Недельный лимит расходов (USD)", "placeholder": "Оставьте пустым для неограниченного", diff --git a/messages/zh-TW/dashboard.json b/messages/zh-TW/dashboard.json index 4e3e50e7f..e27047fbd 100644 --- a/messages/zh-TW/dashboard.json +++ b/messages/zh-TW/dashboard.json @@ -513,6 +513,27 @@ "placeholder": "留空表示無限制", "description": "5小時內最大消費金額" }, + "limitDailyUsd": { + "label": "每日消費上限 (USD)", + "placeholder": "留空表示無限制", + "description": "每日最大消費金額" + }, + "dailyResetMode": { + "label": "每日重設模式", + "options": { + "fixed": "固定時間重設", + "rolling": "滾動視窗(24小時)" + }, + "desc": { + "fixed": "每天在指定時間重設額度", + "rolling": "從首次請求開始計算24小時滾動視窗" + } + }, + "dailyResetTime": { + "label": "每日重設時間", + "placeholder": "HH:mm", + "description": "每日限額的重設時間(使用系統時區)" + }, "limitWeeklyUsd": { "label": "週消費上限 (USD)", "placeholder": "留空表示無限制", diff --git a/src/app/[locale]/dashboard/_components/user/add-user-dialog.tsx b/src/app/[locale]/dashboard/_components/user/add-user-dialog.tsx index 589d07978..8197b24ec 100644 --- a/src/app/[locale]/dashboard/_components/user/add-user-dialog.tsx +++ b/src/app/[locale]/dashboard/_components/user/add-user-dialog.tsx @@ -34,7 +34,7 @@ export function AddUserDialog({ {t("addUser")} - + setOpen(false)} currentUser={currentUser} /> diff --git a/src/app/[locale]/dashboard/_components/user/forms/add-key-form.tsx b/src/app/[locale]/dashboard/_components/user/forms/add-key-form.tsx index 06197a42b..86ead9486 100644 --- a/src/app/[locale]/dashboard/_components/user/forms/add-key-form.tsx +++ b/src/app/[locale]/dashboard/_components/user/forms/add-key-form.tsx @@ -155,38 +155,40 @@ export function AddKeyForm({ userId, user, onSuccess }: AddKeyFormProps) { /> -
- - -

- {form.values.dailyResetMode === "fixed" - ? t("dailyResetMode.desc.fixed") - : t("dailyResetMode.desc.rolling")} -

-
+ +
+ + +

+ {form.values.dailyResetMode === "fixed" + ? t("dailyResetMode.desc.fixed") + : t("dailyResetMode.desc.rolling")} +

+
- {form.values.dailyResetMode === "fixed" && ( - - )} + {form.values.dailyResetMode === "fixed" && ( + + )} +
-
- - -

- {form.values.dailyResetMode === "fixed" - ? t("dailyResetMode.desc.fixed") - : t("dailyResetMode.desc.rolling")} -

-
+ +
+ + +

+ {form.values.dailyResetMode === "fixed" + ? t("dailyResetMode.desc.fixed") + : t("dailyResetMode.desc.rolling")} +

+
- {form.values.dailyResetMode === "fixed" && ( - - )} + {form.values.dailyResetMode === "fixed" && ( + + )} +
- + - + setOpenDelete(false)} /> diff --git a/src/app/[locale]/dashboard/_components/user/user-list.tsx b/src/app/[locale]/dashboard/_components/user/user-list.tsx index e6cd96526..cff7b78de 100644 --- a/src/app/[locale]/dashboard/_components/user/user-list.tsx +++ b/src/app/[locale]/dashboard/_components/user/user-list.tsx @@ -70,17 +70,19 @@ export function UserList({ users, activeUserId, onUserSelect, currentUser }: Use : undefined } > -
- {listItems.map((item) => ( - onUserSelect(item.id as number)} - compact - /> - ))} -
+ {users.length > 0 ? ( +
+ {listItems.map((item) => ( + onUserSelect(item.id as number)} + compact + /> + ))} +
+ ) : null} );