MCPcopy
hub / github.com/mitmproxy/mitmproxy / tabsForFlow

Function tabsForFlow

web/src/js/components/FlowView.tsx:41–65  ·  view source on GitHub ↗
(flow: Flow)

Source from the content-addressed store, hash-verified

39};
40
41export function tabsForFlow(flow: Flow): string[] {
42 let tabs;
43 switch (flow.type) {
44 case "http":
45 tabs = ["request", "response", "websocket"].filter((k) => flow[k]);
46 break;
47 case "tcp":
48 tabs = ["tcpmessages"];
49 break;
50 case "udp":
51 tabs = ["udpmessages"];
52 break;
53 case "dns":
54 tabs = ["request", "response"]
55 .filter((k) => flow[k])
56 .map((s) => "dns" + s);
57 break;
58 }
59
60 if (flow.error) tabs.push("error");
61 tabs.push("connection");
62 tabs.push("timing");
63 tabs.push("comment");
64 return tabs;
65}
66
67export default function FlowView() {
68 const dispatch = useAppDispatch();

Callers 2

onKeyDownFunction · 0.90
FlowViewFunction · 0.85

Calls 3

filterMethod · 0.45
mapMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…