From 151944bc27eba4f4752502fb012ac04d5fd17e95 Mon Sep 17 00:00:00 2001 From: Andrey Meshkov Date: Wed, 10 Oct 2018 17:54:21 +0300 Subject: [PATCH] fix strings --- client/src/helpers/helpers.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/client/src/helpers/helpers.js b/client/src/helpers/helpers.js index d6269d8a..9aea6a11 100644 --- a/client/src/helpers/helpers.js +++ b/client/src/helpers/helpers.js @@ -34,8 +34,20 @@ export const normalizeLogs = logs => logs.map((log) => { }; }); +const STATS_NAMES = { + avg_processing_time: 'Average processing time', + blocked_filtering: 'Blocked by filters', + dns_queries: 'DNS queries', + replaced_parental: 'Blocked adult websites', + replaced_safebrowsing: 'Blocked malware/phishing', + replaced_safesearch: 'Enforced safe search', +}; + export const normalizeHistory = history => Object.keys(history).map((key) => { - const id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); + let id = STATS_NAMES[key]; + if (!id) { + id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); + } const dayAgo = subHours(Date.now(), 24);