mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-08-10 04:48:43 +00:00
Omit the RESPONSE
tab and elapsedTime
if the response
is empty (#298)
* Omit the `RESPONSE` tab and `elapsedTime` if the `response` is empty * Use the `hidden` attribute instead
This commit is contained in:
parent
9212c195b4
commit
db1f7d34cf
@ -41,7 +41,7 @@ const EntryTitle: React.FC<any> = ({protocol, data, bodySize, elapsedTime}) => {
|
||||
<Protocol protocol={protocol} horizontal={true}/>
|
||||
<div style={{right: "30px", position: "absolute", display: "flex"}}>
|
||||
{response.payload && <div style={{margin: "0 18px", opacity: 0.5}}>{formatSize(bodySize)}</div>}
|
||||
<div style={{marginRight: 18, opacity: 0.5}}>{Math.round(elapsedTime)}ms</div>
|
||||
{response.payload && <div style={{marginRight: 18, opacity: 0.5}}>{Math.round(elapsedTime)}ms</div>}
|
||||
</div>
|
||||
</div>;
|
||||
};
|
||||
|
@ -54,6 +54,10 @@ const AutoRepresentation: React.FC<any> = ({representation, rulesMatched, elapse
|
||||
|
||||
const {request, response} = JSON.parse(representation);
|
||||
|
||||
if (!response) {
|
||||
TABS[1]['hidden'] = true;
|
||||
}
|
||||
|
||||
return <div className={styles.Entry}>
|
||||
{<div className={styles.body}>
|
||||
<div className={styles.bodyHeader}>
|
||||
@ -63,7 +67,7 @@ const AutoRepresentation: React.FC<any> = ({representation, rulesMatched, elapse
|
||||
{currentTab === TABS[0].tab && <React.Fragment>
|
||||
<SectionsRepresentation data={request} color={color}/>
|
||||
</React.Fragment>}
|
||||
{currentTab === TABS[1].tab && <React.Fragment>
|
||||
{response && currentTab === TABS[1].tab && <React.Fragment>
|
||||
<SectionsRepresentation data={response} color={color}/>
|
||||
</React.Fragment>}
|
||||
{currentTab === TABS[2].tab && <React.Fragment>
|
||||
|
Loading…
Reference in New Issue
Block a user