Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show failure value for TCP connect on web connectivity measurement page #908

Merged
merged 3 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions components/measurement/nettests/WebConnectivity.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,6 @@ const messages = defineMessages({
id: 'Measurement.SummaryText.Websites.Anomaly.BlockingReason.TCP',
defaultMessage: ''
},
'connection.Success': {
id: 'Measurement.Details.Websites.TCP.ConnectionTo.Success',
defaultMessage: ''
},
'connection.Failed': {
id: 'Measurement.Details.Websites.TCP.ConnectionTo.Failed',
defaultMessage: ''
},
'connection.Blocked': {
id: 'Measurement.Details.Websites.TCP.ConnectionTo.Blocked',
defaultMessage: ''
},
})

// From https://css-tricks.com/snippets/css/make-pre-text-wrap/
Expand Down Expand Up @@ -488,11 +476,9 @@ const WebConnectivityDetails = ({
}

const tcpConnections = Array.isArray(tcp_connect) ? tcp_connect.map((connection) => {
const status = (connection.status.success) ? 'Success' :
(connection.status.blocked) ? 'Blocked' : 'Failed'
return {
destination: connection.ip + ':' + connection.port,
status
failure: connection.status?.failure
}
}) : []

Expand Down Expand Up @@ -575,13 +561,11 @@ const WebConnectivityDetails = ({
<Flex key={index}>
<Box>
<Text>
<FormattedMessage
id='Measurement.Details.Websites.TCP.ConnectionTo'
values={{
destination: <strong> {connection.destination} </strong>,
connectionStatus: intl.formatMessage(messages[`connection.${connection.status}`])
}}
/>
<strong>{connection.destination}</strong>: {
connection.failure ?
`${intl.formatMessage({id: 'Measurement.Details.Websites.TCP.ConnectionTo.Failed'})} (${connection.failure})` :
intl.formatMessage({id: 'Measurement.Details.Websites.TCP.ConnectionTo.Success'})
}
</Text>
</Box>
</Flex>
Expand Down
4 changes: 1 addition & 3 deletions public/static/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@
"Measurement.Details.Websites.DNSQueries.Heading": "DNS Queries",
"Measurement.Details.Websites.DNSQueries.Label.Resolver": "Resolver",
"Measurement.Details.Websites.TCP.Heading": "TCP Connections",
"Measurement.Details.Websites.TCP.ConnectionTo": "Connection to {destination} {connectionStatus}.",
"Measurement.Details.Websites.HTTP.Heading": "HTTP Requests",
"Measurement.Details.Websites.TCP.ConnectionTo.Success": "succeeded",
"Measurement.Details.Websites.TCP.ConnectionTo.Failed": "failed",
"Measurement.Details.Websites.TCP.ConnectionTo.Blocked": "was blocked",
"Measurement.Details.Websites.HTTP.Heading": "HTTP Requests",
"Measurement.Details.Websites.HTTP.Label.Response": "Response",
"Measurement.Details.Websites.HTTP.Request.URL": "URL",
"Measurement.Details.Websites.HTTP.Response.Body": "Response Body",
Expand Down
Loading