mirror of
https://github.com/microsoft/playwright.git
synced 2024-09-11 20:37:54 +03:00
feat(trace-viewer): add request method/status to the network details tab (#31274)
This commit is contained in:
parent
6d38525119
commit
ee63843f7d
@ -39,6 +39,11 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.network-request-details-general {
|
||||
white-space: pre;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.network-request-details-tab .cm-wrapper {
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -52,7 +57,7 @@
|
||||
.tab-network .toolbar::after {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
|
||||
.tab-network .tabbed-pane-tab.selected {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
@ -77,8 +77,14 @@ const RequestTab: React.FunctionComponent<{
|
||||
}, [resource]);
|
||||
|
||||
return <div className='network-request-details-tab'>
|
||||
<div className='network-request-details-header'>URL</div>
|
||||
<div className='network-request-details-url'>{resource.request.url}</div>
|
||||
<div className='network-request-details-header'>General</div>
|
||||
<div className='network-request-details-url'>{`URL: ${resource.request.url}`}</div>
|
||||
<div className='network-request-details-general'>{`Method: ${resource.request.method}`}</div>
|
||||
<div className='network-request-details-general'>{`Status Code: ${
|
||||
resource.response.status >= 200 && resource.response.status < 400
|
||||
? `🟢 ${resource.response.status} ${resource.response.statusText}`
|
||||
: `🔴 ${resource.response.status} ${resource.response.statusText}`
|
||||
}`}</div>
|
||||
<div className='network-request-details-header'>Request Headers</div>
|
||||
<div className='network-request-details-headers'>{resource.request.headers.map(pair => `${pair.name}: ${pair.value}`).join('\n')}</div>
|
||||
{requestBody && <div className='network-request-details-header'>Request Body</div>}
|
||||
|
Loading…
Reference in New Issue
Block a user