From 43135c255d82aa7c54ea83b14369c93425ae75f6 Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Wed, 30 Sep 2020 13:29:04 +0200 Subject: Complete pcap page --- frontend/src/views/Connections.js | 6 +++--- frontend/src/views/MainPane.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'frontend/src/views') diff --git a/frontend/src/views/Connections.js b/frontend/src/views/Connections.js index 64068c5..9dca7e9 100644 --- a/frontend/src/views/Connections.js +++ b/frontend/src/views/Connections.js @@ -75,7 +75,7 @@ class Connections extends Component { } this.setState({loading: true, prevParams: params}); - let res = (await backend.getJson(`${url}?${urlParams}`)).json; + let res = (await backend.get(`${url}?${urlParams}`)).json; let connections = this.state.connections; let firstConnection = this.state.firstConnection; @@ -115,7 +115,7 @@ class Connections extends Component { let flagRule = this.state.flagRule; let rules = this.state.rules; if (flagRule === null) { - rules = (await backend.getJson("/api/rules")).json; + rules = (await backend.get("/api/rules")).json; flagRule = rules.filter(rule => { return rule.name === "flag"; })[0]; @@ -170,7 +170,7 @@ class Connections extends Component { this.connectionSelected(c)} selected={this.state.selected === c.id} onMarked={marked => c.marked = marked} onEnabled={enabled => c.hidden = !enabled} - containsFlag={c.matched_rules.includes(this.state.flagRule.id)} + containsFlag={this.state.flagRule && c.matched_rules.includes(this.state.flagRule.id)} addServicePortFilter={this.addServicePortFilter}/> ) } diff --git a/frontend/src/views/MainPane.js b/frontend/src/views/MainPane.js index 6f4e3cd..b9ebadb 100644 --- a/frontend/src/views/MainPane.js +++ b/frontend/src/views/MainPane.js @@ -21,7 +21,7 @@ class MainPane extends Component { const match = this.props.location.pathname.match(/^\/connections\/([a-f0-9]{24})$/); if (match != null) { this.setState({loading: true}); - backend.getJson(`/api/connections/${match[1]}`) + backend.get(`/api/connections/${match[1]}`) .then(res => this.setState({selectedConnection: res.json, loading: false})) .catch(error => console.log(error)); } -- cgit v1.2.3-70-g09d2