Browse Source

fix: 修复流水线模版描述很长的问题

pull/49/head
cp3hnu 1 year ago
parent
commit
b138b3f241
5 changed files with 17 additions and 7 deletions
  1. +5
    -1
      react-ui/src/components/CommonTableCell/index.tsx
  2. +4
    -3
      react-ui/src/components/ParameterInput/index.tsx
  3. +3
    -0
      react-ui/src/pages/Experiment/index.jsx
  4. +1
    -1
      react-ui/src/pages/Pipeline/components/ResourceSelectorModal/index.tsx
  5. +4
    -2
      react-ui/src/pages/Pipeline/index.jsx

+ 5
- 1
react-ui/src/components/CommonTableCell/index.tsx View File

@@ -12,7 +12,11 @@ function renderCell(text?: string | null) {


function CommonTableCell(ellipsis: boolean = false) { function CommonTableCell(ellipsis: boolean = false) {
if (ellipsis) { if (ellipsis) {
return (text?: string | null) => <Tooltip title={text}>{renderCell(text)}</Tooltip>;
return (text?: string | null) => (
<Tooltip title={text} placement="topLeft" overlayStyle={{ maxWidth: '400px' }}>
{renderCell(text)}
</Tooltip>
);
} else { } else {
return renderCell; return renderCell;
} }


+ 4
- 3
react-ui/src/components/ParameterInput/index.tsx View File

@@ -64,14 +64,15 @@ function ParameterInput({
<span className="parameter-input__content__value">{valueObj?.showValue}</span> <span className="parameter-input__content__value">{valueObj?.showValue}</span>
<CloseOutlined <CloseOutlined
className="parameter-input__content__close-icon" className="parameter-input__content__close-icon"
onClick={() =>
onClick={(e) => {
e.stopPropagation();
onChange?.({ onChange?.({
...valueObj, ...valueObj,
fromSelect: false, fromSelect: false,
value: undefined, value: undefined,
showValue: undefined, showValue: undefined,
})
}
});
}}
/> />
</div> </div>
) : ( ) : (


+ 3
- 0
react-ui/src/pages/Experiment/index.jsx View File

@@ -1,3 +1,4 @@
import CommonTableCell from '@/components/CommonTableCell';
import KFIcon from '@/components/KFIcon'; import KFIcon from '@/components/KFIcon';
import { import {
deleteExperimentById, deleteExperimentById,
@@ -290,6 +291,8 @@ function Experiment() {
title: '实验描述', title: '实验描述',
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
render: CommonTableCell(true),
ellipsis: { showTitle: false },
}, },
{ {
title: '最近五次运行状态', title: '最近五次运行状态',


+ 1
- 1
react-ui/src/pages/Pipeline/components/ResourceSelectorModal/index.tsx View File

@@ -13,7 +13,7 @@ import { Input, Tabs, Tree } from 'antd';
import React, { useEffect, useMemo, useRef, useState } from 'react'; import React, { useEffect, useMemo, useRef, useState } from 'react';
import { MirrorVersion, ResourceSelectorType, selectorTypeConfig } from './config'; import { MirrorVersion, ResourceSelectorType, selectorTypeConfig } from './config';
import styles from './index.less'; import styles from './index.less';
export { ResourceSelectorType, selectorTypeConfig } from './config';
export { ResourceSelectorType, selectorTypeConfig };


// 选择数据集和模型的返回类型 // 选择数据集和模型的返回类型
export type ResourceSelectorResponse = { export type ResourceSelectorResponse = {


+ 4
- 2
react-ui/src/pages/Pipeline/index.jsx View File

@@ -1,3 +1,4 @@
import CommonTableCell from '@/components/CommonTableCell';
import DateTableCell from '@/components/DateTableCell'; import DateTableCell from '@/components/DateTableCell';
import KFIcon from '@/components/KFIcon'; import KFIcon from '@/components/KFIcon';
import KFModal from '@/components/KFModal'; import KFModal from '@/components/KFModal';
@@ -119,9 +120,8 @@ const Pipeline = () => {
width: 120, width: 120,
align: 'center', align: 'center',
render(text, record, index) { render(text, record, index) {
return <span>{(pageOption.current.page - 1) * 10 + index + 1}</span>;
return <span>{(pageOption.current.page - 1) * pageOption.current.size + index + 1}</span>;
}, },
// render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
}, },
{ {
title: '流水线名称', title: '流水线名称',
@@ -133,6 +133,8 @@ const Pipeline = () => {
title: '流水线描述', title: '流水线描述',
dataIndex: 'description', dataIndex: 'description',
key: 'description', key: 'description',
render: CommonTableCell(true),
ellipsis: { showTitle: false },
}, },
{ {
title: '创建时间', title: '创建时间',


Loading…
Cancel
Save