From e320eb29c220676806f57c8a598b66c0df2da09b Mon Sep 17 00:00:00 2001 From: qingbo Date: Mon, 3 Jul 2023 18:48:14 +0800 Subject: [PATCH 1/3] fix error days --- client/src/components/Dashboard/Counters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 2434bb8c..039ce462 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -54,12 +54,12 @@ const Counters = ({ refreshButton, subtitle }) => { avgProcessingTime, } = useSelector((state) => state.stats, shallowEqual); const { t } = useTranslation(); - + const days = interval / (1000 * 60 * 60 * 24) const rows = [ { label: 'dns_query', count: numDnsQueries, - tooltipTitle: interval === 1 ? 'number_of_dns_query_24_hours' : t('number_of_dns_query_days', { count: interval }), + tooltipTitle: days === 1 ? 'number_of_dns_query_24_hours' : t('number_of_dns_query_days', { count: days }), response_status: RESPONSE_FILTER.ALL.QUERY, }, { From 9a506d3755f60aa5a2252987ce2a8254c2c2f3f7 Mon Sep 17 00:00:00 2001 From: Ainar Garipov Date: Mon, 3 Jul 2023 14:23:18 +0300 Subject: [PATCH 2/3] clients: fix lint --- client/src/components/Dashboard/Counters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 039ce462..3b05e074 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -54,7 +54,7 @@ const Counters = ({ refreshButton, subtitle }) => { avgProcessingTime, } = useSelector((state) => state.stats, shallowEqual); const { t } = useTranslation(); - const days = interval / (1000 * 60 * 60 * 24) + const days = interval / (1000 * 60 * 60 * 24); const rows = [ { label: 'dns_query', From 4b9264531be50e81fe610050a12827b71bc3a9cd Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 3 Jul 2023 14:29:33 +0300 Subject: [PATCH 3/3] clients: use constant a day in milliseconds --- client/src/components/Dashboard/Counters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Dashboard/Counters.js b/client/src/components/Dashboard/Counters.js index 3b05e074..69702c32 100644 --- a/client/src/components/Dashboard/Counters.js +++ b/client/src/components/Dashboard/Counters.js @@ -6,7 +6,7 @@ import { shallowEqual, useSelector } from 'react-redux'; import Card from '../ui/Card'; import { formatNumber } from '../../helpers/helpers'; import LogsSearchLink from '../ui/LogsSearchLink'; -import { RESPONSE_FILTER } from '../../helpers/constants'; +import { RESPONSE_FILTER, DAY } from '../../helpers/constants'; import Tooltip from '../ui/Tooltip'; const Row = ({ @@ -54,7 +54,7 @@ const Counters = ({ refreshButton, subtitle }) => { avgProcessingTime, } = useSelector((state) => state.stats, shallowEqual); const { t } = useTranslation(); - const days = interval / (1000 * 60 * 60 * 24); + const days = interval / DAY; const rows = [ { label: 'dns_query',