Browse Source

fix: 运行参数脱敏时没有placeholder

pull/169/head
cp3hnu 1 year ago
parent
commit
22cf217a6b
6 changed files with 36 additions and 4 deletions
  1. +9
    -0
      react-ui/src/components/DisabledInput/index.less
  2. +20
    -0
      react-ui/src/components/DisabledInput/index.tsx
  3. +1
    -1
      react-ui/src/pages/Experiment/components/AddExperimentModal/index.tsx
  4. +2
    -2
      react-ui/src/pages/Experiment/components/ExperimentInstance/index.less
  5. +3
    -0
      react-ui/src/pages/Experiment/components/ExperimentInstance/index.tsx
  6. +1
    -1
      react-ui/src/pages/Experiment/index.jsx

+ 9
- 0
react-ui/src/components/DisabledInput/index.less View File

@@ -0,0 +1,9 @@
.disabled-input {
padding: 4px 11px;
color: rgba(0, 0, 0, 0.25);
font-size: @font-size-input;
background-color: rgba(0, 0, 0, 0.04);
border: 1px solid #d9d9d9;
border-radius: 6px;
cursor: not-allowed;
}

+ 20
- 0
react-ui/src/components/DisabledInput/index.tsx View File

@@ -0,0 +1,20 @@
import { Typography } from 'antd';
import styles from './index.less';

type DisabledInputProps = {
value?: any;
valuePropName?: string;
};

function DisabledInput({ value, valuePropName }: DisabledInputProps) {
const data = valuePropName ? value[valuePropName] : value;
return (
<div className={styles['disabled-input']}>
<Typography.Text ellipsis={{ tooltip: data }} style={{ color: 'inherit' }}>
{data}
</Typography.Text>
</div>
);
}

export default DisabledInput;

+ 1
- 1
react-ui/src/pages/Experiment/components/AddExperimentModal/index.tsx View File

@@ -41,7 +41,7 @@ export const getParamComponent = (paramType: number, isSensitive?: number): JSX.
); );
} }
if (isSensitive && Number(isSensitive) === 1) { if (isSensitive && Number(isSensitive) === 1) {
return <Input.Password visibilityToggle={false} allowClear />;
return <Input.Password placeholder="请输入值" visibilityToggle={false} allowClear />;
} }
return <Input placeholder="请输入值" allowClear />; return <Input placeholder="请输入值" allowClear />;
}; };


+ 2
- 2
react-ui/src/pages/Experiment/components/ExperimentInstance/index.less View File

@@ -33,7 +33,7 @@
} }


.status { .status {
width: 200px;
width: 160px;
} }


.operation { .operation {
@@ -54,7 +54,7 @@
.statusBox { .statusBox {
display: flex; display: flex;
align-items: center; align-items: center;
width: 200px;
width: 160px;


.statusIcon { .statusIcon {
visibility: visible; visibility: visible;


+ 3
- 0
react-ui/src/pages/Experiment/components/ExperimentInstance/index.tsx View File

@@ -161,6 +161,9 @@ function ExperimentInstanceComponent({
<Checkbox <Checkbox
checked={isSingleChecked(item.id)} checked={isSingleChecked(item.id)}
onChange={() => checkSingle(item.id)} onChange={() => checkSingle(item.id)}
disabled={
item.status === ExperimentStatus.Running || item.status === ExperimentStatus.Pending
}
></Checkbox> ></Checkbox>
</div> </div>
<a <a


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

@@ -406,7 +406,7 @@ function Experiment() {
title: '最近五次运行状态', title: '最近五次运行状态',
dataIndex: 'status_list', dataIndex: 'status_list',
key: 'status_list', key: 'status_list',
width: 200,
width: 160,
render: (text) => { render: (text) => {
const newText = text && text.replace(/\s+/g, '').split(','); const newText = text && text.replace(/\s+/g, '').split(',');
return ( return (


Loading…
Cancel
Save