import React, {Component} from 'react'; import './Connection.scss'; import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"; import { faCloudDownloadAlt, faCloudUploadAlt, faComment, faEyeSlash, faHourglassHalf, faLaptop, faLink, faServer, faThumbtack, } from '@fortawesome/free-solid-svg-icons' class Connection extends Component { render() { let conn = this.props.data let serviceName = "assign" let serviceColor = "#fff" if (conn.service != null) { 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)}` return (
{conn.ip_src}:{conn.port_src} {"->"} {conn.ip_dst}:{conn.port_dst} {duration}s {conn.client_bytes} {conn.server_bytes}
); } } export default Connection;