diff options
author | Emiliano Ciavatta | 2020-09-30 11:29:04 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-09-30 11:29:04 +0000 |
commit | 43135c255d82aa7c54ea83b14369c93425ae75f6 (patch) | |
tree | 34a0f4e80fde301c3c4905c180b4b18882428811 /frontend/src/views | |
parent | d994a21a0dfae9ee026e8aa3ccdee6c213c523aa (diff) |
Complete pcap page
Diffstat (limited to 'frontend/src/views')
-rw-r--r-- | frontend/src/views/Connections.js | 6 | ||||
-rw-r--r-- | frontend/src/views/MainPane.js | 2 |
2 files changed, 4 insertions, 4 deletions
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 { <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} - 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)); } |