"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "client/src/helpers/helpers.js" between
AdGuardHome-0.104.1.tar.gz and AdGuardHome-0.104.3.tar.gz

About: AdGuard Home is a network-wide ads & trackers blocking DNS server. It operates as a DNS server that re-routes tracking domains to a "black hole," thus preventing your devices from connecting to those servers.

helpers.js  (AdGuardHome-0.104.1):helpers.js  (AdGuardHome-0.104.3)
import 'url-polyfill'; import 'url-polyfill';
import dateParse from 'date-fns/parse'; import dateParse from 'date-fns/parse';
import dateFormat from 'date-fns/format'; import dateFormat from 'date-fns/format';
import subHours from 'date-fns/sub_hours';
import addHours from 'date-fns/add_hours';
import addDays from 'date-fns/add_days';
import subDays from 'date-fns/sub_days';
import round from 'lodash/round'; import round from 'lodash/round';
import axios from 'axios'; import axios from 'axios';
import i18n from 'i18next'; import i18n from 'i18next';
import uniqBy from 'lodash/uniqBy'; import uniqBy from 'lodash/uniqBy';
import ipaddr from 'ipaddr.js'; import ipaddr from 'ipaddr.js';
import queryString from 'query-string'; import queryString from 'query-string';
import { getTrackerData } from './trackers/trackers'; import { getTrackerData } from './trackers/trackers';
import { import {
ADDRESS_TYPES, ADDRESS_TYPES,
skipping to change at line 108 skipping to change at line 104
service_name, service_name,
originalAnswer: original_answer, originalAnswer: original_answer,
originalResponse: processResponse(original_answer), originalResponse: processResponse(original_answer),
tracker: getTrackerData(domain), tracker: getTrackerData(domain),
answer_dnssec, answer_dnssec,
elapsedMs, elapsedMs,
upstream, upstream,
}; };
}); });
export const normalizeHistory = (history, interval) => { export const normalizeHistory = (history) => history.map((item, idx) => ({
if (interval === 1 || interval === 7) { x: idx,
const hoursAgo = subHours(Date.now(), 24 * interval); y: item,
return history.map((item, index) => ({ }));
x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'),
y: round(item, 2),
}));
}
const daysAgo = subDays(Date.now(), interval - 1);
return history.map((item, index) => ({
x: dateFormat(addDays(daysAgo, index), 'D MMM YYYY'),
y: round(item, 2),
}));
};
export const normalizeTopStats = (stats) => ( export const normalizeTopStats = (stats) => (
stats.map((item) => ({ stats.map((item) => ({
name: Object.keys(item)[0], name: Object.keys(item)[0],
count: Object.values(item)[0], count: Object.values(item)[0],
})) }))
); );
export const addClientInfo = (data, clients, param) => data.map((row) => { export const addClientInfo = (data, clients, param) => data.map((row) => {
const clientIp = row[param]; const clientIp = row[param];
 End of changes. 2 change blocks. 
19 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)