From b55af426fc4c9f955315282ecfcfae870b6fc1c1 Mon Sep 17 00:00:00 2001 From: peakchao Date: Sat, 13 Jun 2026 20:15:05 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E4=BF=AE=E5=A4=8D=E6=A8=A1?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E4=BB=B7=E6=97=A0=E6=B3=95=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../models/model-ratio-form.tsx | 20 +++--- .../models/model-ratio-table-columns.tsx | 65 ++++++++++++++++--- .../models/model-ratio-visual-editor.tsx | 3 +- web/default/src/i18n/locales/en.json | 2 + web/default/src/i18n/locales/fr.json | 2 + web/default/src/i18n/locales/ja.json | 2 + web/default/src/i18n/locales/ru.json | 2 + web/default/src/i18n/locales/vi.json | 2 + web/default/src/i18n/locales/zh.json | 2 + 9 files changed, 79 insertions(+), 21 deletions(-) diff --git a/web/default/src/features/system-settings/models/model-ratio-form.tsx b/web/default/src/features/system-settings/models/model-ratio-form.tsx index 9a9c345d2ce7..3b1110f390de 100644 --- a/web/default/src/features/system-settings/models/model-ratio-form.tsx +++ b/web/default/src/features/system-settings/models/model-ratio-form.tsx @@ -203,17 +203,15 @@ export const ModelRatioForm = memo(function ModelRatioForm({ {t('Reset prices')} - {editMode === 'json' && ( - - )} + + { + onDelete(modelName) + setConfirmOpen(false) + }} + /> + + ) } export function buildModelRatioColumns({ @@ -148,17 +194,18 @@ export function buildModelRatioColumns({ - + ), enableHiding: false, diff --git a/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx b/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx index a1684a1dc4e9..cddfb7a006b2 100644 --- a/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx +++ b/web/default/src/features/system-settings/models/model-ratio-visual-editor.tsx @@ -212,7 +212,7 @@ const ModelRatioVisualEditorComponent = forwardRef< .map((name) => { const saved = savedByName.get(name) const draft = draftByName.get(name) - const displayed = saved ?? draft + const displayed = draft ?? saved const savedSignature = getSnapshotSignature(saved) const draftSignature = getSnapshotSignature(draft) @@ -225,6 +225,7 @@ const ModelRatioVisualEditorComponent = forwardRef< isDraftNew: Boolean(!saved && draft), } }) + .filter((row) => !row.isDraftDeleted) .sort((a, b) => a.name.localeCompare(b.name)) }, [ savedModelPrice, diff --git a/web/default/src/i18n/locales/en.json b/web/default/src/i18n/locales/en.json index 97e47f5552c9..a5e6fcce9554 100644 --- a/web/default/src/i18n/locales/en.json +++ b/web/default/src/i18n/locales/en.json @@ -392,6 +392,7 @@ "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.": "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.", "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.": "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.", "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.": "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.", + "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.": "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.", "Are you sure you want to delete this key? This action cannot be undone.": "Are you sure you want to delete this key? This action cannot be undone.", "Are you sure you want to disable all enabled keys?": "Are you sure you want to disable all enabled keys?", "Are you sure you want to enable all keys?": "Are you sure you want to enable all keys?", @@ -1160,6 +1161,7 @@ "Delete logs": "Delete logs", "Delete mapping": "Delete mapping", "Delete Model": "Delete Model", + "Delete model pricing": "Delete model pricing", "Delete Models?": "Delete Models?", "Delete Provider": "Delete Provider", "Delete Request Header": "Delete Request Header", diff --git a/web/default/src/i18n/locales/fr.json b/web/default/src/i18n/locales/fr.json index 94acf17a2c7e..0e689487927f 100644 --- a/web/default/src/i18n/locales/fr.json +++ b/web/default/src/i18n/locales/fr.json @@ -392,6 +392,7 @@ "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.": "Êtes-vous sûr de vouloir supprimer {{count}} modèle(s) ? Cette action ne peut pas être annulée.", "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.": "Êtes-vous sûr de vouloir supprimer toutes les clés automatiquement désactivées ? Cette action ne peut pas être annulée.", "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.": "Êtes-vous sûr de vouloir supprimer le déploiement \"{{name}}\" ? Cette action est irréversible.", + "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.": "Êtes-vous sûr de vouloir supprimer la tarification pour \"{{name}}\" ? Cette action est irréversible.", "Are you sure you want to delete this key? This action cannot be undone.": "Êtes-vous sûr de vouloir supprimer cette clé ? Cette action ne peut pas être annulée.", "Are you sure you want to disable all enabled keys?": "Êtes-vous sûr de vouloir désactiver toutes les clés activées ?", "Are you sure you want to enable all keys?": "Êtes-vous sûr de vouloir activer toutes les clés ?", @@ -1160,6 +1161,7 @@ "Delete logs": "Supprimer les journaux", "Delete mapping": "Supprimer le mappage", "Delete Model": "Supprimer le modèle", + "Delete model pricing": "Supprimer la tarification du modèle", "Delete Models?": "Supprimer les modèles ?", "Delete Provider": "Supprimer le fournisseur", "Delete Request Header": "Supprimer un en-tête de requête", diff --git a/web/default/src/i18n/locales/ja.json b/web/default/src/i18n/locales/ja.json index 3fc292a2bfe8..b02b566fc387 100644 --- a/web/default/src/i18n/locales/ja.json +++ b/web/default/src/i18n/locales/ja.json @@ -392,6 +392,7 @@ "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.": "{{count}} 個のモデルを削除してもよろしいですか?この操作は元に戻せません。", "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.": "すべての自動無効化されたキーを削除してもよろしいですか?この操作は元に戻せません。", "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.": "デプロイ \"{{name}}\" を削除してもよろしいですか?この操作は元に戻せません。", + "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.": "モデル \"{{name}}\" の価格を削除してもよろしいですか?この操作は元に戻せません。", "Are you sure you want to delete this key? This action cannot be undone.": "このキーを削除してもよろしいですか?この操作は元に戻せません。", "Are you sure you want to disable all enabled keys?": "すべての有効なキーを無効にすることをよろしいですか?", "Are you sure you want to enable all keys?": "すべてのキーを有効にすることをよろしいですか?", @@ -1160,6 +1161,7 @@ "Delete logs": "ログを削除", "Delete mapping": "マッピングを削除", "Delete Model": "モデルを削除", + "Delete model pricing": "モデル価格を削除", "Delete Models?": "モデルを削除しますか?", "Delete Provider": "プロバイダーを削除", "Delete Request Header": "リクエストヘッダーを削除", diff --git a/web/default/src/i18n/locales/ru.json b/web/default/src/i18n/locales/ru.json index 50517e7cf4f6..fae400ddbf7a 100644 --- a/web/default/src/i18n/locales/ru.json +++ b/web/default/src/i18n/locales/ru.json @@ -392,6 +392,7 @@ "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.": "Вы уверены, что хотите удалить {{count}} модел(ей)? Это действие нельзя отменить.", "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.": "Вы уверены, что хотите удалить все автоматически отключённые ключи? Это действие нельзя отменить.", "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.": "Вы уверены, что хотите удалить развертывание \"{{name}}\"? Это действие нельзя отменить.", + "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.": "Вы уверены, что хотите удалить цену для \"{{name}}\"? Это действие нельзя отменить.", "Are you sure you want to delete this key? This action cannot be undone.": "Вы уверены, что хотите удалить этот ключ? Это действие нельзя отменить.", "Are you sure you want to disable all enabled keys?": "Вы уверены, что хотите отключить все включённые ключи?", "Are you sure you want to enable all keys?": "Вы уверены, что хотите включить все ключи?", @@ -1160,6 +1161,7 @@ "Delete logs": "Удалить логи", "Delete mapping": "Удалить сопоставление", "Delete Model": "Удалить модель", + "Delete model pricing": "Удалить цену модели", "Delete Models?": "Удалить модели?", "Delete Provider": "Удалить провайдер", "Delete Request Header": "Удалить заголовок запроса", diff --git a/web/default/src/i18n/locales/vi.json b/web/default/src/i18n/locales/vi.json index c23c877d63a4..cbdf77a3fa6b 100644 --- a/web/default/src/i18n/locales/vi.json +++ b/web/default/src/i18n/locales/vi.json @@ -392,6 +392,7 @@ "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.": "Bạn có chắc muốn xóa {{count}} mô hình không? Hành động này không thể hoàn tác.", "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.": "Bạn có chắc chắn muốn xóa tất cả các khóa bị tắt tự động? Hành động này không thể hoàn tác.", "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.": "Bạn có chắc muốn xóa triển khai \"{{name}}\" không? Hành động này không thể hoàn tác.", + "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.": "Bạn có chắc muốn xóa giá cho \"{{name}}\" không? Hành động này không thể hoàn tác.", "Are you sure you want to delete this key? This action cannot be undone.": "Bạn có chắc chắn muốn xóa khóa này? Hành động này không thể hoàn tác.", "Are you sure you want to disable all enabled keys?": "Bạn có chắc chắn muốn vô hiệu hóa tất cả các khóa đang bật không?", "Are you sure you want to enable all keys?": "Bạn có chắc chắn muốn bật tất cả các khóa không?", @@ -1160,6 +1161,7 @@ "Delete logs": "Xóa nhật ký", "Delete mapping": "Xóa ánh xạ", "Delete Model": "Xóa Mô hình", + "Delete model pricing": "Xóa giá mô hình", "Delete Models?": "Xóa mô hình?", "Delete Provider": "Xóa nhà cung cấp", "Delete Request Header": "Xóa header yêu cầu", diff --git a/web/default/src/i18n/locales/zh.json b/web/default/src/i18n/locales/zh.json index 5ca604561ace..f6450584f9ce 100644 --- a/web/default/src/i18n/locales/zh.json +++ b/web/default/src/i18n/locales/zh.json @@ -392,6 +392,7 @@ "Are you sure you want to delete {{count}} model(s)? This action cannot be undone.": "您确定要删除 {{count}} 个模型吗?此操作无法撤销。", "Are you sure you want to delete all auto-disabled keys? This action cannot be undone.": "您确定要删除所有自动禁用的密钥吗?此操作无法撤销。", "Are you sure you want to delete deployment \"{{name}}\"? This action cannot be undone.": "确定要删除部署 \"{{name}}\" 吗?此操作不可撤销。", + "Are you sure you want to delete pricing for \"{{name}}\"? This action cannot be undone.": "确定要删除模型 \"{{name}}\" 的定价吗?此操作不可撤销。", "Are you sure you want to delete this key? This action cannot be undone.": "您确定要删除此密钥吗?此操作无法撤销。", "Are you sure you want to disable all enabled keys?": "您确定要禁用所有已启用的密钥吗?", "Are you sure you want to enable all keys?": "您确定要启用所有密钥吗?", @@ -1160,6 +1161,7 @@ "Delete logs": "删除日志", "Delete mapping": "删除映射", "Delete Model": "删除模型", + "Delete model pricing": "删除模型定价", "Delete Models?": "删除模型?", "Delete Provider": "删除提供商", "Delete Request Header": "删除请求头", From a907a026d7c4d690314e6be5d5a9cc5c5261f709 Mon Sep 17 00:00:00 2001 From: peakchao Date: Sun, 14 Jun 2026 16:53:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?refactor(data-table-row):=20=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=89=E6=8B=A9=E5=90=8C=E6=AD=A5=E6=B8=A0=E9=81=93?= =?UTF-8?q?=E5=A4=8D=E9=80=89=E6=A1=86=E7=8A=B6=E6=80=81=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/data-table/core/data-table-row.tsx | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/web/default/src/components/data-table/core/data-table-row.tsx b/web/default/src/components/data-table/core/data-table-row.tsx index b6d56bb10281..2d7bfe1a42ad 100644 --- a/web/default/src/components/data-table/core/data-table-row.tsx +++ b/web/default/src/components/data-table/core/data-table-row.tsx @@ -51,13 +51,4 @@ function DataTableRowInner({ ) } -export const DataTableRow = React.memo(DataTableRowInner, (prev, next) => { - // Skip re-render when only the getColumnClassName reference changed but the - // row identity and selection state are the same — callers rarely stabilize - // this callback, so excluding it from comparison avoids unnecessary renders. - return ( - prev.row === next.row && - prev.className === next.className && - prev.row.getIsSelected() === next.row.getIsSelected() - ) -}) as typeof DataTableRowInner +export const DataTableRow = DataTableRowInner From 8a3eb5b30ddbe41267b806130b79a53558c5d430 Mon Sep 17 00:00:00 2001 From: peakchao Date: Sun, 14 Jun 2026 19:13:56 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(i18n):=20=E7=A7=BB=E9=99=A4=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E5=A4=B4=E9=83=A8=E5=92=8C=E9=A1=B5=E8=84=9A=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E7=BF=BB=E8=AF=91=E5=87=BD=E6=95=B0=EF=BC=8C=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E4=BD=BF=E7=94=A8=E9=93=BE=E6=8E=A5=E6=A0=87=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/layout/components/footer.tsx | 2 +- .../src/components/layout/components/public-header.tsx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/default/src/components/layout/components/footer.tsx b/web/default/src/components/layout/components/footer.tsx index be4e612fd42e..db0d3ff083fb 100644 --- a/web/default/src/components/layout/components/footer.tsx +++ b/web/default/src/components/layout/components/footer.tsx @@ -274,7 +274,7 @@ export function Footer(props: FooterProps) { {displayColumns.map((column, index) => (

- {t(column.title)} + {column.title}

    {column.links.map((link, linkIndex) => ( diff --git a/web/default/src/components/layout/components/public-header.tsx b/web/default/src/components/layout/components/public-header.tsx index 7030a7c54040..299aba2a1e1e 100644 --- a/web/default/src/components/layout/components/public-header.tsx +++ b/web/default/src/components/layout/components/public-header.tsx @@ -158,7 +158,7 @@ export function PublicHeader(props: PublicHeaderProps) { } setAuthPromptSecondsLeft(AUTH_PROMPT_SECONDS) setAuthPromptTarget({ - title: t(link.title), + title: link.title, href: link.href, }) return @@ -231,7 +231,7 @@ export function PublicHeader(props: PublicHeaderProps) { link.disabled && 'pointer-events-none opacity-50' )} > - {t(link.title)} + {link.title} ) } @@ -249,7 +249,7 @@ export function PublicHeader(props: PublicHeaderProps) { link.disabled && 'pointer-events-none opacity-50' )} > - {t(link.title)} + {link.title} ) })} @@ -372,7 +372,7 @@ export function PublicHeader(props: PublicHeaderProps) { className={linkClassName} style={transitionStyle} > - {t(link.title)} + {link.title} ) } @@ -385,7 +385,7 @@ export function PublicHeader(props: PublicHeaderProps) { className={linkClassName} style={transitionStyle} > - {t(link.title)} + {link.title} ) })}