From 86c1f579add42b303e3954f097e70daa98a3c1cd Mon Sep 17 00:00:00 2001 From: lvyahui Date: Thu, 24 Oct 2024 23:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=BB=93=E6=9E=9C=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- viewer/src/TestCase.tsx | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/viewer/src/TestCase.tsx b/viewer/src/TestCase.tsx index 3bc59b4..67855b5 100644 --- a/viewer/src/TestCase.tsx +++ b/viewer/src/TestCase.tsx @@ -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) { @@ -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 ( <> @@ -84,7 +78,7 @@ const TestCase = () => { { item.res && ( <> - Graph:{item.res.gid} + Graph: onClick(e,item.res.gid)} target="_blank">{item.res.gid} Response: {item.res.resp}