From 98a6b1929802f35b67c0e1f614d683305cf7642f Mon Sep 17 00:00:00 2001 From: jialin Date: Wed, 10 Jun 2026 11:31:59 +0800 Subject: [PATCH] fix: flatten all filters in table list --- src/locales/en-US/benchmark.ts | 6 +- src/locales/ja-JP/benchmark.ts | 4 +- src/locales/ru-RU/benchmark.ts | 4 +- src/locales/tr-TR/benchmark.ts | 4 +- src/locales/zh-CN/benchmark.ts | 4 +- src/locales/zh-CN/common.ts | 2 +- src/locales/zh-CN/models.ts | 2 +- .../benchmark/components/left-actions.tsx | 54 +++++------- src/pages/llmodels/components/table-list.tsx | 33 ++----- src/pages/llmodels/instance-view/index.tsx | 16 ++++ .../llmodels/instance-view/left-filters.tsx | 88 +++++++++++-------- 11 files changed, 108 insertions(+), 109 deletions(-) diff --git a/src/locales/en-US/benchmark.ts b/src/locales/en-US/benchmark.ts index 8be5e6c6..0ba53ac1 100644 --- a/src/locales/en-US/benchmark.ts +++ b/src/locales/en-US/benchmark.ts @@ -37,10 +37,10 @@ export default { 'Stress test for long-context handling. Evaluates KV cache behavior, memory usage, and backend stability.', 'benchmark.form.profile.heavy.tips': 'Decode-heavy generation benchmark. Measures sustained decoding speed and output token throughput.', - 'benchmark.table.filter.bygpu': 'Filter by GPU', - 'benchmark.table.filter.bymodel': 'Filter by Model', + 'benchmark.table.filter.bygpu': 'Search by GPU', + 'benchmark.table.filter.bymodel': 'Search by model', 'benchmark.table.filter.bydataset': 'Filter by Dataset', - 'benchmark.table.filter.byProfile': 'Filter by Profile', + 'benchmark.table.filter.byProfile': 'Filter by profile', 'benchmark.table.avg': 'Avg', 'benchmark.table.columnSettings': 'Column Settings', 'benchmark.detail.summary.results': 'Test Results', diff --git a/src/locales/ja-JP/benchmark.ts b/src/locales/ja-JP/benchmark.ts index 8be5e6c6..e7a4745e 100644 --- a/src/locales/ja-JP/benchmark.ts +++ b/src/locales/ja-JP/benchmark.ts @@ -37,8 +37,8 @@ export default { 'Stress test for long-context handling. Evaluates KV cache behavior, memory usage, and backend stability.', 'benchmark.form.profile.heavy.tips': 'Decode-heavy generation benchmark. Measures sustained decoding speed and output token throughput.', - 'benchmark.table.filter.bygpu': 'Filter by GPU', - 'benchmark.table.filter.bymodel': 'Filter by Model', + 'benchmark.table.filter.bygpu': 'GPU 検索', + 'benchmark.table.filter.bymodel': 'モデル検索', 'benchmark.table.filter.bydataset': 'Filter by Dataset', 'benchmark.table.filter.byProfile': 'Filter by Profile', 'benchmark.table.avg': 'Avg', diff --git a/src/locales/ru-RU/benchmark.ts b/src/locales/ru-RU/benchmark.ts index 8be5e6c6..f4e9ddc2 100644 --- a/src/locales/ru-RU/benchmark.ts +++ b/src/locales/ru-RU/benchmark.ts @@ -37,8 +37,8 @@ export default { 'Stress test for long-context handling. Evaluates KV cache behavior, memory usage, and backend stability.', 'benchmark.form.profile.heavy.tips': 'Decode-heavy generation benchmark. Measures sustained decoding speed and output token throughput.', - 'benchmark.table.filter.bygpu': 'Filter by GPU', - 'benchmark.table.filter.bymodel': 'Filter by Model', + 'benchmark.table.filter.bygpu': 'Поиск GPU', + 'benchmark.table.filter.bymodel': 'Поиск модели', 'benchmark.table.filter.bydataset': 'Filter by Dataset', 'benchmark.table.filter.byProfile': 'Filter by Profile', 'benchmark.table.avg': 'Avg', diff --git a/src/locales/tr-TR/benchmark.ts b/src/locales/tr-TR/benchmark.ts index 5adc360a..69fb247d 100644 --- a/src/locales/tr-TR/benchmark.ts +++ b/src/locales/tr-TR/benchmark.ts @@ -37,8 +37,8 @@ export default { 'Uzun bağlam işleme için stres testi. KV önbellek davranışını, bellek kullanımını ve altyapı kararlılığını değerlendirir.', 'benchmark.form.profile.heavy.tips': 'Çözümleme ağırlıklı üretim kıyaslaması. Sürekli çözümleme hızını ve çıkış token verimini ölçer.', - 'benchmark.table.filter.bygpu': "GPU'ya göre filtrele", - 'benchmark.table.filter.bymodel': 'Modele göre filtrele', + 'benchmark.table.filter.bygpu': 'GPU ara', + 'benchmark.table.filter.bymodel': 'Model ara', 'benchmark.table.filter.bydataset': 'Veri Kümesine göre filtrele', 'benchmark.table.filter.byProfile': 'Profile göre filtrele', 'benchmark.table.avg': 'Ort.', diff --git a/src/locales/zh-CN/benchmark.ts b/src/locales/zh-CN/benchmark.ts index 963f98cb..ddb32d83 100644 --- a/src/locales/zh-CN/benchmark.ts +++ b/src/locales/zh-CN/benchmark.ts @@ -37,8 +37,8 @@ export default { '长上下文压力测试。评估 KV Cache 行为、内存占用及后端稳定性。', 'benchmark.form.profile.heavy.tips': '以解码为主的生成测试。衡量持续解码速度与输出 Token 吞吐能力。', - 'benchmark.table.filter.bygpu': '按 GPU 过滤', - 'benchmark.table.filter.bymodel': '按模型过滤', + 'benchmark.table.filter.bygpu': 'GPU 查询', + 'benchmark.table.filter.bymodel': '模型查询', 'benchmark.table.filter.bydataset': '按数据集过滤', 'benchmark.table.filter.byProfile': '按模式过滤', 'benchmark.table.avg': '均值', diff --git a/src/locales/zh-CN/common.ts b/src/locales/zh-CN/common.ts index 1a21278a..f7550da7 100644 --- a/src/locales/zh-CN/common.ts +++ b/src/locales/zh-CN/common.ts @@ -261,7 +261,7 @@ export default { 'common.button.terminal': '终端', 'common.button.addItem': '添加项', 'common.help.default': '默认: {content}', - 'common.filter.status': '按状态筛选', + 'common.filter.status': '按状态过滤', 'common.form.rule.selectInput': '请选择或输入{name}', 'common.tag.experimental': '实验性', 'common.title.example': '示例', diff --git a/src/locales/zh-CN/models.ts b/src/locales/zh-CN/models.ts index 103392ec..f9e769f9 100644 --- a/src/locales/zh-CN/models.ts +++ b/src/locales/zh-CN/models.ts @@ -99,7 +99,7 @@ export default { 'models.form.search.gguftips': '当 macOS 或 Windows 作节点时勾选 GGUF(搜索语音模型时取消勾选)', 'models.form.button.addlabel': '添加标签', - 'models.filter.category': '按类别筛选', + 'models.filter.category': '按类别过滤', 'models.list.more.logs': '查看更多', 'models.catalog.release.date': '发布日期', 'models.localpath.gguf.tips.title': 'GGUF 格式模型', diff --git a/src/pages/benchmark/components/left-actions.tsx b/src/pages/benchmark/components/left-actions.tsx index 40889baa..33849b27 100644 --- a/src/pages/benchmark/components/left-actions.tsx +++ b/src/pages/benchmark/components/left-actions.tsx @@ -1,10 +1,10 @@ -import { modelCategoriesMap } from '@/pages/llmodels/config'; import { SearchOutlined, SyncOutlined } from '@ant-design/icons'; -import { FiltersButton } from '@gpustack/core-ui'; +import { BaseSelect } from '@gpustack/core-ui'; import { useIntl } from '@umijs/max'; import { Button, Input, Space } from 'antd'; import _ from 'lodash'; import React from 'react'; +import { profileOptions } from '../config'; export interface RightActionsProps { handleInputChange: (e: React.ChangeEvent) => void; @@ -38,22 +38,15 @@ const RightActions: React.FC = ({ const handleGPUChange = debounceUpdateFilter; - const modelOptions = modelList - ?.filter((item) => { - return item.categories?.includes(modelCategoriesMap.llm); - }) - .map((item) => ({ - label: item.label, - value: item.label - })); + const handleSearchByModelDebounce = _.debounce((value: any) => { + handleQueryChange({ + page: 1, + model_name: value + }); + }, 350); return ( - = ({ placeholder={intl.formatMessage({ id: 'common.filter.name' })} - style={{ width: 300 }} + style={{ width: 200 }} allowClear onChange={handleInputChange} > - {/* + } + placeholder={intl.formatMessage({ + id: 'benchmark.table.filter.bymodel' + })} + style={{ width: 180 }} + allowClear + onChange={handleSearchByModelDebounce} + > + = ({ }) } > - - handleQueryChange({ - model_name: value, - page: 1 - }) - } - > */}