-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
240 additions
and
58 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../NetworkDetails/HeaderView/HeaderList.tsx → ...rs/NetworkPanel/HeaderView/HeaderList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...Panel/NetworkDetails/HeaderView/index.tsx → ...tainers/NetworkPanel/HeaderView/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
25 changes: 25 additions & 0 deletions
25
src/containers/NetworkPanel/WebSocketNetworkDetails/MessageView.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { CodeView } from "../../../components/CodeView" | ||
import { WebSocketMessage } from "../../../hooks/useWebSocketNetworkMonitor" | ||
import { PanelSection, Panels } from "../PanelSection" | ||
|
||
interface MessageViewProps { | ||
messages: WebSocketMessage[] | ||
} | ||
|
||
const MessageView = (props: MessageViewProps) => { | ||
const { messages } = props | ||
|
||
return ( | ||
<Panels> | ||
{messages.map((message) => { | ||
return ( | ||
<PanelSection className="relative p-4"> | ||
<CodeView text={message.data} language={"json"} className="p-4" /> | ||
</PanelSection> | ||
) | ||
})} | ||
</Panels> | ||
) | ||
} | ||
|
||
export default MessageView |
50 changes: 50 additions & 0 deletions
50
src/containers/NetworkPanel/WebSocketNetworkDetails/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { CloseButton } from "../../../components/CloseButton" | ||
import { Tabs } from "../../../components/Tabs" | ||
import { useNetworkTabs } from "../../../hooks/useNetworkTabs" | ||
import { WebSocketNetworkRequest } from "../../../hooks/useWebSocketNetworkMonitor" | ||
import { HeaderView } from "../HeaderView" | ||
import MessageView from "./MessageView" | ||
|
||
interface WebSocketNetworkDetailsProps { | ||
data: WebSocketNetworkRequest | ||
onClose: () => void | ||
} | ||
|
||
const WebSocketNetworkDetails = (props: WebSocketNetworkDetailsProps) => { | ||
const { data, onClose } = props | ||
const { activeTab, setActiveTab } = useNetworkTabs() | ||
const requestHeaders = data.request.headers | ||
const responseHeaders = data.response?.headers || [] | ||
|
||
return ( | ||
<Tabs | ||
testId="websocket-network-tabs" | ||
activeTab={activeTab} | ||
onTabClick={setActiveTab} | ||
leftContent={ | ||
<div className="flex mr-1 h-full"> | ||
<CloseButton onClick={onClose} testId="close-side-panel" /> | ||
</div> | ||
} | ||
tabs={[ | ||
{ | ||
id: "headers", | ||
title: "Headers", | ||
component: ( | ||
<HeaderView | ||
requestHeaders={requestHeaders} | ||
responseHeaders={responseHeaders} | ||
/> | ||
), | ||
}, | ||
{ | ||
id: "messages", | ||
title: "Messages", | ||
component: <MessageView messages={data.messages} />, | ||
}, | ||
]} | ||
/> | ||
) | ||
} | ||
|
||
export default WebSocketNetworkDetails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.