+ error={null}/>
pick
diff --git a/frontend/src/components/fields/extensions/NumericField.js b/frontend/src/components/fields/extensions/NumericField.js
index d4d027d..a6cba26 100644
--- a/frontend/src/components/fields/extensions/NumericField.js
+++ b/frontend/src/components/fields/extensions/NumericField.js
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import InputField from "../InputField";
class NumericField extends Component {
@@ -35,7 +35,7 @@ class NumericField extends Component {
}
onChange = (value) => {
- value = value.toString().replace(/[^\d]/gi, '');
+ value = value.toString().replace(/[^\d]/gi, "");
let intValue = 0;
if (value !== "") {
intValue = parseInt(value, 10);
@@ -53,7 +53,7 @@ class NumericField extends Component {
render() {
return (
+ invalid={this.state.invalid}/>
);
}
diff --git a/frontend/src/components/filters/AdvancedFilters.js b/frontend/src/components/filters/AdvancedFilters.js
index f5ba825..2b479ed 100644
--- a/frontend/src/components/filters/AdvancedFilters.js
+++ b/frontend/src/components/filters/AdvancedFilters.js
@@ -15,11 +15,11 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import {withRouter} from "react-router-dom";
import dispatcher from "../../dispatcher";
-import ButtonField from "../fields/ButtonField";
import {updateParams} from "../../utils";
+import ButtonField from "../fields/ButtonField";
class AdvancedFilters extends Component {
diff --git a/frontend/src/components/filters/BooleanConnectionsFilter.js b/frontend/src/components/filters/BooleanConnectionsFilter.js
index 9558323..0355167 100644
--- a/frontend/src/components/filters/BooleanConnectionsFilter.js
+++ b/frontend/src/components/filters/BooleanConnectionsFilter.js
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import {withRouter} from "react-router-dom";
-import CheckField from "../fields/CheckField";
import dispatcher from "../../dispatcher";
+import CheckField from "../fields/CheckField";
class BooleanConnectionsFilter extends Component {
@@ -30,7 +30,7 @@ class BooleanConnectionsFilter extends Component {
let params = new URLSearchParams(this.props.location.search);
this.setState({filterActive: this.toBoolean(params.get(this.props.filterName)).toString()});
- this.connectionsFiltersCallback = payload => {
+ this.connectionsFiltersCallback = (payload) => {
const name = this.props.filterName;
if (name in payload && this.state.filterActive !== payload[name]) {
this.setState({filterActive: payload[name]});
diff --git a/frontend/src/components/filters/ExitSearchFilter.js b/frontend/src/components/filters/ExitSearchFilter.js
index 68ca686..72cfb0c 100644
--- a/frontend/src/components/filters/ExitSearchFilter.js
+++ b/frontend/src/components/filters/ExitSearchFilter.js
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import {withRouter} from "react-router-dom";
-import CheckField from "../fields/CheckField";
import dispatcher from "../../dispatcher";
+import CheckField from "../fields/CheckField";
class ExitSearchFilter extends Component {
diff --git a/frontend/src/components/filters/RulesConnectionsFilter.js b/frontend/src/components/filters/RulesConnectionsFilter.js
index 8e40d30..86eae7e 100644
--- a/frontend/src/components/filters/RulesConnectionsFilter.js
+++ b/frontend/src/components/filters/RulesConnectionsFilter.js
@@ -15,14 +15,14 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import {withRouter} from "react-router-dom";
import backend from "../../backend";
import dispatcher from "../../dispatcher";
import TagField from "../fields/TagField";
-const classNames = require('classnames');
-const _ = require('lodash');
+const classNames = require("classnames");
+const _ = require("lodash");
class RulesConnectionsFilter extends Component {
diff --git a/frontend/src/components/filters/StringConnectionsFilter.js b/frontend/src/components/filters/StringConnectionsFilter.js
index 18b3784..c3c5925 100644
--- a/frontend/src/components/filters/StringConnectionsFilter.js
+++ b/frontend/src/components/filters/StringConnectionsFilter.js
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
+import React, {Component} from "react";
import {withRouter} from "react-router-dom";
-import InputField from "../fields/InputField";
import dispatcher from "../../dispatcher";
+import InputField from "../fields/InputField";
class StringConnectionsFilter extends Component {
@@ -56,15 +56,9 @@ class StringConnectionsFilter extends Component {
fieldValue = this.props.replaceFunc(fieldValue);
}
if (this.isValueValid(fieldValue)) {
- this.setState({
- fieldValue: fieldValue,
- filterValue: filterValue
- });
+ this.setState({fieldValue, filterValue: filterValue});
} else {
- this.setState({
- fieldValue: fieldValue,
- invalidValue: true
- });
+ this.setState({fieldValue, invalidValue: true});
}
} else {
this.setState({fieldValue: "", filterValue: null});
@@ -97,7 +91,6 @@ class StringConnectionsFilter extends Component {
}
-
if (this.isValueValid(fieldValue)) {
let filterValue = fieldValue;
if (filterValue !== "" && typeof this.props.encodeFunc === "function") {
@@ -113,10 +106,7 @@ class StringConnectionsFilter extends Component {
invalidValue: false
});
} else {
- this.setState({
- fieldValue: fieldValue,
- invalidValue: true
- });
+ this.setState({fieldValue, invalidValue: true});
}
};
diff --git a/frontend/src/components/objects/Connection.js b/frontend/src/components/objects/Connection.js
index 96f2235..f838606 100644
--- a/frontend/src/components/objects/Connection.js
+++ b/frontend/src/components/objects/Connection.js
@@ -15,17 +15,17 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
-import './Connection.scss';
+import React, {Component} from "react";
import {Form} from "react-bootstrap";
import backend from "../../backend";
+import dispatcher from "../../dispatcher";
import {dateTimeToTime, durationBetween, formatSize} from "../../utils";
import ButtonField from "../fields/ButtonField";
-import LinkPopover from "./LinkPopover";
import TextField from "../fields/TextField";
-import dispatcher from "../../dispatcher";
+import "./Connection.scss";
+import LinkPopover from "./LinkPopover";
-const classNames = require('classnames');
+const classNames = require("classnames");
class Connection extends Component {
@@ -59,7 +59,7 @@ class Connection extends Component {
}
if (name === "copy") {
this.copyTextarea.current.select();
- document.execCommand('copy');
+ document.execCommand("copy");
this.setState({copiedMessage: true});
setTimeout(() => this.setState({copiedMessage: false}), 3000);
}
diff --git a/frontend/src/components/objects/LinkPopover.js b/frontend/src/components/objects/LinkPopover.js
index 3c5bf67..551a819 100644
--- a/frontend/src/components/objects/LinkPopover.js
+++ b/frontend/src/components/objects/LinkPopover.js
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
-import {randomClassName} from "../../utils";
+import React, {Component} from "react";
import {OverlayTrigger, Popover} from "react-bootstrap";
-import './LinkPopover.scss';
+import {randomClassName} from "../../utils";
+import "./LinkPopover.scss";
class LinkPopover extends Component {
@@ -39,10 +39,11 @@ class LinkPopover extends Component {
);
return (this.props.content ?
-
- {this.props.text}
- :
- {this.props.text}
+
+ {this.props.text}
+ :
+ {this.props.text}
);
}
}
diff --git a/frontend/src/components/pages/ConfigurationPage.js b/frontend/src/components/pages/ConfigurationPage.js
index 6ab8ae3..2bd2da7 100644
--- a/frontend/src/components/pages/ConfigurationPage.js
+++ b/frontend/src/components/pages/ConfigurationPage.js
@@ -15,19 +15,19 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
-import '../panels/common.scss';
-import './ConfigurationPage.scss';
-import LinkPopover from "../objects/LinkPopover";
+import React, {Component} from "react";
import {Col, Container, Row} from "react-bootstrap";
-import InputField from "../fields/InputField";
-import TextField from "../fields/TextField";
-import ButtonField from "../fields/ButtonField";
-import CheckField from "../fields/CheckField";
-import {createCurlCommand} from "../../utils";
import Table from "react-bootstrap/Table";
-import validation from "../../validation";
import backend from "../../backend";
+import {createCurlCommand} from "../../utils";
+import validation from "../../validation";
+import ButtonField from "../fields/ButtonField";
+import CheckField from "../fields/CheckField";
+import InputField from "../fields/InputField";
+import TextField from "../fields/TextField";
+import LinkPopover from "../objects/LinkPopover";
+import "../panels/common.scss";
+import "./ConfigurationPage.scss";
class ConfigurationPage extends Component {
@@ -40,8 +40,7 @@ class ConfigurationPage extends Component {
"flag_regex": "",
"auth_required": false
},
- "accounts": {
- }
+ "accounts": {}
},
newUsername: "",
newPassword: ""
@@ -50,9 +49,9 @@ class ConfigurationPage extends Component {
saveSettings = () => {
if (this.validateSettings(this.state.settings)) {
- backend.post("/setup", this.state.settings).then(_ => {
+ backend.post("/setup", this.state.settings).then((_) => {
this.props.onConfigured();
- }).catch(res => {
+ }).catch((res) => {
this.setState({setupStatusCode: res.status, setupResponse: JSON.stringify(res.json)});
});
}
@@ -102,14 +101,14 @@ class ConfigurationPage extends Component {
const accounts = Object.entries(settings.accounts).map(([username, password]) =>
{username}
-
+
this.updateParam((s) => delete s.accounts[username]) }/>
+ onClick={() => this.updateParam((s) => delete s.accounts[username])}/>
).concat(
this.setState({newUsername: v})} />
+ onChange={(v) => this.setState({newUsername: v})}/>
this.setState({newPassword: v})} />
+ onChange={(v) => this.setState({newPassword: v})}/>
);
@@ -122,7 +121,7 @@ class ConfigurationPage extends Component {
POST /setup
+ placement="left"/>
@@ -131,10 +130,10 @@ class ConfigurationPage extends Component {
this.updateParam((s) => s.config.server_address = v)} />
+ onChange={(v) => this.updateParam((s) => s.config.server_address = v)}/>
this.updateParam((s) => s.config.flag_regex = v)}
- error={this.state.flagRegexError} />
+ error={this.state.flagRegexError}/>
this.updateParam((s) => s.config.auth_required = v)}/>
@@ -166,7 +165,7 @@ class ConfigurationPage extends Component {
-
+
diff --git a/frontend/src/components/pages/MainPage.js b/frontend/src/components/pages/MainPage.js
index 0b06f55..a542e3f 100644
--- a/frontend/src/components/pages/MainPage.js
+++ b/frontend/src/components/pages/MainPage.js
@@ -15,20 +15,20 @@
* along with this program. If not, see
.
*/
-import React, {Component} from 'react';
-import './MainPage.scss';
-import './common.scss';
-import Connections from "../panels/ConnectionsPane";
-import StreamsPane from "../panels/StreamsPane";
+import React, {Component} from "react";
import {BrowserRouter as Router, Route, Switch} from "react-router-dom";
-import Timeline from "../Timeline";
-import PcapsPane from "../panels/PcapsPane";
-import RulesPane from "../panels/RulesPane";
-import ServicesPane from "../panels/ServicesPane";
-import Header from "../Header";
import Filters from "../dialogs/Filters";
+import Header from "../Header";
+import Connections from "../panels/ConnectionsPane";
import MainPane from "../panels/MainPane";
+import PcapsPane from "../panels/PcapsPane";
+import RulesPane from "../panels/RulesPane";
import SearchPane from "../panels/SearchPane";
+import ServicesPane from "../panels/ServicesPane";
+import StreamsPane from "../panels/StreamsPane";
+import Timeline from "../Timeline";
+import "./common.scss";
+import "./MainPage.scss";
class MainPage extends Component {
diff --git a/frontend/src/components/pages/ServiceUnavailablePage.js b/frontend/src/components/pages/ServiceUnavailablePage.js
index f27d84d..deb4cf8 100644
--- a/frontend/src/components/pages/ServiceUnavailablePage.js
+++ b/frontend/src/components/pages/ServiceUnavailablePage.js
@@ -15,8 +15,8 @@
* along with this program. If not, see
.
*/
-import React, {Component} from 'react';
-import './MainPage.scss';
+import React, {Component} from "react";
+import "./MainPage.scss";
class ServiceUnavailablePage extends Component {
diff --git a/frontend/src/components/panels/ConnectionsPane.js b/frontend/src/components/panels/ConnectionsPane.js
index 89859e6..ea47059 100644
--- a/frontend/src/components/panels/ConnectionsPane.js
+++ b/frontend/src/components/panels/ConnectionsPane.js
@@ -85,8 +85,8 @@ class ConnectionsPane extends Component {
this.timelineUpdatesCallback = payload => {
this.connectionsListRef.current.scrollTop = 0;
this.loadConnections({
- started_after: Math.round(payload.from.getTime() / 1000),
- started_before: Math.round(payload.to.getTime() / 1000),
+ "started_after": Math.round(payload.from.getTime() / 1000),
+ "started_before": Math.round(payload.to.getTime() / 1000),
limit: this.maxConnections
}).then(() => log.info(`Loading connections between ${payload.from} and ${payload.to}`));
};
diff --git a/frontend/src/components/panels/MainPane.js b/frontend/src/components/panels/MainPane.js
index 8aa8ad8..ce72be5 100644
--- a/frontend/src/components/panels/MainPane.js
+++ b/frontend/src/components/panels/MainPane.js
@@ -15,15 +15,15 @@
* along with this program. If not, see
.
*/
-import React, {Component} from 'react';
-import './common.scss';
-import './MainPane.scss';
+import React, {Component} from "react";
import Typed from "typed.js";
import dispatcher from "../../dispatcher";
-import RulesPane from "./RulesPane";
-import StreamsPane from "./StreamsPane";
+import "./common.scss";
+import "./MainPane.scss";
import PcapsPane from "./PcapsPane";
+import RulesPane from "./RulesPane";
import ServicesPane from "./ServicesPane";
+import StreamsPane from "./StreamsPane";
class MainPane extends Component {
@@ -94,7 +94,7 @@ class MainPane extends Component {
- {
+ {
this.el = el;
}}/>
diff --git a/frontend/src/components/panels/PcapsPane.js b/frontend/src/components/panels/PcapsPane.js
index 900aacc..fd3db75 100644
--- a/frontend/src/components/panels/PcapsPane.js
+++ b/frontend/src/components/panels/PcapsPane.js
@@ -15,18 +15,18 @@
* along with this program. If not, see
.
*/
-import React, {Component} from 'react';
-import './PcapsPane.scss';
-import './common.scss';
+import React, {Component} from "react";
import Table from "react-bootstrap/Table";
import backend from "../../backend";
+import dispatcher from "../../dispatcher";
import {createCurlCommand, dateTimeToTime, durationBetween, formatSize} from "../../utils";
-import InputField from "../fields/InputField";
+import ButtonField from "../fields/ButtonField";
import CheckField from "../fields/CheckField";
+import InputField from "../fields/InputField";
import TextField from "../fields/TextField";
-import ButtonField from "../fields/ButtonField";
import LinkPopover from "../objects/LinkPopover";
-import dispatcher from "../../dispatcher";
+import "./common.scss";
+import "./PcapsPane.scss";
class PcapsPane extends Component {
@@ -45,7 +45,7 @@ class PcapsPane extends Component {
componentDidMount() {
this.loadSessions();
- dispatcher.register("notifications", payload => {
+ dispatcher.register("notifications", (payload) => {
if (payload.event === "pcap.upload" || payload.event === "pcap.file") {
this.loadSessions();
}
@@ -56,8 +56,8 @@ class PcapsPane extends Component {
loadSessions = () => {
backend.get("/api/pcap/sessions")
- .then(res => this.setState({sessions: res.json, sessionsStatusCode: res.status}))
- .catch(res => this.setState({
+ .then((res) => this.setState({sessions: res.json, sessionsStatusCode: res.status}))
+ .catch((res) => this.setState({
sessions: res.json, sessionsStatusCode: res.status,
sessionsResponse: JSON.stringify(res.json)
}));
@@ -72,14 +72,14 @@ class PcapsPane extends Component {
const formData = new FormData();
formData.append("file", this.state.uploadSelectedFile);
formData.append("flush_all", this.state.uploadFlushAll);
- backend.postFile("/api/pcap/upload", formData).then(res => {
+ backend.postFile("/api/pcap/upload", formData).then((res) => {
this.setState({
uploadStatusCode: res.status,
uploadResponse: JSON.stringify(res.json)
});
this.resetUpload();
this.loadSessions();
- }).catch(res => this.setState({
+ }).catch((res) => this.setState({
uploadStatusCode: res.status,
uploadResponse: JSON.stringify(res.json)
})
@@ -96,14 +96,14 @@ class PcapsPane extends Component {
file: this.state.fileValue,
flush_all: this.state.processFlushAll,
delete_original_file: this.state.deleteOriginalFile
- }).then(res => {
+ }).then((res) => {
this.setState({
processStatusCode: res.status,
processResponse: JSON.stringify(res.json)
});
this.resetProcess();
this.loadSessions();
- }).catch(res => this.setState({
+ }).catch((res) => this.setState({
processStatusCode: res.status,
processResponse: JSON.stringify(res.json)
})
@@ -130,7 +130,7 @@ class PcapsPane extends Component {
};
render() {
- let sessions = this.state.sessions.map(s =>
+ let sessions = this.state.sessions.map((s) =>
{s["id"].substring(0, 8)}
{dateTimeToTime(s["started_at"])}
@@ -229,7 +229,7 @@ class PcapsPane extends Component {
options:
this.setState({uploadFlushAll: v})}/>
+ onChange={(v) => this.setState({uploadFlushAll: v})}/>
@@ -254,9 +254,9 @@ class PcapsPane extends Component {
this.setState({processFlushAll: v})}/>
+ onChange={(v) => this.setState({processFlushAll: v})}/>
this.setState({deleteOriginalFile: v})}/>
+ onChange={(v) => this.setState({deleteOriginalFile: v})}/>
diff --git a/frontend/src/components/panels/SearchPane.js b/frontend/src/components/panels/SearchPane.js
index 1fb48ef..d3c0c8b 100644
--- a/frontend/src/components/panels/SearchPane.js
+++ b/frontend/src/components/panels/SearchPane.js
@@ -15,21 +15,21 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
-import './common.scss';
-import './SearchPane.scss';
+import React, {Component} from "react";
import Table from "react-bootstrap/Table";
-import InputField from "../fields/InputField";
-import TextField from "../fields/TextField";
import backend from "../../backend";
-import ButtonField from "../fields/ButtonField";
-import LinkPopover from "../objects/LinkPopover";
-import {createCurlCommand, dateTimeToTime, durationBetween} from "../../utils";
import dispatcher from "../../dispatcher";
-import TagField from "../fields/TagField";
+import {createCurlCommand, dateTimeToTime, durationBetween} from "../../utils";
+import ButtonField from "../fields/ButtonField";
import CheckField from "../fields/CheckField";
+import InputField from "../fields/InputField";
+import TagField from "../fields/TagField";
+import TextField from "../fields/TextField";
+import LinkPopover from "../objects/LinkPopover";
+import "./common.scss";
+import "./SearchPane.scss";
-const _ = require('lodash');
+const _ = require("lodash");
class SearchPane extends Component {
@@ -104,15 +104,15 @@ class SearchPane extends Component {
validateSearch = (options) => {
let valid = true;
- if (options.text_search.exact_phrase && options.text_search.exact_phrase.length < 3) {
+ if (options["text_search"]["exact_phrase"] && options["text_search"]["exact_phrase"].length < 3) {
this.setState({exactPhraseError: "text_search.exact_phrase.length < 3"});
valid = false;
}
- if (options.regex_search.pattern && options.regex_search.pattern.length < 3) {
+ if (options["regex_search"].pattern && options["regex_search"].pattern.length < 3) {
this.setState({patternError: "regex_search.pattern.length < 3"});
valid = false;
}
- if (options.regex_search.not_pattern && options.regex_search.not_pattern.length < 3) {
+ if (options["regex_search"]["not_pattern"] && options["regex_search"]["not_pattern"].length < 3) {
this.setState({exactPhraseError: "regex_search.not_pattern.length < 3"});
valid = false;
}
@@ -128,25 +128,25 @@ class SearchPane extends Component {
extractPattern = (options) => {
let pattern = "";
if (_.isEqual(options.regex_search, this.searchOptions.regex_search)) { // is text search
- if (options.text_search.exact_phrase) {
- pattern += `"${options.text_search.exact_phrase}"`;
+ if (options["text_search"]["exact_phrase"]) {
+ pattern += `"${options["text_search"]["exact_phrase"]}"`;
} else {
- pattern += options.text_search.terms.join(" ");
- if (options.text_search.excluded_terms) {
- pattern += " -" + options.text_search.excluded_terms.join(" -");
+ pattern += options["text_search"].terms.join(" ");
+ if (options["text_search"]["excluded_terms"]) {
+ pattern += " -" + options["text_search"]["excluded_terms"].join(" -");
}
}
- options.text_search.case_sensitive && (pattern += "/s");
+ options["text_search"]["case_sensitive"] && (pattern += "/s");
} else { // is regex search
- if (options.regex_search.pattern) {
- pattern += "/" + options.regex_search.pattern + "/";
+ if (options["regex_search"].pattern) {
+ pattern += "/" + options["regex_search"].pattern + "/";
} else {
- pattern += "!/" + options.regex_search.not_pattern + "/";
+ pattern += "!/" + options["regex_search"]["not_pattern"] + "/";
}
- options.regex_search.case_insensitive && (pattern += "i");
- options.regex_search.multi_line && (pattern += "m");
- options.regex_search.ignore_whitespaces && (pattern += "x");
- options.regex_search.dot_character && (pattern += "s");
+ options["regex_search"]["case_insensitive"] && (pattern += "i");
+ options["regex_search"]["multi_line"] && (pattern += "m");
+ options["regex_search"]["ignore_whitespaces"] && (pattern += "x");
+ options["regex_search"]["dot_character"] && (pattern += "s");
}
return pattern;
@@ -222,25 +222,29 @@ class SearchPane extends Component {
- {return {name: 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.map(t => t.name))}/>
- {return {name: t};})}
+ readonly={regexOptionsModified || options["text_search"]["exact_phrase"]}
+ onChange={(tags) => this.updateParam(s => s["text_search"].terms = tags.map(t => t.name))}/>
+ {
+ 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.map(t => t.name))}/>
+ readonly={regexOptionsModified || options["text_search"]["exact_phrase"]}
+ onChange={(tags) => this.updateParam(s => s["text_search"]["excluded_terms"] = tags.map(t => t.name))}/>
or
- this.updateParam(s => s.text_search.exact_phrase = v)}
- readonly={regexOptionsModified || (Array.isArray(options.text_search.terms) && options.text_search.terms.length > 0)}/>
+ onChange={v => this.updateParam(s => s["text_search"]["exact_phrase"] = v)}
+ readonly={regexOptionsModified || (Array.isArray(options["text_search"].terms) && options["text_search"].terms.length > 0)}/>
- this.updateParam(s => s.text_search.case_sensitive = v)}/>
+ onChange={(v) => this.updateParam(s => s["text_search"]["case_sensitive"] = v)}/>
@@ -248,30 +252,30 @@ class SearchPane extends Component {
-
this.updateParam(s => s.regex_search.pattern = v)}/>
+ readonly={textOptionsModified || options["regex_search"]["not_pattern"]}
+ onChange={v => this.updateParam(s => s["regex_search"].pattern = v)}/>
or
- this.updateParam(s => s.regex_search.not_pattern = v)}/>
+ readonly={textOptionsModified || options["regex_search"].pattern}
+ onChange={v => this.updateParam(s => s["regex_search"]["not_pattern"] = v)}/>
- this.updateParam(s => s.regex_search.case_insensitive = v)}/>
- this.updateParam(s => s["regex_search"]["case_insensitive"] = v)}/>
+ this.updateParam(s => s.regex_search.multi_line = v)}/>
- this.updateParam(s => s["regex_search"]["multi_line"] = v)}/>
+ this.updateParam(s => s.regex_search.ignore_whitespaces = v)}/>
- this.updateParam(s => s["regex_search"]["ignore_whitespaces"] = v)}/>
+ this.updateParam(s => s.regex_search.dot_character = v)}/>
+ onChange={(v) => this.updateParam(s => s["regex_search"]["dot_character"] = v)}/>
diff --git a/frontend/src/components/panels/StreamsPane.js b/frontend/src/components/panels/StreamsPane.js
index be39777..41ab33d 100644
--- a/frontend/src/components/panels/StreamsPane.js
+++ b/frontend/src/components/panels/StreamsPane.js
@@ -15,19 +15,19 @@
* along with this program. If not, see .
*/
-import React, {Component} from 'react';
-import './StreamsPane.scss';
-import {Row} from 'react-bootstrap';
-import MessageAction from "../objects/MessageAction";
+import DOMPurify from "dompurify";
+import React, {Component} from "react";
+import {Row} from "react-bootstrap";
+import ReactJson from "react-json-view"
import backend from "../../backend";
+import log from "../../log";
+import {downloadBlob, getHeaderValue} from "../../utils";
import ButtonField from "../fields/ButtonField";
import ChoiceField from "../fields/ChoiceField";
-import DOMPurify from 'dompurify';
-import ReactJson from 'react-json-view'
-import {downloadBlob, getHeaderValue} from "../../utils";
-import log from "../../log";
+import MessageAction from "../objects/MessageAction";
+import "./StreamsPane.scss";
-const classNames = require('classnames');
+const classNames = require("classnames");
class StreamsPane extends Component {
diff --git a/frontend/src/dispatcher.js b/frontend/src/dispatcher.js
index 881970f..ef5dbde 100644
--- a/frontend/src/dispatcher.js
+++ b/frontend/src/dispatcher.js
@@ -15,7 +15,7 @@
* along with this program. If not, see .
*/
-const _ = require('lodash');
+const _ = require("lodash");
class Dispatcher {
diff --git a/frontend/src/index.js b/frontend/src/index.js
index 4bc2730..d00df88 100644
--- a/frontend/src/index.js
+++ b/frontend/src/index.js
@@ -15,21 +15,21 @@
* along with this program. If not, see .
*/
-import React from 'react';
-import ReactDOM from 'react-dom';
-import 'bootstrap/dist/css/bootstrap.css';
-import './index.scss';
-import App from './components/App';
-import * as serviceWorker from './serviceWorker';
+import "bootstrap/dist/css/bootstrap.css";
+import React from "react";
+import ReactDOM from "react-dom";
+import App from "./components/App";
+import "./index.scss";
import notifications from "./notifications";
+import * as serviceWorker from "./serviceWorker";
notifications.createWebsocket();
ReactDOM.render(
- //
- ,
- // ,
- document.getElementById('root')
+ //
+ ,
+ // ,
+ document.getElementById("root")
);
serviceWorker.unregister();
diff --git a/frontend/src/notifications.js b/frontend/src/notifications.js
index f04036d..3c83b87 100644
--- a/frontend/src/notifications.js
+++ b/frontend/src/notifications.js
@@ -15,8 +15,8 @@
* along with this program. If not, see .
*/
-import log from "./log";
import dispatcher from "./dispatcher";
+import log from "./log";
class Notifications {
diff --git a/frontend/src/serviceWorker.js b/frontend/src/serviceWorker.js
index b04b771..c633a91 100644
--- a/frontend/src/serviceWorker.js
+++ b/frontend/src/serviceWorker.js
@@ -57,7 +57,7 @@ export function register(config) {
function registerValidSW(swUrl, config) {
navigator.serviceWorker
.register(swUrl)
- .then(registration => {
+ .then((registration) => {
registration.onupdatefound = () => {
const installingWorker = registration.installing;
if (installingWorker == null) {
@@ -93,7 +93,7 @@ function registerValidSW(swUrl, config) {
};
};
})
- .catch(error => {
+ .catch((error) => {
console.error('Error during service worker registration:', error);
});
}
@@ -103,7 +103,7 @@ function checkValidServiceWorker(swUrl, config) {
fetch(swUrl, {
headers: { 'Service-Worker': 'script' },
})
- .then(response => {
+ .then((response) => {
// Ensure service worker exists, and that we really are getting a JS file.
const contentType = response.headers.get('content-type');
if (
@@ -111,7 +111,7 @@ function checkValidServiceWorker(swUrl, config) {
(contentType != null && contentType.indexOf('javascript') === -1)
) {
// No service worker found. Probably a different app. Reload the page.
- navigator.serviceWorker.ready.then(registration => {
+ navigator.serviceWorker.ready.then((registration) => {
registration.unregister().then(() => {
window.location.reload();
});
@@ -131,10 +131,10 @@ function checkValidServiceWorker(swUrl, config) {
export function unregister() {
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready
- .then(registration => {
+ .then((registration) => {
registration.unregister();
})
- .catch(error => {
+ .catch((error) => {
console.error(error.message);
});
}
diff --git a/frontend/src/setupProxy.js b/frontend/src/setupProxy.js
index f2e1c39..fb60b75 100644
--- a/frontend/src/setupProxy.js
+++ b/frontend/src/setupProxy.js
@@ -15,10 +15,10 @@
* along with this program. If not, see .
*/
-const { createProxyMiddleware } = require('http-proxy-middleware');
+const {createProxyMiddleware} = require("http-proxy-middleware");
-module.exports = function(app) {
- app.use(createProxyMiddleware("/api", { target: "http://localhost:3333" }));
- app.use(createProxyMiddleware("/setup", { target: "http://localhost:3333" }));
- app.use(createProxyMiddleware("/ws", { target: "http://localhost:3333", ws: true }));
+module.exports = function (app) {
+ app.use(createProxyMiddleware("/api", {target: "http://localhost:3333"}));
+ app.use(createProxyMiddleware("/setup", {target: "http://localhost:3333"}));
+ app.use(createProxyMiddleware("/ws", {target: "http://localhost:3333", ws: true}));
};
diff --git a/frontend/src/setupTests.js b/frontend/src/setupTests.js
index 74b1a27..9b1d6d0 100644
--- a/frontend/src/setupTests.js
+++ b/frontend/src/setupTests.js
@@ -2,4 +2,4 @@
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
-import '@testing-library/jest-dom/extend-expect';
+import "@testing-library/jest-dom/extend-expect";
\ No newline at end of file
diff --git a/frontend/src/utils.js b/frontend/src/utils.js
index 06414ac..0f0927e 100644
--- a/frontend/src/utils.js
+++ b/frontend/src/utils.js
@@ -18,15 +18,15 @@
const timeRegex = /^(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/;
export function createCurlCommand(subCommand, method = null, json = null, data = null) {
- const full = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
+ const full = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
let contentType = null;
let content = null;
if (json != null) {
- contentType = ' -H "Content-Type: application/json" \\\n';
+ contentType = " -H \"Content-Type: application/json\" \\\n";
content = ` -d '${JSON.stringify(json)}'`;
} else if (data != null) {
- contentType = ' -H "Content-Type: multipart/form-data" \\\n';
+ contentType = " -H \"Content-Type: multipart/form-data\" \\\n";
content = " " + Object.entries(data).map(([key, value]) => `-F "${key}=${value}"`).join(" \\\n ");
}
@@ -66,13 +66,13 @@ export function timeToTimestamp(time) {
let d = new Date();
let matches = time.match(timeRegex);
- if (matches[1] !== undefined) {
+ if (matches[1]) {
d.setHours(matches[1]);
}
- if (matches[2] !== undefined) {
+ if (matches[2]) {
d.setMinutes(matches[2]);
}
- if (matches[3] !== undefined) {
+ if (matches[3]) {
d.setSeconds(matches[3]);
}
@@ -84,7 +84,7 @@ export function timestampToTime(timestamp) {
let hours = d.getHours();
let minutes = "0" + d.getMinutes();
let seconds = "0" + d.getSeconds();
- return hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
+ return hours + ":" + minutes.substr(-2) + ":" + seconds.substr(-2);
}
export function timestampToDateTime(timestamp) {
@@ -100,7 +100,7 @@ export function dateTimeToTime(dateTime) {
let hours = dateTime.getHours();
let minutes = "0" + dateTime.getMinutes();
let seconds = "0" + dateTime.getSeconds();
- return hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
+ return hours + ":" + minutes.substr(-2) + ":" + seconds.substr(-2);
}
export function durationBetween(from, to) {
@@ -131,7 +131,7 @@ export function randomClassName() {
export function getHeaderValue(request, key) {
if (request && request.headers) {
- return request.headers[Object.keys(request.headers).find(k => k.toLowerCase() === key.toLowerCase())];
+ return request.headers[Object.keys(request.headers).find((k) => k.toLowerCase() === key.toLowerCase())];
}
return undefined;
}
@@ -154,7 +154,7 @@ export function updateParams(urlParams, payload) {
params.delete(key);
} else if (Array.isArray(value)) {
params.delete(key);
- value.forEach(v => params.append(key, v));
+ value.forEach((v) => params.append(key, v));
} else {
params.set(key, value);
}
--
cgit v1.2.3-70-g09d2