Change the connection status text and the toggle connection behavior (#534)

This commit is contained in:
M. Mert Yıldıran 2021-12-16 11:42:17 +03:00 committed by GitHub
parent f266f32fea
commit b565492eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 8 deletions

View File

@ -298,7 +298,7 @@ export const EntryItem: React.FC<EntryProps> = ({entry, focusedEntryId, setFocus
flipped={false}
>
<span
title="Timestamp"
title="Timestamp (UTC)"
>
{Moment(+entry.timestamp)?.utc().format('MM/DD/YYYY, h:mm:ss.SSS A')}
</span>

View File

@ -225,13 +225,12 @@ export const TrafficPage: React.FC<TrafficPageProps> = ({setAnalyzeStatus, onTLS
}, [focusedEntryId]);
const toggleConnection = () => {
if (connection === ConnectionStatus.Connected) {
ws.current.close();
} else {
ws.current.close();
if (connection !== ConnectionStatus.Connected) {
if (query) {
openWebSocket(`(${query}) and leftOff(${leftOffBottom})`, false);
openWebSocket(`(${query}) and leftOff(-1)`, true);
} else {
openWebSocket(`leftOff(${leftOffBottom})`, false);
openWebSocket(`leftOff(-1)`, true);
}
}
}
@ -249,9 +248,9 @@ export const TrafficPage: React.FC<TrafficPageProps> = ({setAnalyzeStatus, onTLS
const getConnectionTitle = () => {
switch (connection) {
case ConnectionStatus.Connected:
return "connected, waiting for traffic"
return "streaming live traffic"
default:
return "not connected";
return "streaming paused";
}
}