fix(style): model file list text overflow

This commit is contained in:
jialin
2026-01-13 18:43:11 +08:00
parent 5ff26e1ce8
commit 741cf07f2e
11 changed files with 30 additions and 43 deletions
+2
View File
@@ -1,3 +1,5 @@
@import './table.less';
.m-b-20 { .m-b-20 {
margin-bottom: 20px; margin-bottom: 20px;
} }
+10
View File
@@ -0,0 +1,10 @@
.ant-table-thead {
.ant-table-column-sorters {
.ant-table-column-title {
min-width: 32px;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
}
}
+3 -2
View File
@@ -64,6 +64,7 @@ const useStyles = createStyles(({ css, token }) => {
} }
&.menu-item-group-title-collapsed { &.menu-item-group-title-collapsed {
position: relative;
height: 1px; height: 1px;
padding-block: 0; padding-block: 0;
padding-inline: 0; padding-inline: 0;
@@ -125,8 +126,8 @@ const useStyles = createStyles(({ css, token }) => {
margin-block: 6px; margin-block: 6px;
background-color: ${token.colorSplit}; background-color: ${token.colorSplit};
position: absolute; position: absolute;
left: 6px; left: -2px;
right: 6px; right: -2px;
` `
}; };
}); });
@@ -1,10 +1,9 @@
import { setRouteCache } from '@/atoms/route-cache'; import { setRouteCache } from '@/atoms/route-cache';
import AlertInfo from '@/components/alert-info'; import AlertInfo from '@/components/alert-info';
import IconFont from '@/components/icon-font';
import routeCachekey from '@/config/route-cachekey'; import routeCachekey from '@/config/route-cachekey';
import { VideoCameraOutlined } from '@ant-design/icons'; import { VideoCameraOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max'; import { useIntl } from '@umijs/max';
import { Button, Spin, Tooltip } from 'antd'; import { Spin } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import _ from 'lodash'; import _ from 'lodash';
import 'overlayscrollbars/overlayscrollbars.css'; import 'overlayscrollbars/overlayscrollbars.css';
@@ -239,22 +238,6 @@ const GroundVideo: React.FC<MessageProps> = forwardRef((props, ref) => {
onInputChange={handleInputChange} onInputChange={handleInputChange}
shouldResetMessage={false} shouldResetMessage={false}
clearAll={handleClear} clearAll={handleClear}
tools={
<>
<Tooltip
title={intl.formatMessage({
id: 'playground.image.prompt.random'
})}
>
<Button
onClick={handleRandomPrompt}
size="middle"
type="text"
icon={<IconFont type="icon-random"></IconFont>}
></Button>
</Tooltip>
</>
}
/> />
</div> </div>
</div> </div>
@@ -23,8 +23,8 @@ export const videoParamsConfig: ParamsSchema[] = [
{ label: '12', value: '12' } { label: '12', value: '12' }
], ],
label: { label: {
text: 'Duration (seconds)', text: 'playground.params.duration',
isLocalized: false isLocalized: true
}, },
rules: [ rules: [
{ {
+2 -3
View File
@@ -110,14 +110,13 @@ const GPUList: React.FC<{ clusterId?: number; widths: { input: number } }> = ({
<ConfigProvider renderEmpty={renderEmpty}> <ConfigProvider renderEmpty={renderEmpty}>
<Table <Table
columns={columns} columns={columns}
style={{ width: '100%' }}
sortDirections={TABLE_SORT_DIRECTIONS} sortDirections={TABLE_SORT_DIRECTIONS}
showSorterTooltip={false} showSorterTooltip={false}
tableLayout={dataSource.loadend ? 'auto' : 'fixed'} tableLayout={'auto'}
dataSource={dataSource.dataList} dataSource={dataSource.dataList}
loading={dataSource.loading} loading={dataSource.loading}
rowKey="id" rowKey="id"
scroll={{ x: true }} scroll={{ x: 900 }}
onChange={handleTableChange} onChange={handleTableChange}
pagination={{ pagination={{
showSizeChanger: true, showSizeChanger: true,
@@ -319,7 +319,9 @@ const ModelFiles = () => {
tableLayout="fixed" tableLayout="fixed"
sortDirections={TABLE_SORT_DIRECTIONS} sortDirections={TABLE_SORT_DIRECTIONS}
showSorterTooltip={false} showSorterTooltip={false}
style={{ width: '100%' }} scroll={{
x: 900
}}
onChange={handleTableChange} onChange={handleTableChange}
dataSource={dataSource.dataList} dataSource={dataSource.dataList}
loading={dataSource.loading} loading={dataSource.loading}
+2 -3
View File
@@ -280,12 +280,11 @@ const Workers: React.FC<{
columns={columns} columns={columns}
sortDirections={TABLE_SORT_DIRECTIONS} sortDirections={TABLE_SORT_DIRECTIONS}
showSorterTooltip={false} showSorterTooltip={false}
tableLayout={dataSource.loadend ? 'auto' : 'fixed'} tableLayout={'auto'}
style={{ width: '100%' }}
dataSource={dataSource.dataList} dataSource={dataSource.dataList}
loading={dataSource.loading} loading={dataSource.loading}
rowKey="id" rowKey="id"
scroll={{ x: true }} scroll={{ x: 900 }}
onChange={handleTableChange} onChange={handleTableChange}
rowSelection={rowSelection} rowSelection={rowSelection}
pagination={{ pagination={{
@@ -31,6 +31,7 @@ const TextWrapper = styled.div`
align-items: center; align-items: center;
cursor: pointer; cursor: pointer;
height: 100%; height: 100%;
min-width: 32px;
`; `;
const PathWrapper = styled.div` const PathWrapper = styled.div`
@@ -267,9 +268,7 @@ const useFilesColumns = (props: {
title: intl.formatMessage({ id: 'models.form.source' }), title: intl.formatMessage({ id: 'models.form.source' }),
dataIndex: 'source', dataIndex: 'source',
sorter: tableSorter(1), sorter: tableSorter(1),
ellipsis: { minWidth: 32,
showTitle: false
},
render: (text: string, record: ListItem) => { render: (text: string, record: ListItem) => {
const modelInfo = getModelInfo(record); const modelInfo = getModelInfo(record);
const { source } = modelInfo; const { source } = modelInfo;
@@ -286,10 +285,7 @@ const useFilesColumns = (props: {
title: intl.formatMessage({ id: 'resources.worker' }), title: intl.formatMessage({ id: 'resources.worker' }),
dataIndex: 'worker_id', dataIndex: 'worker_id',
sorter: tableSorter(2), sorter: tableSorter(2),
width: '18%', minWidth: 32,
ellipsis: {
showTitle: false
},
render: (text: string, record: ListItem) => { render: (text: string, record: ListItem) => {
return ( return (
<AutoTooltip ghost> <AutoTooltip ghost>
@@ -51,6 +51,7 @@ const useGPUColumns = (props: {
title: intl.formatMessage({ id: 'common.table.name' }), title: intl.formatMessage({ id: 'common.table.name' }),
dataIndex: 'name', dataIndex: 'name',
width: 240, width: 240,
minWidth: 32,
sorter: tableSorter(1), sorter: tableSorter(1),
render: (text: string, record: GPUDeviceItem) => ( render: (text: string, record: GPUDeviceItem) => (
<AutoTooltip ghost maxWidth={240}> <AutoTooltip ghost maxWidth={240}>
@@ -68,9 +69,6 @@ const useGPUColumns = (props: {
title: intl.formatMessage({ id: 'clusters.title' }), title: intl.formatMessage({ id: 'clusters.title' }),
dataIndex: 'cluster_id', dataIndex: 'cluster_id',
sorter: tableSorter(3), sorter: tableSorter(3),
ellipsis: {
showTitle: false
},
render: (text: number, record: GPUDeviceItem) => ( render: (text: number, record: GPUDeviceItem) => (
<AutoTooltip ghost> <AutoTooltip ghost>
{clusterList.find((item) => item.value === text)?.label} {clusterList.find((item) => item.value === text)?.label}
@@ -81,9 +79,6 @@ const useGPUColumns = (props: {
title: intl.formatMessage({ id: 'resources.worker' }), title: intl.formatMessage({ id: 'resources.worker' }),
dataIndex: 'worker_name', dataIndex: 'worker_name',
sorter: tableSorter(4), sorter: tableSorter(4),
ellipsis: {
showTitle: false
},
render: (text: string, record: GPUDeviceItem) => ( render: (text: string, record: GPUDeviceItem) => (
<AutoTooltip ghost>{text}</AutoTooltip> <AutoTooltip ghost>{text}</AutoTooltip>
) )
@@ -279,7 +279,7 @@ const useWorkerColumns = ({
width: 100, width: 100,
sorter: tableSorter(1), sorter: tableSorter(1),
render: (text: string) => ( render: (text: string) => (
<AutoTooltip ghost maxWidth={240}> <AutoTooltip ghost maxWidth={200}>
{text} {text}
</AutoTooltip> </AutoTooltip>
) )