11import AutoTooltip from '@/components/auto-tooltip' ;
22import ProgressBar from '@/components/progress-bar' ;
33import InfoColumn from '@/components/simple-table/info-column' ;
4+ import { tableSorter } from '@/config/settings' ;
45import { convertFileSize } from '@/utils' ;
56import { useIntl } from '@umijs/max' ;
67import { ColumnsType } from 'antd/lib/table' ;
@@ -50,9 +51,7 @@ const useGPUColumns = (props: {
5051 title : intl . formatMessage ( { id : 'common.table.name' } ) ,
5152 dataIndex : 'name' ,
5253 width : 240 ,
53- sorter : {
54- multiple : 1
55- } ,
54+ sorter : tableSorter ( 1 ) ,
5655 render : ( text : string , record : GPUDeviceItem ) => (
5756 < AutoTooltip ghost maxWidth = { 240 } >
5857 { text }
@@ -62,17 +61,13 @@ const useGPUColumns = (props: {
6261 {
6362 title : intl . formatMessage ( { id : 'resources.table.index' } ) ,
6463 dataIndex : 'index' ,
65- sorter : {
66- multiple : 2
67- } ,
64+ sorter : tableSorter ( 2 ) ,
6865 render : ( text : string , record : GPUDeviceItem ) => < span > { text } </ span >
6966 } ,
7067 {
7168 title : intl . formatMessage ( { id : 'clusters.title' } ) ,
7269 dataIndex : 'cluster_id' ,
73- sorter : {
74- multiple : 3
75- } ,
70+ sorter : tableSorter ( 3 ) ,
7671 ellipsis : {
7772 showTitle : false
7873 } ,
@@ -85,9 +80,7 @@ const useGPUColumns = (props: {
8580 {
8681 title : intl . formatMessage ( { id : 'resources.worker' } ) ,
8782 dataIndex : 'worker_name' ,
88- sorter : {
89- multiple : 4
90- } ,
83+ sorter : tableSorter ( 4 ) ,
9184 ellipsis : {
9285 showTitle : false
9386 } ,
@@ -98,9 +91,7 @@ const useGPUColumns = (props: {
9891 {
9992 title : intl . formatMessage ( { id : 'resources.table.vender' } ) ,
10093 dataIndex : 'vendor' ,
101- sorter : {
102- multiple : 5
103- }
94+ sorter : tableSorter ( 5 )
10495 } ,
10596 {
10697 title : `${ intl . formatMessage ( { id : 'resources.table.temperature' } ) } (°C)` ,
@@ -113,9 +104,7 @@ const useGPUColumns = (props: {
113104 title : `${ intl . formatMessage ( { id : 'resources.table.utilization' } ) } ` ,
114105 dataIndex : 'core.utilization_rate' ,
115106 key : 'core.utilization_rate' ,
116- sorter : {
117- multiple : 6
118- } ,
107+ sorter : tableSorter ( 6 ) ,
119108 render : ( text : number , record : GPUDeviceItem ) => {
120109 return (
121110 < >
@@ -134,9 +123,7 @@ const useGPUColumns = (props: {
134123 title : intl . formatMessage ( { id : 'resources.table.vramutilization' } ) ,
135124 dataIndex : 'memory.utilization_rate' ,
136125 key : 'memory.utilization_rate' ,
137- sorter : {
138- multiple : 7
139- } ,
126+ sorter : tableSorter ( 7 ) ,
140127 render : ( text : number , record : GPUDeviceItem , index : number ) => {
141128 return (
142129 < ProgressBar
0 commit comments