Replace the main Statistics graph with 4 blocks instead
This commit is contained in:
@@ -4,6 +4,8 @@ import subHours from 'date-fns/sub_hours';
|
||||
import addHours from 'date-fns/add_hours';
|
||||
import round from 'lodash/round';
|
||||
|
||||
import { STATS_NAMES } from './constants';
|
||||
|
||||
const formatTime = (time) => {
|
||||
const parsedTime = dateParse(time);
|
||||
return dateFormat(parsedTime, 'HH:mm:ss');
|
||||
@@ -34,15 +36,6 @@ 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) => {
|
||||
let id = STATS_NAMES[key];
|
||||
if (!id) {
|
||||
@@ -81,3 +74,5 @@ export const normalizeFilteringStatus = (filteringStatus) => {
|
||||
const newUserRules = Array.isArray(userRules) ? userRules.join('\n') : '';
|
||||
return { enabled, userRules: newUserRules, filters: newFilters };
|
||||
};
|
||||
|
||||
export const getPercent = (amount, number) => round(100 / (amount / number));
|
||||
|
||||
Reference in New Issue
Block a user