diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 6b57484e..7e493cf2 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -1,5 +1,6 @@ import React from 'react'; import propTypes from 'prop-types'; +import { Link } from 'react-router-dom'; import { Trans, useTranslation } from 'react-i18next'; import round from 'lodash/round'; import { shallowEqual, useSelector } from 'react-redux'; @@ -10,7 +11,7 @@ import { RESPONSE_FILTER } from '../../helpers/constants'; import Tooltip from '../ui/Tooltip'; const Row = ({ - label, count, response_status, tooltipTitle, translationComponents, + label, count, response_status, tooltipTitle, translationComponents, href, }) => { const content = response_status ? {formatNumber(count)} @@ -18,7 +19,11 @@ const Row = ({ return - {label} + {href ? ( + {label} + ) : ( + {label} + )} @@ -48,31 +53,35 @@ const Counters = ({ refreshButton, subtitle }) => { count: numDnsQueries, tooltipTitle: interval === 1 ? 'number_of_dns_query_24_hours' : t('number_of_dns_query_days', { count: interval }), response_status: RESPONSE_FILTER.ALL.QUERY, + href: 'logs', }, { label: 'blocked_by', count: numBlockedFiltering, tooltipTitle: 'number_of_dns_query_blocked_24_hours', response_status: RESPONSE_FILTER.BLOCKED.QUERY, - translationComponents: [link], + translationComponents: [link], }, { label: 'stats_malware_phishing', count: numReplacedSafebrowsing, tooltipTitle: 'number_of_dns_query_blocked_24_hours_by_sec', response_status: RESPONSE_FILTER.BLOCKED_THREATS.QUERY, + href: 'logs?response_status=blocked_safebrowsing', }, { label: 'stats_adult', count: numReplacedParental, tooltipTitle: 'number_of_dns_query_blocked_24_hours_adult', response_status: RESPONSE_FILTER.BLOCKED_ADULT_WEBSITES.QUERY, + href: 'logs?response_status=blocked_parental', }, { label: 'enforced_save_search', count: numReplacedSafesearch, tooltipTitle: 'number_of_dns_query_to_safe_search', response_status: RESPONSE_FILTER.SAFE_SEARCH.QUERY, + href: 'logs?response_status=safe_search', }, { label: 'average_processing_time', @@ -101,6 +110,7 @@ Row.propTypes = { response_status: propTypes.string, tooltipTitle: propTypes.string.isRequired, translationComponents: propTypes.arrayOf(propTypes.element), + href: propTypes.string, }; Counters.propTypes = { diff --git a/client/src/components/Dashboard/DomainCell.js b/client/src/components/Dashboard/DomainCell.js index fbbb8615..833f923f 100644 --- a/client/src/components/Dashboard/DomainCell.js +++ b/client/src/components/Dashboard/DomainCell.js @@ -1,5 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; +import { Link } from 'react-router-dom'; import { Trans } from 'react-i18next'; import { getSourceData, getTrackerData } from '../../helpers/trackers/trackers'; @@ -53,7 +54,7 @@ const DomainCell = ({ value }) => { return (
- {value} + {value}
{trackerData && dns_query} + title={dns_query} color="blue" />
@@ -34,7 +35,7 @@ const Statistics = ({ total={numBlockedFiltering} lineData={getNormalizedHistory(blockedFiltering, interval, 'blockedFiltering')} percent={getPercent(numDnsQueries, numBlockedFiltering)} - title={link]}>blocked_by} + title={link]}>blocked_by} color="red" /> @@ -47,7 +48,7 @@ const Statistics = ({ 'replacedSafebrowsing', )} percent={getPercent(numDnsQueries, numReplacedSafebrowsing)} - title={stats_malware_phishing} + title={stats_malware_phishing} color="green" /> @@ -56,7 +57,7 @@ const Statistics = ({ total={numReplacedParental} lineData={getNormalizedHistory(replacedParental, interval, 'replacedParental')} percent={getPercent(numDnsQueries, numReplacedParental)} - title={stats_adult} + title={stats_adult} color="yellow" /> diff --git a/client/src/helpers/renderFormattedClientCell.js b/client/src/helpers/renderFormattedClientCell.js index f7e59a84..88c85bd7 100644 --- a/client/src/helpers/renderFormattedClientCell.js +++ b/client/src/helpers/renderFormattedClientCell.js @@ -1,4 +1,5 @@ import React from 'react'; +import { Link } from 'react-router-dom'; import { normalizeWhois } from './helpers'; import { WHOIS_ICONS } from './constants'; @@ -63,7 +64,7 @@ export const renderFormattedClientCell = (value, info, isDetailed = false, isLog } return
- {nameContainer} + {nameContainer} {whoisContainer}
; };