diff options
Diffstat (limited to 'frontend/src/components/panels')
-rw-r--r-- | frontend/src/components/panels/ConfigPane.js | 39 | ||||
-rw-r--r-- | frontend/src/components/panels/ConnectionsPane.js | 2 | ||||
-rw-r--r-- | frontend/src/components/panels/StreamsPane.js | 15 |
3 files changed, 48 insertions, 8 deletions
diff --git a/frontend/src/components/panels/ConfigPane.js b/frontend/src/components/panels/ConfigPane.js new file mode 100644 index 0000000..9710abd --- /dev/null +++ b/frontend/src/components/panels/ConfigPane.js @@ -0,0 +1,39 @@ +/* + * This file is part of caronte (https://github.com/eciavatta/caronte). + * Copyright (c) 2020 Emiliano Ciavatta. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 3. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +import React, {Component} from "react"; +import "./common.scss"; + +class ConfigPane extends Component { + + state = {}; + + render() { + return ( + <div className="pane-container"> + <div className="main-pane"> + <div className="pane-section"> + Not implemented + </div> + </div> + </div> + ); + } + +} + +export default ConfigPane; 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})}/> }); }}/> ); |