From 5ad9ac277c32b3113c22ae45b823269ba50377d2 Mon Sep 17 00:00:00 2001 From: jialin Date: Tue, 3 Feb 2026 20:49:52 +0800 Subject: [PATCH] style: benchmark progress --- src/components/status-tag/index.tsx | 10 +- .../benchmark/hooks/use-benchmark-columns.tsx | 100 ------------------ .../benchmark/hooks/use-column-settings.tsx | 53 ++++++---- 3 files changed, 43 insertions(+), 120 deletions(-) diff --git a/src/components/status-tag/index.tsx b/src/components/status-tag/index.tsx index 997dc979..6728666d 100644 --- a/src/components/status-tag/index.tsx +++ b/src/components/status-tag/index.tsx @@ -3,6 +3,7 @@ import { StatusType } from '@/config/types'; import { InfoCircleOutlined } from '@ant-design/icons'; import { Button, Divider, Tooltip } from 'antd'; import classNames from 'classnames'; +import _ from 'lodash'; import React, { useMemo } from 'react'; import 'simplebar-react/dist/simplebar.min.css'; import styled from 'styled-components'; @@ -91,8 +92,13 @@ const StatusTag: React.FC = ({ if (download && percent > 0 && percent <= 100) { return ( <> - {download?.percent || 0}% - + + {_.round(download?.percent, 0) || 0}% + + ); } diff --git a/src/pages/benchmark/hooks/use-benchmark-columns.tsx b/src/pages/benchmark/hooks/use-benchmark-columns.tsx index 2ea1ab32..3a7d8e68 100644 --- a/src/pages/benchmark/hooks/use-benchmark-columns.tsx +++ b/src/pages/benchmark/hooks/use-benchmark-columns.tsx @@ -32,106 +32,6 @@ const useBenchmarkColumns = (params: { ) }, ...columns, - // { - // title: intl.formatMessage({ id: 'benchmark.table.model' }), - // dataIndex: 'model_name', - // sorter: tableSorter(1), - // render: (text: string) => ( - // - // {text} - // - // ) - // }, - // { - // title: intl.formatMessage({ id: 'benchmark.table.dataset' }), - // dataIndex: 'dataset_name', - // sorter: tableSorter(1), - // render: (text: string) => ( - // - // {text} - // - // ) - // }, - // { - // title: intl.formatMessage({ id: 'common.table.status' }), - // dataIndex: 'state', - // ellipsis: { - // showTitle: false - // }, - // width: 120, - // render: (value: number, record: ListItem) => ( - // - // - // {record.progress !== undefined && record.progress < 100 && ( - // - // )} - // - // ) - // }, - // { - // title: intl.formatMessage({ id: 'benchmark.table.gpu' }), - // dataIndex: 'gpu_summary', - // sorter: tableSorter(1), - // render: (text: string) => ( - // - // {text} - // - // ) - // }, - // { - // title: 'TPS', - // dataIndex: 'tokens_per_second_mean', - // sorter: tableSorter(1), - // render: (text: string) => ( - // - // {_.round(text, 2)} - // - // ) - // }, - // { - // title: ( - // - // {intl.formatMessage({ id: 'benchmark.table.ttft' })} - // - // {intl.formatMessage({ id: 'benchmark.table.avg' })} (ms) - // - // - // ), - // dataIndex: 'time_to_first_token_mean', - // sorter: tableSorter(1), - // render: (text: string) => ( - // - // {_.round(text, 2)} - // - // ) - // }, - // { - // title: ( - // - // {intl.formatMessage({ id: 'benchmark.table.tpot' })} - // - // {intl.formatMessage({ id: 'benchmark.table.avg' })} (ms) - // - // - // ), - // dataIndex: 'time_per_output_token_mean', - // sorter: tableSorter(1), - // render: (text: string) => ( - // - // {_.round(text, 2)} - // - // ) - // }, { title: intl.formatMessage({ id: 'common.table.operation' }), dataIndex: 'operations', diff --git a/src/pages/benchmark/hooks/use-column-settings.tsx b/src/pages/benchmark/hooks/use-column-settings.tsx index 94b35515..a96fe227 100644 --- a/src/pages/benchmark/hooks/use-column-settings.tsx +++ b/src/pages/benchmark/hooks/use-column-settings.tsx @@ -3,12 +3,15 @@ import StatusTag from '@/components/status-tag'; import { tableSorter } from '@/config/settings'; import ColumnSettings from '@/pages/_components/column-settings'; import { useIntl } from '@umijs/max'; -import { Progress } from 'antd'; import dayjs from 'dayjs'; import _, { round } from 'lodash'; import React from 'react'; import styled from 'styled-components'; -import { BenchmarkStatus, BenchmarkStatusLabelMap } from '../config'; +import { + BenchmarkStatus, + BenchmarkStatusLabelMap, + BenchmarkStatusValueMap +} from '../config'; import { BenchmarkListItem as ListItem } from '../config/types'; const allFields = [ @@ -58,6 +61,35 @@ const defaultColumns: string[] = [ ]; const fixedColumns: string[] = []; +const BenchmarkStateTag = (props: { data: ListItem }) => { + const { data } = props; + if (!data.state) { + return null; + } + return ( + + ); +}; + const useColumnSettings = (options: { contentHeight: number; clusterList: Global.BaseOption[]; @@ -312,22 +344,7 @@ const useColumnSettings = (options: { width: 120, dataIndex: 'state', render: (value: number, record: ListItem) => ( - - - {record.progress !== undefined && record.progress < 100 && ( - - )} - + ) }, {