import React, {Component} from 'react'; import './Connections.scss'; import axios from 'axios' import Connection from "../components/Connection"; import Table from 'react-bootstrap/Table'; import {Redirect} from 'react-router'; class Connections extends Component { constructor(props) { super(props); this.state = { connections: [], }; } componentDidMount() { axios.get("/api/connections").then(res => this.setState({connections: res.data})) } render() { let redirect = "" if (this.state.selected) { redirect = ; } return (
{ this.state.connections.map(c => this.setState({selected: c.id})} selected={this.state.selected === c.id}/> ) }
service srcip dstip srcport dstport duration up down actions
{redirect}
); } } export default Connections;