From b565492eba6163aa6f6097f5826c4afe13edca9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Thu, 16 Dec 2021 11:42:17 +0300 Subject: [PATCH] Change the connection status text and the toggle connection behavior (#534) --- ui/src/components/EntryListItem/EntryListItem.tsx | 2 +- ui/src/components/TrafficPage.tsx | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/ui/src/components/EntryListItem/EntryListItem.tsx b/ui/src/components/EntryListItem/EntryListItem.tsx index 60c0f5db5..d88575250 100644 --- a/ui/src/components/EntryListItem/EntryListItem.tsx +++ b/ui/src/components/EntryListItem/EntryListItem.tsx @@ -298,7 +298,7 @@ export const EntryItem: React.FC = ({entry, focusedEntryId, setFocus flipped={false} > {Moment(+entry.timestamp)?.utc().format('MM/DD/YYYY, h:mm:ss.SSS A')} diff --git a/ui/src/components/TrafficPage.tsx b/ui/src/components/TrafficPage.tsx index f9264588d..7d4075e01 100644 --- a/ui/src/components/TrafficPage.tsx +++ b/ui/src/components/TrafficPage.tsx @@ -225,13 +225,12 @@ export const TrafficPage: React.FC = ({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 = ({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"; } }