aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/components/panels
diff options
context:
space:
mode:
authorEmiliano Ciavatta2020-10-15 11:50:37 +0000
committerEmiliano Ciavatta2020-10-15 11:50:37 +0000
commitc745263e1b28e4cedffa88de764f11d6379d745d (patch)
tree1126959456f7a051118c518aec5d9afb96d0494b /frontend/src/components/panels
parent97b0ee38fcf1e78e66dfe2a2816c95c3c3b10705 (diff)
Update rules filters
Diffstat (limited to 'frontend/src/components/panels')
-rw-r--r--frontend/src/components/panels/PcapsPane.js6
-rw-r--r--frontend/src/components/panels/SearchPane.js14
-rw-r--r--frontend/src/components/panels/StreamsPane.js2
3 files changed, 11 insertions, 11 deletions
diff --git a/frontend/src/components/panels/PcapsPane.js b/frontend/src/components/panels/PcapsPane.js
index 8722230..900aacc 100644
--- a/frontend/src/components/panels/PcapsPane.js
+++ b/frontend/src/components/panels/PcapsPane.js
@@ -131,7 +131,7 @@ class PcapsPane extends Component {
render() {
let sessions = this.state.sessions.map(s =>
- <tr key={s.id} className="table-row">
+ <tr key={s.id} className="row-small row-clickable">
<td>{s["id"].substring(0, 8)}</td>
<td>{dateTimeToTime(s["started_at"])}</td>
<td>{durationBetween(s["started_at"], s["completed_at"])}</td>
@@ -166,13 +166,13 @@ class PcapsPane extends Component {
});
};
- const uploadCurlCommand = createCurlCommand("pcap/upload", "POST", null, {
+ const uploadCurlCommand = createCurlCommand("/pcap/upload", "POST", null, {
file: "@" + ((this.state.uploadSelectedFile != null && this.state.isUploadFileValid) ?
this.state.uploadSelectedFile.name : "invalid.pcap"),
flush_all: this.state.uploadFlushAll
});
- const fileCurlCommand = createCurlCommand("pcap/file", "POST", {
+ const fileCurlCommand = createCurlCommand("/pcap/file", "POST", {
file: this.state.fileValue,
flush_all: this.state.processFlushAll,
delete_original_file: this.state.deleteOriginalFile
diff --git a/frontend/src/components/panels/SearchPane.js b/frontend/src/components/panels/SearchPane.js
index 21ba139..1fb48ef 100644
--- a/frontend/src/components/panels/SearchPane.js
+++ b/frontend/src/components/panels/SearchPane.js
@@ -29,7 +29,6 @@ import dispatcher from "../../dispatcher";
import TagField from "../fields/TagField";
import CheckField from "../fields/CheckField";
-const classNames = require('classnames');
const _ = require('lodash');
class SearchPane extends Component {
@@ -161,7 +160,7 @@ class SearchPane extends Component {
const options = this.state.currentSearchOptions;
let searches = this.state.searches.map(s =>
- <tr key={s.id} className={classNames("row-small", "row-clickable", {"row-selected": false})}>
+ <tr key={s.id} className="row-small row-clickable">
<td>{s.id.substring(0, 8)}</td>
<td>{this.extractPattern(s["search_options"])}</td>
<td>{s["affected_connections_count"]}</td>
@@ -223,13 +222,14 @@ class SearchPane extends Component {
<div className="content-row">
<div className="text-search">
- <TagField tags={options.text_search.terms || []} name="terms" min={3} inline
+ <TagField tags={(options.text_search.terms || []).map(t => {return {name: t};})}
+ name="terms" min={3} inline allowNew={true}
readonly={regexOptionsModified || options.text_search.exact_phrase}
- onChange={(tags) => this.updateParam(s => s.text_search.terms = tags)}/>
- <TagField tags={options.text_search.excluded_terms || []} inline
- name="excluded_terms" min={3}
+ onChange={(tags) => this.updateParam(s => s.text_search.terms = tags.map(t => t.name))}/>
+ <TagField tags={(options.text_search.excluded_terms || []).map(t => {return {name: t};})}
+ name="excluded_terms" min={3} inline allowNew={true}
readonly={regexOptionsModified || options.text_search.exact_phrase}
- onChange={(tags) => this.updateParam(s => s.text_search.excluded_terms = tags)}/>
+ onChange={(tags) => this.updateParam(s => s.text_search.excluded_terms = tags.map(t => t.name))}/>
<span className="exclusive-separator">or</span>
diff --git a/frontend/src/components/panels/StreamsPane.js b/frontend/src/components/panels/StreamsPane.js
index 1aa5c53..be39777 100644
--- a/frontend/src/components/panels/StreamsPane.js
+++ b/frontend/src/components/panels/StreamsPane.js
@@ -65,7 +65,7 @@ class StreamsPane extends Component {
}
loadStream = (connectionId) => {
- this.setState({messages: []});
+ this.setState({messages: [], currentId: connectionId});
backend.get(`/api/streams/${connectionId}?format=${this.state.format}`)
.then(res => this.setState({messages: res.json}));
};