import React, {Component} from 'react'; import './Connection.scss'; import {Button, OverlayTrigger, Tooltip} from "react-bootstrap"; class Connection extends Component { render() { let conn = this.props.data let serviceName = "/dev/null" let serviceColor = "#0F192E" if (conn.service.port !== 0) { serviceName = conn.service.name serviceColor = conn.service.color } let startedAt = new Date(conn.started_at) let closedAt = new Date(conn.closed_at) let duration = ((closedAt - startedAt) / 1000).toFixed(3) let timeInfo = `Started at ${startedAt}\nClosed at ${closedAt}\nProcessed at ${new Date(conn.processed_at)}` let classes = "connection" if (this.props.selected) { classes += " connection-selected" } if (conn.marked){ classes += " connection-marked" } return ( this.props.onSelected()}>{conn.ip_src} this.props.onSelected()}>{conn.port_src} this.props.onSelected()}>{conn.ip_dst} this.props.onSelected()}>{conn.port_dst} this.props.onSelected()}> {/*{timeInfo}}>*/} {duration}s {/**/} this.props.onSelected()}>{conn.client_bytes} this.props.onSelected()}>{conn.server_bytes} % !! @ # ); } } export default Connection;