From 72a1aba3e526623b8adcd4ada4e4ffbc26ea2d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Mert=20Y=C4=B1ld=C4=B1ran?= Date: Fri, 8 Apr 2022 11:16:25 -0700 Subject: [PATCH] TRA-4410 Display `namespace` field in the UI (#974) --- tap/api/api.go | 2 +- .../components/TrafficViewer/EntryDetailed.tsx | 5 +++-- .../EntryListItem/EntryListItem.tsx | 16 +++++++++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/tap/api/api.go b/tap/api/api.go index 5b1e8c67a..a9e32f0ae 100644 --- a/tap/api/api.go +++ b/tap/api/api.go @@ -161,7 +161,7 @@ type Entry struct { Capture Capture `json:"capture"` Source *TCP `json:"src"` Destination *TCP `json:"dst"` - Namespace string `json:"namespace,omitempty"` + Namespace string `json:"namespace"` Outgoing bool `json:"outgoing"` Timestamp int64 `json:"timestamp"` StartTime time.Time `json:"startTime"` diff --git a/ui-common/src/components/TrafficViewer/EntryDetailed.tsx b/ui-common/src/components/TrafficViewer/EntryDetailed.tsx index c54dc6b24..a139e8209 100644 --- a/ui-common/src/components/TrafficViewer/EntryDetailed.tsx +++ b/ui-common/src/components/TrafficViewer/EntryDetailed.tsx @@ -89,12 +89,13 @@ const EntryTitle: React.FC = ({ protocol, data, elapsedTime }) => { ; }; -const EntrySummary: React.FC = ({ entry }) => { +const EntrySummary: React.FC = ({ entry, namespace }) => { return ; }; @@ -140,7 +141,7 @@ export const EntryDetailed = () => { data={entryData.data} elapsedTime={entryData.data.elapsedTime} />} - {!isLoading && entryData && } + {!isLoading && entryData && } {!isLoading && entryData && = ({entry, style, headingMode}) => { +export const EntryItem: React.FC = ({entry, style, headingMode, namespace}) => { const [focusedEntryId, setFocusedEntryId] = useRecoilState(focusedEntryIdAtom); const [queryState, setQuery] = useRecoilState(queryAtom); @@ -224,6 +225,19 @@ export const EntryItem: React.FC = ({entry, style, headingMode}) => : "" }
+ {headingMode ? + + {namespace} + + : null}