diff --git a/components/measurement/nettests/WebConnectivity.js b/components/measurement/nettests/WebConnectivity.js index 667002aa2..3b261dfbc 100644 --- a/components/measurement/nettests/WebConnectivity.js +++ b/components/measurement/nettests/WebConnectivity.js @@ -167,32 +167,45 @@ FailureString.propTypes = { failure: PropTypes.string } +const DnsNarrowAnswerCell = (props) => ( + {props.children} +) + const DnsAnswerCell = (props) => ( - {props.children} + {props.children} ) DnsAnswerCell.propTypes = { children: PropTypes.any } -const FiveColRow = ({ name = 'Name', netClass = 'Class', ttl = 'TTL', type = 'Type', data = 'DATA', header = false}) => ( +const dnsAnswerIpInfo = (dnsAnswer) => { + const asn = dnsAnswer.asn ? `AS${dnsAnswer.asn}` : 'Unknown AS' + const asOrgName = dnsAnswer.as_org_name ? `(${dnsAnswer.as_org_name})` : '' + + return `${asn} ${asOrgName}`.trim() +} + +const DnsAnswerRow = ({ name = 'Name', netClass = 'Class', ttl = 'TTL', type = 'Type', data = 'DATA', answer_ip_info = 'Answer IP Info', header = false}) => ( {name} - {netClass} - {ttl} - {type} + {netClass} + {ttl} + {type} {data} + {answer_ip_info} ) -FiveColRow.propTypes = { +DnsAnswerRow.propTypes = { name: PropTypes.string, netClass: PropTypes.string, ttl: PropTypes.number, type: PropTypes.string, data: PropTypes.string, + answer_ip_info: PropTypes.string, header: PropTypes.bool } @@ -228,9 +241,9 @@ const QueryContainer = ({query}) => { {failure && } {!failure && - + {Array.isArray(answers) && answers.map((dnsAnswer, index) => ( - { ? dnsAnswer.hostname : null // for any other answer_type, DATA column will be empty } + answer_ip_info={dnsAnswerIpInfo(dnsAnswer)} /> ))}