style: distribution info table word wrap
This commit is contained in:
@@ -10,6 +10,7 @@ export interface ColumnProps {
|
|||||||
title: string;
|
title: string;
|
||||||
key: string;
|
key: string;
|
||||||
width?: string | number;
|
width?: string | number;
|
||||||
|
style?: React.CSSProperties;
|
||||||
render?: (data: {
|
render?: (data: {
|
||||||
dataIndex: string;
|
dataIndex: string;
|
||||||
dataList?: any[];
|
dataList?: any[];
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ const TableCell: React.FC<TableCellProps> = (props: TableCellProps) => {
|
|||||||
dataList: dataList
|
dataList: dataList
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<span className="cell-span">
|
<span className="cell-span" style={column.style}>
|
||||||
{column.render
|
{column.render
|
||||||
? column.render({
|
? column.render({
|
||||||
dataIndex: column.key,
|
dataIndex: column.key,
|
||||||
|
|||||||
@@ -287,7 +287,10 @@ const renderGpuIndexs = (gpuIndexes: number[]) => {
|
|||||||
const distributeCols: ColumnProps[] = [
|
const distributeCols: ColumnProps[] = [
|
||||||
{
|
{
|
||||||
title: 'Worker',
|
title: 'Worker',
|
||||||
key: 'worker_name'
|
key: 'worker_name',
|
||||||
|
style: {
|
||||||
|
wordBreak: 'break-word'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: 'IP',
|
title: 'IP',
|
||||||
@@ -301,13 +304,14 @@ const distributeCols: ColumnProps[] = [
|
|||||||
locale: true,
|
locale: true,
|
||||||
key: 'gpu_index',
|
key: 'gpu_index',
|
||||||
render: ({ row }) => {
|
render: ({ row }) => {
|
||||||
|
const list = _.sortBy(row.gpu_index, (item: number) => item);
|
||||||
return row.is_main ? (
|
return row.is_main ? (
|
||||||
<>
|
<>
|
||||||
{renderGpuIndexs(row.gpu_index)}
|
{renderGpuIndexs(list)}
|
||||||
<span>(main)</span>
|
<span>(main)</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
renderGpuIndexs(row.gpu_index)
|
renderGpuIndexs(list)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user