Skip to content

Commit

Permalink
Merge pull request #102 from hlt1997/main
Browse files Browse the repository at this point in the history
Access measurement engine and traffic injection
  • Loading branch information
samson-samson authored Oct 26, 2023
2 parents 793e850 + b64735a commit 19eec17
Show file tree
Hide file tree
Showing 24 changed files with 1,009 additions and 393 deletions.
148 changes: 101 additions & 47 deletions chaosmeta-platform-frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions chaosmeta-platform-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
"@ant-design/pro-components": "^2.4.4",
"@dnd-kit/core": "^6.0.8",
"@dnd-kit/sortable": "^7.0.2",
"@types/react-syntax-highlighter": "^15.5.7",
"@umijs/max": "^4.0.72",
"antd": "^5.4.0",
"cronstrue": "^2.31.0",
"crypto-js": "^4.1.1",
"dayjs": "^1.11.10",
"echarts": "^5.4.3",
"react-ace": "^10.1.0",
"react-cookies": "^0.1.1",
"react-markdown": "^8.0.7",
"react-syntax-highlighter": "^15.5.0",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ interface IProps {
parentName?: string;
onChange?: any;
value?: string;
handleEditNode?: any;
}

const UnitInpt = (props: IProps) => {
const { field, form, parentName, onChange, value } = props;
const { field, form, parentName, onChange, value, handleEditNode } = props;
const [options, setOptions] = useState<any>([]);
const [curUnitValue, setCurUnitValue] = useState<string>('');

Expand All @@ -34,11 +35,8 @@ const UnitInpt = (props: IProps) => {
isBlur?: boolean;
}) => {
const unitValue = value || curUnitValue;
// 如果存在值, key为持续时长时不做处理
if (
form.getFieldValue(formatFormName(field, parentName)) &&
field.key !== 'duration'
) {
// 如果存在值
if (form.getFieldValue(formatFormName(field, parentName))) {
const inputValue = form.getFieldValue(formatFormName(field, parentName));
let newValue = inputValue;
// 找出原始单位
Expand All @@ -56,6 +54,9 @@ const UnitInpt = (props: IProps) => {
// 没有单位直接将填充值与新单位拼接
newValue = inputValue + unitValue;
}
if (field?.key === 'duration') {
handleEditNode('duration', newValue);
}
form.setFieldValue(formatFormName(field, parentName), newValue);
}
};
Expand Down
Loading

0 comments on commit 19eec17

Please sign in to comment.