show Query String Parameters

addon-dailer
lqqyt2423 3 years ago
parent b269bb9dd8
commit b2ba27f4c4

@ -62,6 +62,14 @@ class ViewFlow extends React.Component<Iprops, IState> {
const request = flow.request const request = flow.request
const response: IResponse = (flow.response || {}) as any const response: IResponse = (flow.response || {}) as any
// Query String Parameters
const searchItems: Array<{ key: string; value: string }> = []
if (flow.url && flow.url.search) {
flow.url.searchParams.forEach((value, key) => {
searchItems.push({ key, value })
})
}
return ( return (
<div className="flow-detail"> <div className="flow-detail">
<div className="header-tabs"> <div className="header-tabs">
@ -159,6 +167,22 @@ class ViewFlow extends React.Component<Iprops, IState> {
</div> </div>
</div> </div>
{
!(searchItems.length) ? null :
<div className="header-block">
<p>Query String Parameters</p>
<div className="header-block-content">
{
searchItems.map(({ key, value }) => {
return (
<p key={key}>{key}: {value}</p>
)
})
}
</div>
</div>
}
{ {
!(request.body && request.body.byteLength) ? null : !(request.body && request.body.byteLength) ? null :
<div className="header-block"> <div className="header-block">

@ -55,7 +55,7 @@ export class Flow {
public request: IRequest public request: IRequest
public response: IResponse | null = null public response: IResponse | null = null
private url: URL public url: URL
private path: string private path: string
private _size = 0 private _size = 0
private size = '0' private size = '0'

Loading…
Cancel
Save