From dee7d7dfcbec7ef4475896935873f04d4df0d40f Mon Sep 17 00:00:00 2001 From: Emiliano Ciavatta Date: Thu, 7 May 2020 12:25:41 +0200 Subject: Add colors to services dialog --- frontend/src/components/Connection.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'frontend/src/components') diff --git a/frontend/src/components/Connection.js b/frontend/src/components/Connection.js index ce2b173..13b394a 100644 --- a/frontend/src/components/Connection.js +++ b/frontend/src/components/Connection.js @@ -4,24 +4,24 @@ import {Button, OverlayTrigger, Tooltip} from "react-bootstrap"; class Connection extends Component { render() { - let conn = this.props.data - let serviceName = "/dev/null" - let serviceColor = "#0F192E" + 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 + 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 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" + let classes = "connection"; if (this.props.selected) { - classes += " connection-selected" + classes += " connection-selected"; } if (conn.marked){ - classes += " connection-marked" + classes += " connection-marked"; } return ( -- cgit v1.2.3-70-g09d2