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} flipped={false}
> >
<span <span
title="Timestamp" title="Timestamp (UTC)"
> >
{Moment(+entry.timestamp)?.utc().format('MM/DD/YYYY, h:mm:ss.SSS A')} {Moment(+entry.timestamp)?.utc().format('MM/DD/YYYY, h:mm:ss.SSS A')}
</span> </span>

View File

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