mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: network panel ui polish (#26722)
This commit is contained in:
parent
8348f66107
commit
ee86b9bc94
@ -93,5 +93,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.network-request .cm-wrapper {
|
.network-request .cm-wrapper {
|
||||||
max-height: 300px;
|
height: 300px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ export const NetworkResource: React.FunctionComponent<{
|
|||||||
}, [contentType, resource, resourceName, routeStatus]);
|
}, [contentType, resource, resourceName, routeStatus]);
|
||||||
|
|
||||||
return <div className='network-request'>
|
return <div className='network-request'>
|
||||||
<Expandable expanded={expanded} setExpanded={setExpanded} title={renderTitle()}>
|
<Expandable expanded={expanded} setExpanded={setExpanded} title={renderTitle()} expandOnTitleClick={true}>
|
||||||
{expanded && <NetworkResourceDetails resource={resource} />}
|
{expanded && <NetworkResourceDetails resource={resource} />}
|
||||||
</Expandable>
|
</Expandable>
|
||||||
</div>;
|
</div>;
|
||||||
@ -78,7 +78,6 @@ const NetworkResourceDetails: React.FunctionComponent<{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (resource.response.content._sha1) {
|
if (resource.response.content._sha1) {
|
||||||
const useBase64 = resource.response.content.mimeType.includes('image');
|
const useBase64 = resource.response.content.mimeType.includes('image');
|
||||||
const response = await fetch(`sha1/${resource.response.content._sha1}`);
|
const response = await fetch(`sha1/${resource.response.content._sha1}`);
|
||||||
|
|||||||
@ -21,13 +21,14 @@ export const Expandable: React.FunctionComponent<React.PropsWithChildren<{
|
|||||||
title: JSX.Element | string,
|
title: JSX.Element | string,
|
||||||
setExpanded: Function,
|
setExpanded: Function,
|
||||||
expanded: boolean,
|
expanded: boolean,
|
||||||
}>> = ({ title, children, setExpanded, expanded }) => {
|
expandOnTitleClick?: boolean,
|
||||||
|
}>> = ({ title, children, setExpanded, expanded, expandOnTitleClick }) => {
|
||||||
return <div className={'expandable' + (expanded ? ' expanded' : '')}>
|
return <div className={'expandable' + (expanded ? ' expanded' : '')}>
|
||||||
<div className='expandable-title'>
|
<div className='expandable-title' onClick={() => expandOnTitleClick && setExpanded(!expanded)}>
|
||||||
<div
|
<div
|
||||||
className={'codicon codicon-' + (expanded ? 'chevron-down' : 'chevron-right')}
|
className={'codicon codicon-' + (expanded ? 'chevron-down' : 'chevron-right')}
|
||||||
style={{ cursor: 'pointer', color: 'var(--vscode-foreground)', marginLeft: '5px' }}
|
style={{ cursor: 'pointer', color: 'var(--vscode-foreground)', marginLeft: '5px' }}
|
||||||
onClick={() => setExpanded(!expanded)} />
|
onClick={() => !expandOnTitleClick && setExpanded(!expanded)} />
|
||||||
{title}
|
{title}
|
||||||
</div>
|
</div>
|
||||||
{ expanded && <div style={{ marginLeft: 25 }}>{children}</div> }
|
{ expanded && <div style={{ marginLeft: 25 }}>{children}</div> }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user