diff options
author | Emiliano Ciavatta | 2020-12-25 14:31:30 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-12-25 14:31:30 +0000 |
commit | 4385727cf96868946759591935d1d2ca72cc7dbf (patch) | |
tree | 4f5d45f8a1a2b9885ac679d9eac21147e601e1fe /frontend/src/components/panels | |
parent | f8f3c91a8722e0cb5cc78f21ad163e8165ac5979 (diff) |
Fix payload visualization on metadata continuation
Diffstat (limited to 'frontend/src/components/panels')
-rw-r--r-- | frontend/src/components/panels/RulesPane.js | 2 | ||||
-rw-r--r-- | frontend/src/components/panels/StreamsPane.js | 16 |
2 files changed, 14 insertions, 4 deletions
diff --git a/frontend/src/components/panels/RulesPane.js b/frontend/src/components/panels/RulesPane.js index cdfe185..dd1765d 100644 --- a/frontend/src/components/panels/RulesPane.js +++ b/frontend/src/components/panels/RulesPane.js @@ -252,7 +252,7 @@ class RulesPane extends Component { this.reset(); this.setState({selectedRule: _.cloneDeep(r)}); }} className={classNames("row-small", "row-clickable", {"row-selected": rule.id === r.id})}> - <CopyLinkPopover text={r["id"].substring(0, 8)} value={r["id"]}/> + <td><CopyLinkPopover text={r["id"].substring(0, 8)} value={r["id"]}/></td> <td>{r["name"]}</td> <td><ButtonField name={r["color"]} color={r["color"]} small/></td> <td>{r["notes"]}</td> diff --git a/frontend/src/components/panels/StreamsPane.js b/frontend/src/components/panels/StreamsPane.js index 29aff71..8276949 100644 --- a/frontend/src/components/panels/StreamsPane.js +++ b/frontend/src/components/panels/StreamsPane.js @@ -78,6 +78,14 @@ class StreamsPane extends Component { } }; + viewAs = (mode) => { + if (mode === "decoded") { + this.setState({tryParse: true}); + } else if (mode === "raw") { + this.setState({tryParse: false}); + } + }; + tryParseConnectionMessage = (connectionMessage) => { const isClient = connectionMessage["from_client"]; if (connectionMessage.metadata == null) { @@ -212,7 +220,8 @@ class StreamsPane extends Component { }; const content = this.state.messages || []; - let payload = content.filter((c) => !c["is_metadata_continuation"]).map((c, i) => + let payload = content.filter((c) => !this.state.tryParse || (this.state.tryParse && !c["is_metadata_continuation"])) + .map((c, i) => <div key={`content-${i}`} className={classNames("connection-message", c["from_client"] ? "from-client" : "from-server")}> <div className="connection-message-header container-fluid"> @@ -244,9 +253,10 @@ class StreamsPane extends Component { <ChoiceField name="format" inline small onlyName keys={["default", "hex", "hexdump", "base32", "base64", "ascii", "binary", "decimal", "octal"]} values={["plain", "hex", "hexdump", "base32", "base64", "ascii", "binary", "decimal", "octal"]} - onChange={this.setFormat} value={this.state.value}/> + onChange={this.setFormat} /> - <ChoiceField name="view_as" inline small onlyName keys={["default"]} values={["default"]}/> + <ChoiceField name="view_as" inline small onlyName onChange={this.viewAs} + keys={["decoded", "raw"]} values={["decoded", "raw"]} /> <ChoiceField name="download_as" inline small onlyName onChange={this.downloadStreamRaw} keys={["nl_separated", "only_client", "only_server", "pwntools"]} |