import React, {Component} from 'react'; import './common.scss'; import './MainPane.scss'; import Connections from "../../views/Connections"; import ConnectionContent from "../ConnectionContent"; import {Route, Switch, withRouter} from "react-router-dom"; import PcapPane from "./PcapPane"; import backend from "../../backend"; import RulePane from "./RulePane"; import ServicePane from "./ServicePane"; import log from "../../log"; class MainPane extends Component { state = {}; componentDidMount() { const match = this.props.location.pathname.match(/^\/connections\/([a-f0-9]{24})$/); if (match != null) { this.loading = true; backend.get(`/api/connections/${match[1]}`) .then(res => { this.loading = false; this.setState({selectedConnection: res.json}); log.debug(`Initial connection ${match[1]} loaded`); }) .catch(error => log.error("Error loading initial connection", error)); } } render() { return (