Skip to content

Commit

Permalink
测试结果跳转
Browse files Browse the repository at this point in the history
  • Loading branch information
lvyahui8 committed Oct 24, 2024
1 parent fba67fc commit 86c1f57
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions viewer/src/TestCase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ const TestCase = () => {
"method" : "GET",
"body" : "",
},
{
"title" : "测试参数采集",
"url" : "http://localhost:8080/profile/1",
"method" : "GET",
"body" : "",
},
{
"title" : "测试参数采集",
"url" : "http://localhost:8080/profile/1",
"method" : "GET",
"body" : "",
},
])

const runTestCase = function (item,idx) {
Expand All @@ -63,12 +51,18 @@ const TestCase = () => {
console.log(resp.headers)
item.res = {
resp: JSON.stringify(resp.data),
gid: resp.headers['X-Ellyn-Gid'],
gid: resp.headers['x-ellyn-gid'],
}
setCases(cases.map(item=>item))
})
}

const onClick = (e, target) => {
console.log("click to " + target)
navigate('/traffic/query?id=' + target)
};


return (
<>
<Row gutter={[16,16]}>
Expand All @@ -84,7 +78,7 @@ const TestCase = () => {
{
item.res && (
<>
Graph:<Link href="https://ant.design" target="_blank">{item.res.gid}</Link>
Graph:<Link onClick={(e) => onClick(e,item.res.gid)} target="_blank">{item.res.gid}</Link>
Response:
<Text code>
{item.res.resp}
Expand Down

0 comments on commit 86c1f57

Please sign in to comment.