Skip to content

Commit

Permalink
feat: repair of experimental results details
Browse files Browse the repository at this point in the history
  • Loading branch information
hlt01362665 committed Aug 30, 2023
1 parent a578dd8 commit 20bbc00
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export default () => {
},
);
const spaceId = history.location.query.spaceId;
console.log(spaceId, 'spaceId---')
// 初始化加载时,页面不存在空间id需要添加默认空间id
if (!spaceId) {
handleUpdateSpaceId(namespaceList[0]?.id, namespaceList[0]?.name);
Expand Down
2 changes: 1 addition & 1 deletion chaosmeta-platform-frontend/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const tagColors = [
export const arrangeNodeTypeColors: any = {
fault: '#F5E2CC',
measure: '#C6F8E0',
pressure: '#FFD5D5',
flow: '#FFD5D5',
other: '#D4E3F1',
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,12 @@ const Arrange: React.FC<IProps> = (props) => {
type: 'fault',
},
{
name: '度量节点',
name: '度量引擎',
type: 'measure',
},
{
name: '压测节点',
type: 'pressure',
name: '流量注入',
type: 'flow',
},
{
name: '其他节点',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { LightArea } from '@/components/CommonStyle';
import { InfoCircleOutlined } from '@ant-design/icons';
import { Col, Row, Tag } from 'antd';
import React, { useState } from 'react';
import { RecommendContainer } from './style';
import Thumbnail from './Thumbnail';
import { RecommendContainer } from './style';
/**
* 推荐实验
* @returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const ArrangeInfoShow: React.FC<IProps> = (props) => {
const [activeCol, setActiveCol] = useState<any>({ state: false });
const [fieldList, setFieldList] = useState<any[]>([]);
const [configForm] = Form.useForm();

/**
* 故障节点 - 查询节点表单配置信息
*/
Expand All @@ -52,12 +53,12 @@ const ArrangeInfoShow: React.FC<IProps> = (props) => {
type: 'fault',
},
{
name: '度量节点',
name: '度量引擎',
type: 'measure',
},
{
name: '压测节点',
type: 'pressure',
name: '流量注入',
type: 'flow',
},
{
name: '其他节点',
Expand Down Expand Up @@ -137,9 +138,17 @@ const ArrangeInfoShow: React.FC<IProps> = (props) => {
curNodeDetail.args_value = newArgs;
}
// 为配置信息赋值
configForm.setFieldsValue(curNodeDetail);
configForm.setFieldsValue({
...curNodeDetail,
exec_range: {
...curNodeDetail?.subtasks,
},
});
setActiveCol({
...curNodeDetail,
exec_range: {
...curNodeDetail?.subtasks,
},
});
}
});
Expand Down Expand Up @@ -326,27 +335,27 @@ const ArrangeInfoShow: React.FC<IProps> = (props) => {
>
<ShowText ellipsis />
</Form.Item>
<Form.Item label="应用" name={['exec_range', 'target_app']}>
{/* <Form.Item label="应用" name={['exec_range', 'target_app']}>
<ShowText ellipsis />
</Form.Item>
</Form.Item> */}
<Form.Item
label="name"
name={['exec_range', 'target_name']}
>
<ShowText ellipsis />
</Form.Item>
<Form.Item
label="Kubernetes Ip"
name={['exec_range', 'target_ip']}
>
<ShowText ellipsis />
</Form.Item>
<Form.Item
label="Kubernetes Hostname"
{activeCol?.scope_id === 2 && (
<Form.Item label="Ip" name={['exec_range', 'target_ip']}>
<ShowText ellipsis />
</Form.Item>
)}

{/* <Form.Item
label="Hostname"
name={['exec_range', 'target_hostname']}
>
<ShowText ellipsis />
</Form.Item>
</Form.Item> */}
</>
)}
</Form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ const AddExperiment = () => {
const headerExtra = () => {
return (
<Space>
<Button>查看实验配置</Button>
{/* <Button>查看实验配置</Button> */}
{resultDetail?.status === 'Running' && (
<Button
type="primary"
Expand Down Expand Up @@ -539,14 +539,14 @@ const AddExperiment = () => {
}
style={{ marginBottom: '16px' }}
type={handleMateStatus()?.type}
action={
(resultDetail?.status === 'error' ||
resultDetail?.status === 'Failed') && (
<Button type="link" onClick={() => {}}>
查看详情
</Button>
)
}
// action={
// (resultDetail?.status === 'error' ||
// resultDetail?.status === 'Failed') && (
// <Button type="link" onClick={() => {}}>
// 查看详情
// </Button>
// )
// }
showIcon
/>
)}
Expand Down

0 comments on commit 20bbc00

Please sign in to comment.