aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/panels
diff options
context:
space:
mode:
authorEmiliano Ciavatta2020-10-20 20:04:09 +0000
committerEmiliano Ciavatta2020-10-20 20:04:09 +0000
commit7ecf3ef52b5f36ec9e52bf100fa958f5cb0b37b5 (patch)
tree2e21a8de93ca62bf4385b7f9fe5e0f95809815fa /frontend/src/components/panels
parente4b73c0c3ce2c8817ddd1b8cfaa672823b59a422 (diff)
Add comment dialog
Diffstat (limited to 'frontend/src/components/panels')
-rw-r--r--frontend/src/components/panels/ConnectionsPane.js2
-rw-r--r--frontend/src/components/panels/StreamsPane.js15
2 files changed, 9 insertions, 8 deletions
diff --git a/frontend/src/components/panels/ConnectionsPane.js b/frontend/src/components/panels/ConnectionsPane.js
index 6418b3e..708fc86 100644
--- a/frontend/src/components/panels/ConnectionsPane.js
+++ b/frontend/src/components/panels/ConnectionsPane.js
@@ -287,7 +287,7 @@ class ConnectionsPane extends Component {
return [<Connection key={c.id} data={c} onSelected={() => this.connectionSelected(c)}
selected={this.state.selected === c.id}
onMarked={(marked) => c.marked = marked}
- onEnabled={(enabled) => c.hidden = !enabled}
+ onCommented={(comment) => c.comment = comment}
services={this.state.services}/>,
c.matched_rules.length > 0 &&
<ConnectionMatchedRules key={c.id + "_m"} matchedRules={c.matched_rules}
diff --git a/frontend/src/components/panels/StreamsPane.js b/frontend/src/components/panels/StreamsPane.js
index 4c16cf1..29aff71 100644
--- a/frontend/src/components/panels/StreamsPane.js
+++ b/frontend/src/components/panels/StreamsPane.js
@@ -25,7 +25,7 @@ import rules from "../../model/rules";
import {downloadBlob, getHeaderValue} from "../../utils";
import ButtonField from "../fields/ButtonField";
import ChoiceField from "../fields/ChoiceField";
-import MessageAction from "../objects/MessageAction";
+import CopyDialog from "../dialogs/CopyDialog";
import "./StreamsPane.scss";
const reactStringReplace = require("react-string-replace");
@@ -105,10 +105,11 @@ class StreamsPane extends Component {
if (contentType && contentType.includes("application/json")) {
try {
const json = JSON.parse(m.body);
- body = <ReactJson src={json} theme="grayscale" collapsed={false} displayDataTypes={false}/>;
+ if (typeof json === "object") {
+ body = <ReactJson src={json} theme="grayscale" collapsed={false} displayDataTypes={false}/>;
+ }
} catch (e) {
log.error(e);
- body = m.body;
}
}
@@ -157,11 +158,11 @@ class StreamsPane extends Component {
if (!connectionMessage.metadata["reproducers"]) {
return;
}
- return Object.entries(connectionMessage.metadata["reproducers"]).map(([actionName, actionValue]) =>
- <ButtonField small key={actionName + "_button"} name={actionName} onClick={() => {
+ return Object.entries(connectionMessage.metadata["reproducers"]).map(([name, value]) =>
+ <ButtonField small key={name + "_button"} name={name} onClick={() => {
this.setState({
- messageActionDialog: <MessageAction actionName={actionName} actionValue={actionValue}
- onHide={() => this.setState({messageActionDialog: null})}/>
+ messageActionDialog: <CopyDialog actionName={name} value={value}
+ onHide={() => this.setState({messageActionDialog: null})}/>
});
}}/>
);