docstring_tokens
stringlengths 0
76.5k
| code_tokens
stringlengths 75
1.81M
| label_window
sequencelengths 4
2.12k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|
<mask> replacedSafebrowsing,
<mask> replacedParental,
<mask> } = this.props;
<mask>
<mask> const filteringData = [this.props.history[1]];
<mask> const queriesData = [this.props.history[2]];
<mask> const parentalData = [this.props.history[3]];
<mask> const safebrowsingData = [this.props.history[4]];
<mask>
<mask> return (
<mask> <div className="row">
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
</s> + client: handle the new statistics format </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
|
{numDnsQueries} | <mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
<mask> <div className="card-value card-value-stats text-blue">
<mask> {dnsQueries}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <Trans>dns_query</Trans>
<mask> </div>
<mask> </div>
</s> + client: handle the new statistics format </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
<Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> | <mask> <Trans>dns_query</Trans>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={queriesData} color={STATUS_COLORS.blue}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
</s> + client: handle the new statistics format </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
{numBlockedFiltering} | <mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
<mask> <div className="card-value card-value-stats text-red">
<mask> {blockedFiltering}
<mask> </div>
<mask> <div className="card-value card-value-percent text-red">
<mask> {getPercent(dnsQueries, blockedFiltering)}
<mask> </div>
<mask> <div className="card-title-stats">
</s> + client: handle the new statistics format </s> remove {getPercent(dnsQueries, blockedFiltering)}
</s> add {getPercent(numDnsQueries, numBlockedFiltering)} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
{getPercent(numDnsQueries, numBlockedFiltering)} | <mask> <div className="card-value card-value-stats text-red">
<mask> {blockedFiltering}
<mask> </div>
<mask> <div className="card-value card-value-percent text-red">
<mask> {getPercent(dnsQueries, blockedFiltering)}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <a href="#filters">
<mask> <Trans>blocked_by</Trans>
<mask> </a>
</s> + client: handle the new statistics format </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} </s> remove {getPercent(dnsQueries, replacedSafebrowsing)}
</s> add {getPercent(numDnsQueries, numReplacedSafebrowsing)} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
<Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> | <mask> </a>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={filteringData} color={STATUS_COLORS.red}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
</s> + client: handle the new statistics format </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
{numReplacedSafebrowsing} | <mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
<mask> <div className="card-value card-value-stats text-green">
<mask> {replacedSafebrowsing}
<mask> </div>
<mask> <div className="card-value card-value-percent text-green">
<mask> {getPercent(dnsQueries, replacedSafebrowsing)}
<mask> </div>
<mask> <div className="card-title-stats">
</s> + client: handle the new statistics format </s> remove {getPercent(dnsQueries, replacedSafebrowsing)}
</s> add {getPercent(numDnsQueries, numReplacedSafebrowsing)} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
{getPercent(numDnsQueries, numReplacedSafebrowsing)} | <mask> <div className="card-value card-value-stats text-green">
<mask> {replacedSafebrowsing}
<mask> </div>
<mask> <div className="card-value card-value-percent text-green">
<mask> {getPercent(dnsQueries, replacedSafebrowsing)}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <Trans>stats_malware_phishing</Trans>
<mask> </div>
<mask> </div>
</s> + client: handle the new statistics format </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} </s> remove {getPercent(dnsQueries, blockedFiltering)}
</s> add {getPercent(numDnsQueries, numBlockedFiltering)} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
<Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> | <mask> <Trans>stats_malware_phishing</Trans>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
</s> + client: handle the new statistics format </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
{numReplacedParental} | <mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
<mask> <div className="card-value card-value-stats text-yellow">
<mask> {replacedParental}
<mask> </div>
<mask> <div className="card-value card-value-percent text-yellow">
<mask> {getPercent(dnsQueries, replacedParental)}
<mask> </div>
<mask> <div className="card-title-stats">
</s> + client: handle the new statistics format </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {getPercent(dnsQueries, replacedSafebrowsing)}
</s> add {getPercent(numDnsQueries, numReplacedSafebrowsing)} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
{getPercent(numDnsQueries, numReplacedParental)} | <mask> <div className="card-value card-value-stats text-yellow">
<mask> {replacedParental}
<mask> </div>
<mask> <div className="card-value card-value-percent text-yellow">
<mask> {getPercent(dnsQueries, replacedParental)}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <Trans>stats_adult</Trans>
<mask> </div>
<mask> </div>
</s> + client: handle the new statistics format </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {getPercent(dnsQueries, replacedSafebrowsing)}
</s> add {getPercent(numDnsQueries, numReplacedSafebrowsing)} </s> remove {getPercent(dnsQueries, blockedFiltering)}
</s> add {getPercent(numDnsQueries, numBlockedFiltering)} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
<Line
data={this.getNormalizedHistory(
replacedParental,
interval,
'replacedParental',
)}
color={STATUS_COLORS.yellow}
/> | <mask> <Trans>stats_adult</Trans>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={parentalData} color={STATUS_COLORS.yellow}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> </div>
<mask> );
</s> + client: handle the new statistics format </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
interval: PropTypes.number.isRequired,
dnsQueries: PropTypes.array.isRequired,
blockedFiltering: PropTypes.array.isRequired,
replacedSafebrowsing: PropTypes.array.isRequired,
replacedParental: PropTypes.array.isRequired,
numDnsQueries: PropTypes.number.isRequired,
numBlockedFiltering: PropTypes.number.isRequired,
numReplacedSafebrowsing: PropTypes.number.isRequired,
numReplacedParental: PropTypes.number.isRequired, | <mask> }
<mask> }
<mask>
<mask> Statistics.propTypes = {
<mask> history: PropTypes.array.isRequired,
<mask> dnsQueries: PropTypes.number.isRequired,
<mask> blockedFiltering: PropTypes.number.isRequired,
<mask> replacedSafebrowsing: PropTypes.number.isRequired,
<mask> replacedParental: PropTypes.number.isRequired,
<mask> refreshButton: PropTypes.node.isRequired,
<mask> };
<mask>
<mask> export default withNamespaces()(Statistics);
</s> + client: handle the new statistics format </s> remove topBlockedDomains: PropTypes.object.isRequired,
</s> add topBlockedDomains: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, </s> remove topQueriedDomains: PropTypes.object.isRequired,
</s> add topQueriedDomains: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/Statistics.js |
this.props.getStatsConfig(); | <mask> }
<mask>
<mask> getAllStats = () => {
<mask> this.props.getStats();
<mask> this.props.getStatsHistory();
<mask> this.props.getTopStats();
<mask> this.props.getClients();
<mask> }
<mask>
<mask> getToggleFilteringButton = () => {
<mask> const { protectionEnabled, processingProtection } = this.props.dashboard;
</s> + client: handle the new statistics format </s> remove }
</s> add }; </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST');
export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE');
export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS');
export const getTopStats = () => async (dispatch, getState) => {
dispatch(getTopStatsRequest());
const timer = setInterval(async () => {
const state = getState();
if (state.dashboard.isCoreRunning) {
clearInterval(timer);
try {
const stats = await apiClient.getGlobalStatsTop();
dispatch(getTopStatsSuccess(stats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTopStatsFailure(error));
}
}
}, 100);
};
</s> add </s> remove this.props.getTopStats();
</s> add this.props.getStats(); </s> remove export const getStatsRequest = createAction('GET_STATS_REQUEST');
export const getStatsFailure = createAction('GET_STATS_FAILURE');
export const getStatsSuccess = createAction('GET_STATS_SUCCESS');
export const getStats = () => async (dispatch) => {
dispatch(getStatsRequest());
try {
const stats = await apiClient.getGlobalStats();
const processedStats = {
...stats,
avg_processing_time: round(stats.avg_processing_time, 2),
};
dispatch(getStatsSuccess(processedStats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsFailure());
}
};
</s> add </s> remove export const getStatsHistoryRequest = createAction('GET_STATS_HISTORY_REQUEST');
export const getStatsHistoryFailure = createAction('GET_STATS_HISTORY_FAILURE');
export const getStatsHistorySuccess = createAction('GET_STATS_HISTORY_SUCCESS');
export const getStatsHistory = () => async (dispatch) => {
dispatch(getStatsHistoryRequest());
try {
const statsHistory = await apiClient.getGlobalStatsHistory();
const normalizedHistory = normalizeHistory(statsHistory);
dispatch(getStatsHistorySuccess(normalizedHistory));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsHistoryFailure());
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
}; | <mask> this.props.getStats();
<mask> this.props.getStatsHistory();
<mask> this.props.getTopStats();
<mask> this.props.getClients();
<mask> }
<mask>
<mask> getToggleFilteringButton = () => {
<mask> const { protectionEnabled, processingProtection } = this.props.dashboard;
<mask> const buttonText = protectionEnabled ? 'disable_protection' : 'enable_protection';
<mask> const buttonClass = protectionEnabled ? 'btn-gray' : 'btn-success';
</s> + client: handle the new statistics format </s> remove this.props.getStatsHistory();
this.props.getTopStats();
</s> add this.props.getStatsConfig(); </s> remove dashboard.processingTopStats;
</s> add stats.processingStats ||
stats.processingGetConfig;
const subtitle =
stats.interval === 1
? t('for_last_24_hours')
: t('for_last_days', { value: stats.interval }); </s> remove this.props.getTopStats();
</s> add this.props.getStats(); </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST');
export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE');
export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS');
export const getTopStats = () => async (dispatch, getState) => {
dispatch(getTopStatsRequest());
const timer = setInterval(async () => {
const state = getState();
if (state.dashboard.isCoreRunning) {
clearInterval(timer);
try {
const stats = await apiClient.getGlobalStatsTop();
dispatch(getTopStatsSuccess(stats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTopStatsFailure(error));
}
}
}, 100);
};
</s> add </s> remove return {
id,
data,
};
});
</s> add export const normalizeTopStats = stats => (
stats.map(item => ({
name: Object.keys(item)[0],
count: Object.values(item)[0],
}))
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
}; | <mask> >
<mask> <Trans>{buttonText}</Trans>
<mask> </button>
<mask> );
<mask> }
<mask>
<mask> render() {
<mask> const { dashboard, t } = this.props;
<mask> const dashboardProcessing =
<mask> dashboard.processing ||
</s> + client: handle the new statistics format </s> remove const { dashboard, t } = this.props;
</s> add const { dashboard, stats, t } = this.props; </s> remove dashboard.processingStats ||
dashboard.processingStatsHistory ||
</s> add </s> remove return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
</s> add return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />;
}, </s> remove <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}>
</s> add <Card
title={t('stats_query_domain')}
subtitle={subtitle}
bodyType="card-table"
refresh={refreshButton}
> </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}>
</s> add <Card
title={t('top_clients')}
subtitle={subtitle}
bodyType="card-table"
refresh={refreshButton}
> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
const { dashboard, stats, t } = this.props; | <mask> );
<mask> }
<mask>
<mask> render() {
<mask> const { dashboard, t } = this.props;
<mask> const dashboardProcessing =
<mask> dashboard.processing ||
<mask> dashboard.processingStats ||
<mask> dashboard.processingStatsHistory ||
<mask> dashboard.processingClients ||
</s> + client: handle the new statistics format </s> remove dashboard.processingStats ||
dashboard.processingStatsHistory ||
</s> add </s> remove }
</s> add }; </s> remove dashboard.processingTopStats;
</s> add stats.processingStats ||
stats.processingGetConfig;
const subtitle =
stats.interval === 1
? t('for_last_24_hours')
: t('for_last_days', { value: stats.interval }); </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: ({ value }) => {
const clientName = getClientName(this.props.clients, value)
|| getClientName(this.props.autoClients, value);
let client;
</s> add columns = [
{
Header: 'IP',
accessor: 'ip',
Cell: ({ value }) => {
const clientName =
getClientName(this.props.clients, value) ||
getClientName(this.props.autoClients, value);
let client; </s> remove if (clientName) {
client = <span>{clientName} <small>({value})</small></span>;
} else {
client = value;
}
</s> add if (clientName) {
client = (
<span>
{clientName} <small>({value})</small>
</span>
);
} else {
client = value;
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
<mask> render() {
<mask> const { dashboard, t } = this.props;
<mask> const dashboardProcessing =
<mask> dashboard.processing ||
<mask> dashboard.processingStats ||
<mask> dashboard.processingStatsHistory ||
<mask> dashboard.processingClients ||
<mask> dashboard.processingTopStats;
<mask>
<mask> const refreshFullButton = (
<mask> <button
</s> + client: handle the new statistics format </s> remove const { dashboard, t } = this.props;
</s> add const { dashboard, stats, t } = this.props; </s> remove dashboard.processingTopStats;
</s> add stats.processingStats ||
stats.processingGetConfig;
const subtitle =
stats.interval === 1
? t('for_last_24_hours')
: t('for_last_days', { value: stats.interval }); </s> remove }
</s> add }; </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: ({ value }) => {
const clientName = getClientName(this.props.clients, value)
|| getClientName(this.props.autoClients, value);
let client;
</s> add columns = [
{
Header: 'IP',
accessor: 'ip',
Cell: ({ value }) => {
const clientName =
getClientName(this.props.clients, value) ||
getClientName(this.props.autoClients, value);
let client; </s> remove if (clientName) {
client = <span>{clientName} <small>({value})</small></span>;
} else {
client = value;
}
</s> add if (clientName) {
client = (
<span>
{clientName} <small>({value})</small>
</span>
);
} else {
client = value;
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
|
stats.processingStats ||
stats.processingGetConfig;
const subtitle =
stats.interval === 1
? t('for_last_24_hours')
: t('for_last_days', { value: stats.interval }); | <mask> dashboard.processing ||
<mask> dashboard.processingStats ||
<mask> dashboard.processingStatsHistory ||
<mask> dashboard.processingClients ||
<mask> dashboard.processingTopStats;
<mask>
<mask> const refreshFullButton = (
<mask> <button
<mask> type="button"
<mask> className="btn btn-outline-primary btn-sm"
</s> + client: handle the new statistics format </s> remove dashboard.processingStats ||
dashboard.processingStatsHistory ||
</s> add </s> remove const { dashboard, t } = this.props;
</s> add const { dashboard, stats, t } = this.props; </s> remove }
</s> add }; </s> remove {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
{!dashboard.processingTopStats && !dashboard.processingClients && (
</s> add {(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: ({ value }) => {
const clientName = getClientName(this.props.clients, value)
|| getClientName(this.props.autoClients, value);
let client;
</s> add columns = [
{
Header: 'IP',
accessor: 'ip',
Cell: ({ value }) => {
const clientName =
getClientName(this.props.clients, value) ||
getClientName(this.props.autoClients, value);
let client; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
<PageTitle title={t('dashboard')}> | <mask> );
<mask>
<mask> return (
<mask> <Fragment>
<mask> <PageTitle title={ t('dashboard') }>
<mask> <div className="page-title__actions">
<mask> {this.getToggleFilteringButton()}
<mask> {refreshFullButton}
<mask> </div>
<mask> </PageTitle>
</s> + client: handle the new statistics format </s> remove {!dashboardProcessing &&
</s> add {!dashboardProcessing && ( </s> remove {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
{!dashboard.processingTopStats && !dashboard.processingClients && (
</s> add {(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
{!dashboardProcessing && ( | <mask> {refreshFullButton}
<mask> </div>
<mask> </PageTitle>
<mask> {dashboardProcessing && <Loading />}
<mask> {!dashboardProcessing &&
<mask> <div className="row row-cards">
<mask> {dashboard.statsHistory &&
<mask> <div className="col-lg-12">
<mask> <Statistics
<mask> history={dashboard.statsHistory}
</s> + client: handle the new statistics format </s> remove {dashboard.statsHistory &&
<div className="col-lg-12">
<Statistics
history={dashboard.statsHistory}
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
}
</s> add <div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> </s> remove {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
{!dashboard.processingTopStats && !dashboard.processingClients && (
</s> add {(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} </s> remove <PageTitle title={ t('dashboard') }>
</s> add <PageTitle title={t('dashboard')}> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
<div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> | <mask> </PageTitle>
<mask> {dashboardProcessing && <Loading />}
<mask> {!dashboardProcessing &&
<mask> <div className="row row-cards">
<mask> {dashboard.statsHistory &&
<mask> <div className="col-lg-12">
<mask> <Statistics
<mask> history={dashboard.statsHistory}
<mask> refreshButton={refreshButton}
<mask> dnsQueries={dashboard.stats.dns_queries}
<mask> blockedFiltering={dashboard.stats.blocked_filtering}
<mask> replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
<mask> replacedParental={dashboard.stats.replaced_parental}
<mask> />
<mask> </div>
<mask> }
<mask> <div className="col-lg-6">
<mask> {dashboard.stats &&
<mask> <Counters
<mask> refreshButton={refreshButton}
<mask> dnsQueries={dashboard.stats.dns_queries}
</s> + client: handle the new statistics format </s> remove {!dashboardProcessing &&
</s> add {!dashboardProcessing && ( </s> remove {dashboard.stats &&
<Counters
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
replacedSafesearch={dashboard.stats.replaced_safesearch}
avgProcessingTime={dashboard.stats.avg_processing_time}
/>
}
</s> add <BlockedDomains
subtitle={subtitle}
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/> </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
{!dashboard.processingTopStats && !dashboard.processingClients && (
</s> add {(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
<BlockedDomains
subtitle={subtitle}
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/> | <mask> />
<mask> </div>
<mask> }
<mask> <div className="col-lg-6">
<mask> {dashboard.stats &&
<mask> <Counters
<mask> refreshButton={refreshButton}
<mask> dnsQueries={dashboard.stats.dns_queries}
<mask> blockedFiltering={dashboard.stats.blocked_filtering}
<mask> replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
<mask> replacedParental={dashboard.stats.replaced_parental}
<mask> replacedSafesearch={dashboard.stats.replaced_safesearch}
<mask> avgProcessingTime={dashboard.stats.avg_processing_time}
<mask> />
<mask> }
<mask> </div>
<mask> {dashboard.topStats &&
<mask> <Fragment>
<mask> <div className="col-lg-6">
<mask> <Clients
</s> + client: handle the new statistics format </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove {dashboard.statsHistory &&
<div className="col-lg-12">
<Statistics
history={dashboard.statsHistory}
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
}
</s> add <div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} </s> remove {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
{!dashboard.processingTopStats && !dashboard.processingClients && (
</s> add {(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
<mask> avgProcessingTime={dashboard.stats.avg_processing_time}
<mask> />
<mask> }
<mask> </div>
<mask> {dashboard.topStats &&
<mask> <Fragment>
<mask> <div className="col-lg-6">
<mask> <Clients
<mask> dnsQueries={dashboard.stats.dns_queries}
<mask> refreshButton={refreshButton}
<mask> topClients={dashboard.topStats.top_clients}
<mask> clients={dashboard.clients}
<mask> autoClients={dashboard.autoClients}
<mask> />
<mask> </div>
<mask> <div className="col-lg-6">
<mask> <QueriedDomains
<mask> dnsQueries={dashboard.stats.dns_queries}
<mask> refreshButton={refreshButton}
<mask> topQueriedDomains={dashboard.topStats.top_queried_domains}
<mask> />
<mask> </div>
<mask> <div className="col-lg-6">
<mask> <BlockedDomains
<mask> refreshButton={refreshButton}
<mask> topBlockedDomains={dashboard.topStats.top_blocked_domains}
<mask> blockedFiltering={dashboard.stats.blocked_filtering}
<mask> replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
<mask> replacedParental={dashboard.stats.replaced_parental}
<mask> />
<mask> </div>
<mask> </Fragment>
<mask> }
<mask> </div>
<mask> }
<mask> </Fragment>
<mask> );
<mask> }
</s> + client: handle the new statistics format </s> remove {dashboard.stats &&
<Counters
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
replacedSafesearch={dashboard.stats.replaced_safesearch}
avgProcessingTime={dashboard.stats.avg_processing_time}
/>
}
</s> add <BlockedDomains
subtitle={subtitle}
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/> </s> remove {dashboard.statsHistory &&
<div className="col-lg-12">
<Statistics
history={dashboard.statsHistory}
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
}
</s> add <div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> </s> remove }
</s> add )} </s> remove topStats={dashboard.topStats}
</s> add topClients={stats.topClients} </s> remove <Line data={parentalData} color={STATUS_COLORS.yellow}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedParental,
interval,
'replacedParental',
)}
color={STATUS_COLORS.yellow}
/> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
|
)} | <mask> </div>
<mask> </Fragment>
<mask> }
<mask> </div>
<mask> }
<mask> </Fragment>
<mask> );
<mask> }
<mask> }
<mask>
</s> + client: handle the new statistics format </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove topStats={dashboard.topStats}
</s> add topClients={stats.topClients} </s> remove {dashboard.stats &&
<Counters
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
replacedSafesearch={dashboard.stats.replaced_safesearch}
avgProcessingTime={dashboard.stats.avg_processing_time}
/>
}
</s> add <BlockedDomains
subtitle={subtitle}
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/> </s> remove return (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{client}
</span>
</div>
);
</s> add return (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{client}
</span>
</div>
);
},
sortMethod: (a, b) =>
parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
dashboard: PropTypes.object.isRequired,
stats: PropTypes.object.isRequired,
getStats: PropTypes.func.isRequired,
getStatsConfig: PropTypes.func.isRequired,
toggleProtection: PropTypes.func.isRequired,
getClients: PropTypes.func.isRequired,
t: PropTypes.func.isRequired, | <mask> }
<mask> }
<mask>
<mask> Dashboard.propTypes = {
<mask> getStats: PropTypes.func,
<mask> getStatsHistory: PropTypes.func,
<mask> getTopStats: PropTypes.func,
<mask> dashboard: PropTypes.object,
<mask> isCoreRunning: PropTypes.bool,
<mask> getFiltering: PropTypes.func,
<mask> toggleProtection: PropTypes.func,
<mask> getClients: PropTypes.func,
<mask> processingProtection: PropTypes.bool,
<mask> t: PropTypes.func,
<mask> };
<mask>
<mask> export default withNamespaces()(Dashboard);
</s> + client: handle the new statistics format </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, </s> remove topQueriedDomains: PropTypes.object.isRequired,
</s> add topQueriedDomains: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, </s> remove topBlockedDomains: PropTypes.object.isRequired,
</s> add topBlockedDomains: PropTypes.array.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Dashboard/index.js |
if (stats) {
const statsForCurrentIP = stats.find(item => item.name === ip);
return statsForCurrentIP && statsForCurrentIP.count; | <mask> };
<mask> };
<mask>
<mask> getStats = (ip, stats) => {
<mask> if (stats && stats.top_clients) {
<mask> return stats.top_clients[ip];
<mask> }
<mask>
<mask> return '';
<mask> };
<mask>
</s> + client: handle the new statistics format </s> remove if (stats && stats.top_clients) {
return stats.top_clients[ip];
</s> add if (stats) {
const statsForCurrentIP = stats.find(item => item.name === ip);
return statsForCurrentIP && statsForCurrentIP.count; </s> remove }
</s> add }; </s> remove }
</s> add }; </s> remove const dayAgo = subHours(Date.now(), 24);
const data = history[key].map((item, index) => {
const formatHour = dateFormat(addHours(dayAgo, index), 'ddd HH:00');
const roundValue = round(item, 2);
return {
x: formatHour,
y: roundValue,
};
});
</s> add const daysAgo = subDays(Date.now(), interval - 1);
return history.map((item, index) => ({
x: dateFormat(addDays(daysAgo, index), 'D MMM YYYY'),
y: round(item, 2),
}));
}; </s> remove export const getStatsRequest = createAction('GET_STATS_REQUEST');
export const getStatsFailure = createAction('GET_STATS_FAILURE');
export const getStatsSuccess = createAction('GET_STATS_SUCCESS');
export const getStats = () => async (dispatch) => {
dispatch(getStatsRequest());
try {
const stats = await apiClient.getGlobalStats();
const processedStats = {
...stats,
avg_processing_time: round(stats.avg_processing_time, 2),
};
dispatch(getStatsSuccess(processedStats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsFailure());
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/AutoClients.js |
Header: this.props.t('requests_count'), | <mask> accessor: 'source',
<mask> Cell: this.cellWrap,
<mask> },
<mask> {
<mask> Header: this.props.t('table_statistics'),
<mask> accessor: 'statistics',
<mask> Cell: (row) => {
<mask> const clientIP = row.original.ip;
<mask> const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
<mask>
</s> + client: handle the new statistics format </s> remove Header: this.props.t('table_statistics'),
</s> add Header: this.props.t('requests_count'), </s> remove const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
</s> add const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); </s> remove const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
</s> add const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value);
</s> add columns = [
{
Header: <Trans>domain</Trans>,
accessor: 'domain',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value); </s> remove }, {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
</s> add {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/AutoClients.js |
const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); | <mask> Header: this.props.t('table_statistics'),
<mask> accessor: 'statistics',
<mask> Cell: (row) => {
<mask> const clientIP = row.original.ip;
<mask> const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
<mask>
<mask> if (clientStats) {
<mask> return (
<mask> <div className="logs__row">
<mask> <div className="logs__text" title={clientStats}>
</s> + client: handle the new statistics format </s> remove const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
</s> add const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); </s> remove Header: this.props.t('table_statistics'),
</s> add Header: this.props.t('requests_count'), </s> remove Header: this.props.t('table_statistics'),
</s> add Header: this.props.t('requests_count'), </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value);
</s> add columns = [
{
Header: <Trans>domain</Trans>,
accessor: 'domain',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value); </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value);
</s> add columns = [
{
Header: <Trans>domain</Trans>,
accessor: 'domain',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/AutoClients.js |
topClients: PropTypes.array.isRequired, | <mask>
<mask> AutoClients.propTypes = {
<mask> t: PropTypes.func.isRequired,
<mask> autoClients: PropTypes.array.isRequired,
<mask> topStats: PropTypes.object.isRequired,
<mask> };
<mask>
<mask> export default withNamespaces()(AutoClients);
</s> + client: handle the new statistics format </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, </s> remove topClients: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove getStats: PropTypes.func,
getStatsHistory: PropTypes.func,
getTopStats: PropTypes.func,
dashboard: PropTypes.object,
isCoreRunning: PropTypes.bool,
getFiltering: PropTypes.func,
toggleProtection: PropTypes.func,
getClients: PropTypes.func,
processingProtection: PropTypes.bool,
t: PropTypes.func,
</s> add dashboard: PropTypes.object.isRequired,
stats: PropTypes.object.isRequired,
getStats: PropTypes.func.isRequired,
getStatsConfig: PropTypes.func.isRequired,
toggleProtection: PropTypes.func.isRequired,
getClients: PropTypes.func.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/AutoClients.js |
if (stats) {
const statsForCurrentIP = stats.find(item => item.name === ip);
return statsForCurrentIP && statsForCurrentIP.count; | <mask> };
<mask> };
<mask>
<mask> getStats = (ip, stats) => {
<mask> if (stats && stats.top_clients) {
<mask> return stats.top_clients[ip];
<mask> }
<mask>
<mask> return '';
<mask> };
<mask>
</s> + client: handle the new statistics format | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/ClientsTable.js |
Header: this.props.t('requests_count'), | <mask> );
<mask> },
<mask> },
<mask> {
<mask> Header: this.props.t('table_statistics'),
<mask> accessor: 'statistics',
<mask> Cell: (row) => {
<mask> const clientIP = row.original.ip;
<mask> const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
<mask>
</s> + client: handle the new statistics format </s> remove Header: this.props.t('table_statistics'),
</s> add Header: this.props.t('requests_count'), </s> remove const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
</s> add const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); </s> remove const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
</s> add const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); </s> remove }, {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
</s> add {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent); </s> remove }, {
Header: <Trans>requests_count</Trans>,
accessor: 'domain',
maxWidth: 190,
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
</s> add {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/ClientsTable.js |
const clientStats = clientIP && this.getStats(clientIP, this.props.topClients); | <mask> Header: this.props.t('table_statistics'),
<mask> accessor: 'statistics',
<mask> Cell: (row) => {
<mask> const clientIP = row.original.ip;
<mask> const clientStats = clientIP && this.getStats(clientIP, this.props.topStats);
<mask>
<mask> if (clientStats) {
<mask> return (
<mask> <div className="logs__row">
<mask> <div className="logs__text" title={clientStats}>
</s> + client: handle the new statistics format | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/ClientsTable.js |
topClients: PropTypes.array.isRequired, | <mask>
<mask> ClientsTable.propTypes = {
<mask> t: PropTypes.func.isRequired,
<mask> clients: PropTypes.array.isRequired,
<mask> topStats: PropTypes.object.isRequired,
<mask> toggleClientModal: PropTypes.func.isRequired,
<mask> deleteClient: PropTypes.func.isRequired,
<mask> addClient: PropTypes.func.isRequired,
<mask> updateClient: PropTypes.func.isRequired,
<mask> isModalOpen: PropTypes.bool.isRequired,
</s> + client: handle the new statistics format </s> remove getTopStats: PropTypes.func.isRequired,
topStats: PropTypes.object,
</s> add getStats: PropTypes.func.isRequired, </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove getStats: PropTypes.func,
getStatsHistory: PropTypes.func,
getTopStats: PropTypes.func,
dashboard: PropTypes.object,
isCoreRunning: PropTypes.bool,
getFiltering: PropTypes.func,
toggleProtection: PropTypes.func,
getClients: PropTypes.func,
processingProtection: PropTypes.bool,
t: PropTypes.func,
</s> add dashboard: PropTypes.object.isRequired,
stats: PropTypes.object.isRequired,
getStats: PropTypes.func.isRequired,
getStatsConfig: PropTypes.func.isRequired,
toggleProtection: PropTypes.func.isRequired,
getClients: PropTypes.func.isRequired,
t: PropTypes.func.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/ClientsTable.js |
this.props.getStats(); | <mask>
<mask> class Clients extends Component {
<mask> componentDidMount() {
<mask> this.props.getClients();
<mask> this.props.getTopStats();
<mask> }
<mask>
<mask> render() {
<mask> const {
<mask> t,
</s> + client: handle the new statistics format </s> remove import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove this.props.getStatsHistory();
this.props.getTopStats();
</s> add this.props.getStatsConfig(); </s> remove columns = [{
Header: 'IP',
accessor: 'ip',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value);
</s> add columns = [
{
Header: <Trans>domain</Trans>,
accessor: 'domain',
Cell: (row) => {
const { value } = row;
const trackerData = getTrackerData(value); </s> remove }
</s> add }; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
stats, | <mask> render() {
<mask> const {
<mask> t,
<mask> dashboard,
<mask> clients,
<mask> addClient,
<mask> updateClient,
<mask> deleteClient,
<mask> toggleClientModal,
</s> + client: handle the new statistics format </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state; </s> remove getTopStats,
</s> add getStats, </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats'; </s> remove this.props.getTopStats();
</s> add this.props.getStats(); | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
{(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( | <mask>
<mask> return (
<mask> <Fragment>
<mask> <PageTitle title={t('client_settings')} />
<mask> {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
<mask> {!dashboard.processingTopStats && !dashboard.processingClients && (
<mask> <Fragment>
<mask> <ClientsTable
<mask> clients={dashboard.clients}
<mask> topStats={dashboard.topStats}
<mask> isModalOpen={clients.isModalOpen}
</s> + client: handle the new statistics format </s> remove topStats={dashboard.topStats}
</s> add topClients={stats.topClients} </s> remove {!dashboardProcessing &&
</s> add {!dashboardProcessing && ( </s> remove <PageTitle title={ t('dashboard') }>
</s> add <PageTitle title={t('dashboard')}> </s> remove {dashboard.stats &&
<Counters
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
replacedSafesearch={dashboard.stats.replaced_safesearch}
avgProcessingTime={dashboard.stats.avg_processing_time}
/>
}
</s> add <BlockedDomains
subtitle={subtitle}
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/> </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
topClients={stats.topClients} | <mask> {!dashboard.processingTopStats && !dashboard.processingClients && (
<mask> <Fragment>
<mask> <ClientsTable
<mask> clients={dashboard.clients}
<mask> topStats={dashboard.topStats}
<mask> isModalOpen={clients.isModalOpen}
<mask> modalClientName={clients.modalClientName}
<mask> modalType={clients.modalType}
<mask> addClient={addClient}
<mask> updateClient={updateClient}
</s> + client: handle the new statistics format </s> remove {(dashboard.processingTopStats || dashboard.processingClients) && <Loading />}
{!dashboard.processingTopStats && !dashboard.processingClients && (
</s> add {(stats.processingStats || dashboard.processingClients) && <Loading />}
{!stats.processingStats && !dashboard.processingClients && ( </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove {dashboard.stats &&
<Counters
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
replacedSafesearch={dashboard.stats.replaced_safesearch}
avgProcessingTime={dashboard.stats.avg_processing_time}
/>
}
</s> add <BlockedDomains
subtitle={subtitle}
topBlockedDomains={stats.topBlockedDomains}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/> </s> remove {!dashboardProcessing &&
</s> add {!dashboardProcessing && ( </s> remove {dashboard.statsHistory &&
<div className="col-lg-12">
<Statistics
history={dashboard.statsHistory}
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
}
</s> add <div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
topClients={stats.topClients} | <mask> processingUpdating={clients.processingUpdating}
<mask> />
<mask> <AutoClients
<mask> autoClients={dashboard.autoClients}
<mask> topStats={dashboard.topStats}
<mask> />
<mask> </Fragment>
<mask> )}
<mask> </Fragment>
<mask> );
</s> + client: handle the new statistics format </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove }
</s> add )} </s> remove <Line data={parentalData} color={STATUS_COLORS.yellow}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedParental,
interval,
'replacedParental',
)}
color={STATUS_COLORS.yellow}
/> </s> remove {dashboard.statsHistory &&
<div className="col-lg-12">
<Statistics
history={dashboard.statsHistory}
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
}
</s> add <div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
stats: PropTypes.object.isRequired, | <mask>
<mask> Clients.propTypes = {
<mask> t: PropTypes.func.isRequired,
<mask> dashboard: PropTypes.object.isRequired,
<mask> clients: PropTypes.object.isRequired,
<mask> toggleClientModal: PropTypes.func.isRequired,
<mask> deleteClient: PropTypes.func.isRequired,
<mask> addClient: PropTypes.func.isRequired,
<mask> updateClient: PropTypes.func.isRequired,
<mask> getClients: PropTypes.func.isRequired,
</s> + client: handle the new statistics format </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove getTopStats: PropTypes.func.isRequired,
topStats: PropTypes.object,
</s> add getStats: PropTypes.func.isRequired, </s> remove getStats: PropTypes.func,
getStatsHistory: PropTypes.func,
getTopStats: PropTypes.func,
dashboard: PropTypes.object,
isCoreRunning: PropTypes.bool,
getFiltering: PropTypes.func,
toggleProtection: PropTypes.func,
getClients: PropTypes.func,
processingProtection: PropTypes.bool,
t: PropTypes.func,
</s> add dashboard: PropTypes.object.isRequired,
stats: PropTypes.object.isRequired,
getStats: PropTypes.func.isRequired,
getStatsConfig: PropTypes.func.isRequired,
toggleProtection: PropTypes.func.isRequired,
getClients: PropTypes.func.isRequired,
t: PropTypes.func.isRequired, </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
getStats: PropTypes.func.isRequired, | <mask> deleteClient: PropTypes.func.isRequired,
<mask> addClient: PropTypes.func.isRequired,
<mask> updateClient: PropTypes.func.isRequired,
<mask> getClients: PropTypes.func.isRequired,
<mask> getTopStats: PropTypes.func.isRequired,
<mask> topStats: PropTypes.object,
<mask> };
<mask>
<mask> export default withNamespaces()(Clients);
</s> + client: handle the new statistics format </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove getStats: PropTypes.func,
getStatsHistory: PropTypes.func,
getTopStats: PropTypes.func,
dashboard: PropTypes.object,
isCoreRunning: PropTypes.bool,
getFiltering: PropTypes.func,
toggleProtection: PropTypes.func,
getClients: PropTypes.func,
processingProtection: PropTypes.bool,
t: PropTypes.func,
</s> add dashboard: PropTypes.object.isRequired,
stats: PropTypes.object.isRequired,
getStats: PropTypes.func.isRequired,
getStatsConfig: PropTypes.func.isRequired,
toggleProtection: PropTypes.func.isRequired,
getClients: PropTypes.func.isRequired,
t: PropTypes.func.isRequired, </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/Clients/index.js |
processing={stats.processingSetConfig} | <mask> </div>
<mask> <div className="col-md-12">
<mask> <StatsConfig
<mask> interval={stats.interval}
<mask> processing={stats.setConfigProcessing}
<mask> setStatsConfig={setStatsConfig}
<mask> />
<mask> </div>
<mask> <div className="col-md-12">
<mask> <Services
</s> + client: handle the new statistics format </s> remove {dashboard.statsHistory &&
<div className="col-lg-12">
<Statistics
history={dashboard.statsHistory}
refreshButton={refreshButton}
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
}
</s> add <div className="col-lg-12">
<Statistics
interval={stats.interval}
dnsQueries={stats.dnsQueries}
blockedFiltering={stats.blockedFiltering}
replacedSafebrowsing={stats.replacedSafebrowsing}
replacedParental={stats.replacedParental}
numDnsQueries={stats.numDnsQueries}
numBlockedFiltering={stats.numBlockedFiltering}
numReplacedSafebrowsing={stats.numReplacedSafebrowsing}
numReplacedParental={stats.numReplacedParental}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Counters
subtitle={subtitle}
interval={stats.interval}
dnsQueries={stats.numDnsQueries}
blockedFiltering={stats.numBlockedFiltering}
replacedSafebrowsing={stats.numReplacedSafebrowsing}
replacedParental={stats.numReplacedParental}
replacedSafesearch={stats.numReplacedSafesearch}
avgProcessingTime={stats.avgProcessingTime}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<Clients
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topClients={stats.topClients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
refreshButton={refreshButton}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
subtitle={subtitle}
dnsQueries={stats.numDnsQueries}
topQueriedDomains={stats.topQueriedDomains}
refreshButton={refreshButton}
/>
</div> </s> remove {dashboard.topStats &&
<Fragment>
<div className="col-lg-6">
<Clients
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topClients={dashboard.topStats.top_clients}
clients={dashboard.clients}
autoClients={dashboard.autoClients}
/>
</div>
<div className="col-lg-6">
<QueriedDomains
dnsQueries={dashboard.stats.dns_queries}
refreshButton={refreshButton}
topQueriedDomains={dashboard.topStats.top_queried_domains}
/>
</div>
<div className="col-lg-6">
<BlockedDomains
refreshButton={refreshButton}
topBlockedDomains={dashboard.topStats.top_blocked_domains}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental}
/>
</div>
</Fragment>
}
</s> add </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/Settings/index.js |
const Line = ({ data, color }) => (
data && | <mask> import { ResponsiveLine } from '@nivo/line';
<mask>
<mask> import './Line.css';
<mask>
<mask> const Line = props => (
<mask> props.data &&
<mask> <ResponsiveLine
<mask> data={props.data}
<mask> margin={{
<mask> top: 15,
<mask> right: 0,
</s> + client: handle the new statistics format </s> remove data={props.data}
</s> add data={data} </s> remove left: 0,
</s> add left: 20, </s> remove import * as actionCreators from '../actions';
</s> add import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; </s> remove import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/ui/Line.js |
data={data} | <mask>
<mask> const Line = props => (
<mask> props.data &&
<mask> <ResponsiveLine
<mask> data={props.data}
<mask> margin={{
<mask> top: 15,
<mask> right: 0,
<mask> bottom: 1,
<mask> left: 0,
</s> + client: handle the new statistics format </s> remove const Line = props => (
props.data &&
</s> add const Line = ({ data, color }) => (
data && </s> remove left: 0,
</s> add left: 20, </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); </s> remove axisBottom={{
tickSize: 0,
tickPadding: 10,
}}
axisLeft={{
tickSize: 0,
tickPadding: 10,
}}
</s> add axisBottom={null}
axisLeft={null} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/ui/Line.js |
left: 20, | <mask> margin={{
<mask> top: 15,
<mask> right: 0,
<mask> bottom: 1,
<mask> left: 0,
<mask> }}
<mask> minY="auto"
<mask> stacked={false}
<mask> curve='linear'
<mask> axisBottom={{
</s> + client: handle the new statistics format </s> remove data={props.data}
</s> add data={data} </s> remove axisBottom={{
tickSize: 0,
tickPadding: 10,
}}
axisLeft={{
tickSize: 0,
tickPadding: 10,
}}
</s> add axisBottom={null}
axisLeft={null} </s> remove const Line = props => (
props.data &&
</s> add const Line = ({ data, color }) => (
data && </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/ui/Line.js |
axisBottom={null}
axisLeft={null} | <mask> }}
<mask> minY="auto"
<mask> stacked={false}
<mask> curve='linear'
<mask> axisBottom={{
<mask> tickSize: 0,
<mask> tickPadding: 10,
<mask> }}
<mask> axisLeft={{
<mask> tickSize: 0,
<mask> tickPadding: 10,
<mask> }}
<mask> enableGridX={false}
<mask> enableGridY={false}
<mask> enableDots={false}
<mask> enableArea={true}
<mask> animate={false}
</s> + client: handle the new statistics format </s> remove left: 0,
</s> add left: 20, </s> remove colorBy={() => (props.color)}
</s> add colorBy={() => (color)} </s> remove data={props.data}
</s> add data={data} </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); </s> remove const Line = props => (
props.data &&
</s> add const Line = ({ data, color }) => (
data && | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/ui/Line.js |
colorBy={() => (color)} | <mask> enableGridY={false}
<mask> enableDots={false}
<mask> enableArea={true}
<mask> animate={false}
<mask> colorBy={() => (props.color)}
<mask> tooltip={slice => (
<mask> <div>
<mask> {slice.data.map(d => (
<mask> <div key={d.serie.id} className="line__tooltip">
<mask> <span className="line__tooltip-text">
</s> + client: handle the new statistics format </s> remove axisBottom={{
tickSize: 0,
tickPadding: 10,
}}
axisLeft={{
tickSize: 0,
tickPadding: 10,
}}
</s> add axisBottom={null}
axisLeft={null} </s> remove return (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{client}
</span>
</div>
);
</s> add return (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{client}
</span>
</div>
);
},
sortMethod: (a, b) =>
parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), </s> remove const Counters = props => (
<Card title={ props.t('general_statistics') } subtitle={ props.t('for_last_24_hours') } bodyType="card-table" refresh={props.refreshButton}>
<table className="table card-table">
<tbody>
<tr>
<td>
<Trans>dns_query</Trans>
<Tooltip text={ props.t('number_of_dns_query_24_hours') } type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{props.dnsQueries}
</span>
</td>
</tr>
<tr>
<td>
<a href="#filters">
<Trans>blocked_by</Trans>
</a>
<Tooltip text={ props.t('number_of_dns_query_blocked_24_hours') } type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{props.blockedFiltering}
</span>
</td>
</tr>
<tr>
<td>
<Trans>stats_malware_phishing</Trans>
<Tooltip text={ props.t('number_of_dns_query_blocked_24_hours_by_sec') } type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{props.replacedSafebrowsing}
</span>
</td>
</tr>
<tr>
<td>
<Trans>stats_adult</Trans>
<Tooltip text={ props.t('number_of_dns_query_blocked_24_hours_adult') } type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{props.replacedParental}
</span>
</td>
</tr>
<tr>
<td>
<Trans>enforced_save_search</Trans>
<Tooltip text={ props.t('number_of_dns_query_to_safe_search') } type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{props.replacedSafesearch}
</span>
</td>
</tr>
<tr>
<td>
<Trans>average_processing_time</Trans>
<Tooltip text={ props.t('average_processing_time_hint') } type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{props.avgProcessingTime}
</span>
</td>
</tr>
</tbody>
</table>
</Card>
);
</s> add const Counters = (props) => {
const {
t,
interval,
refreshButton,
subtitle,
dnsQueries,
blockedFiltering,
replacedSafebrowsing,
replacedParental,
replacedSafesearch,
avgProcessingTime,
} = props;
const tooltipTitle =
interval === 1
? t('number_of_dns_query_24_hours')
: t('number_of_dns_query_days', { value: interval });
return (
<Card
title={t('general_statistics')}
subtitle={subtitle}
bodyType="card-table"
refresh={refreshButton}
>
<table className="table card-table">
<tbody>
<tr>
<td>
<Trans>dns_query</Trans>
<Tooltip text={tooltipTitle} type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">{dnsQueries}</span>
</td>
</tr>
<tr>
<td>
<a href="#filters">
<Trans>blocked_by</Trans>
</a>
<Tooltip
text={t('number_of_dns_query_blocked_24_hours')}
type={tooltipType}
/>
</td>
<td className="text-right">
<span className="text-muted">{blockedFiltering}</span>
</td>
</tr>
<tr>
<td>
<Trans>stats_malware_phishing</Trans>
<Tooltip
text={t('number_of_dns_query_blocked_24_hours_by_sec')}
type={tooltipType}
/>
</td>
<td className="text-right">
<span className="text-muted">{replacedSafebrowsing}</span>
</td>
</tr>
<tr>
<td>
<Trans>stats_adult</Trans>
<Tooltip
text={t('number_of_dns_query_blocked_24_hours_adult')}
type={tooltipType}
/>
</td>
<td className="text-right">
<span className="text-muted">{replacedParental}</span>
</td>
</tr>
<tr>
<td>
<Trans>enforced_save_search</Trans>
<Tooltip
text={t('number_of_dns_query_to_safe_search')}
type={tooltipType}
/>
</td>
<td className="text-right">
<span className="text-muted">{replacedSafesearch}</span>
</td>
</tr>
<tr>
<td>
<Trans>average_processing_time</Trans>
<Tooltip text={t('average_processing_time_hint')} type={tooltipType} />
</td>
<td className="text-right">
<span className="text-muted">
{avgProcessingTime ? `${round(avgProcessingTime, 2)} ms` : 0}
</span>
</td>
</tr>
</tbody>
</table>
</Card>
);
}; </s> remove if (clientName) {
client = <span>{clientName} <small>({value})</small></span>;
} else {
client = value;
}
</s> add if (clientName) {
client = (
<span>
{clientName} <small>({value})</small>
</span>
);
} else {
client = value;
} </s> remove return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</s> add return (
<div className="logs__row">
<div className="logs__text" title={value}>
{value}
</div>
{trackerData && <Popover data={trackerData} />} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/components/ui/Line.js |
import { getClients } from '../actions';
import { getStats } from '../actions/stats'; | <mask> import { connect } from 'react-redux';
<mask> import { getClients, getTopStats } from '../actions';
<mask> import { addClient, updateClient, deleteClient, toggleClientModal } from '../actions/clients';
<mask> import Clients from '../components/Settings/Clients';
<mask>
<mask> const mapStateToProps = (state) => {
<mask> const { dashboard, clients } = state;
</s> + client: handle the new statistics format </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state; </s> remove import * as actionCreators from '../actions';
</s> add import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
</s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> remove import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Clients.js |
const { dashboard, clients, stats } = state; | <mask> import { addClient, updateClient, deleteClient, toggleClientModal } from '../actions/clients';
<mask> import Clients from '../components/Settings/Clients';
<mask>
<mask> const mapStateToProps = (state) => {
<mask> const { dashboard, clients } = state;
<mask> const props = {
<mask> dashboard,
<mask> clients,
<mask> };
<mask> return props;
</s> + client: handle the new statistics format </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats'; </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove import * as actionCreators from '../actions';
</s> add import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Clients.js |
stats, | <mask> const props = {
<mask> dashboard,
<mask> clients,
<mask> };
<mask> return props;
<mask> };
<mask>
</s> + client: handle the new statistics format </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state; </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove }
</s> add }; </s> remove const { dashboard, t } = this.props;
</s> add const { dashboard, stats, t } = this.props; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Clients.js |
getStats, | <mask> };
<mask>
<mask> const mapDispatchToProps = {
<mask> getClients,
<mask> getTopStats,
<mask> addClient,
<mask> updateClient,
<mask> deleteClient,
<mask> toggleClientModal,
<mask> };
</s> + client: handle the new statistics format </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state; </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats'; </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Clients.js |
import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; | <mask> import { connect } from 'react-redux';
<mask> import * as actionCreators from '../actions';
<mask> import Dashboard from '../components/Dashboard';
<mask>
<mask> const mapStateToProps = (state) => {
<mask> const { dashboard } = state;
<mask> const props = { dashboard };
</s> + client: handle the new statistics format </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats'; </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state; </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
</s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; | [
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Dashboard.js |
const { dashboard, stats } = state;
const props = { dashboard, stats }; | <mask> import * as actionCreators from '../actions';
<mask> import Dashboard from '../components/Dashboard';
<mask>
<mask> const mapStateToProps = (state) => {
<mask> const { dashboard } = state;
<mask> const props = { dashboard };
<mask> return props;
<mask> };
<mask>
<mask> export default connect(
<mask> mapStateToProps,
</s> + client: handle the new statistics format </s> remove import * as actionCreators from '../actions';
</s> add import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state; </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Dashboard.js |
const mapDispatchToProps = {
toggleProtection,
getClients,
getStats,
getStatsConfig,
setStatsConfig,
};
| <mask> };
<mask>
<mask> export default connect(
<mask> mapStateToProps,
<mask> mapDispatchToProps,
<mask> )(Dashboard);
</s> + client: handle the new statistics format </s> remove actionCreators,
</s> add mapDispatchToProps, </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Dashboard.js |
mapDispatchToProps, | <mask> };
<mask>
<mask> export default connect(
<mask> mapStateToProps,
<mask> actionCreators,
<mask> )(Dashboard);
</s> + client: handle the new statistics format </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove topStats: PropTypes.object.isRequired,
</s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/containers/Dashboard.js |
import addDays from 'date-fns/add_days';
import subDays from 'date-fns/sub_days'; | <mask> import subHours from 'date-fns/sub_hours';
<mask> import addHours from 'date-fns/add_hours';
<mask> import round from 'lodash/round';
<mask> import axios from 'axios';
<mask>
<mask> import {
<mask> STANDARD_DNS_PORT,
</s> + client: handle the new statistics format </s> remove STATS_NAMES,
</s> add </s> remove import round from 'lodash/round';
</s> add </s> remove import subHours from 'date-fns/sub_hours';
import dateFormat from 'date-fns/format';
</s> add </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
</s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/helpers/helpers.js |
<mask> import round from 'lodash/round';
<mask> import axios from 'axios';
<mask>
<mask> import {
<mask> STATS_NAMES,
<mask> STANDARD_DNS_PORT,
<mask> STANDARD_WEB_PORT,
<mask> STANDARD_HTTPS_PORT,
<mask> CHECK_TIMEOUT,
<mask> } from './constants';
</s> + client: handle the new statistics format </s> remove import round from 'lodash/round';
</s> add </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
</s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> remove import subHours from 'date-fns/sub_hours';
import dateFormat from 'date-fns/format';
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/helpers/helpers.js |
|
export const normalizeHistory = (history, interval) => {
if (interval === 1 || interval === 7) {
const hoursAgo = subHours(Date.now(), 24 * interval);
return history.map((item, index) => ({
x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'),
y: round(item, 2),
})); | <mask> status,
<mask> };
<mask> });
<mask>
<mask> export const normalizeHistory = history => Object.keys(history).map((key) => {
<mask> let id = STATS_NAMES[key];
<mask> if (!id) {
<mask> id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase());
<mask> }
<mask>
<mask> const dayAgo = subHours(Date.now(), 24);
<mask>
<mask> const data = history[key].map((item, index) => {
</s> + client: handle the new statistics format </s> remove const dayAgo = subHours(Date.now(), 24);
const data = history[key].map((item, index) => {
const formatHour = dateFormat(addHours(dayAgo, index), 'ddd HH:00');
const roundValue = round(item, 2);
return {
x: formatHour,
y: roundValue,
};
});
</s> add const daysAgo = subDays(Date.now(), interval - 1);
return history.map((item, index) => ({
x: dateFormat(addDays(daysAgo, index), 'D MMM YYYY'),
y: round(item, 2),
}));
}; </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST');
export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE');
export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS');
export const getTopStats = () => async (dispatch, getState) => {
dispatch(getTopStatsRequest());
const timer = setInterval(async () => {
const state = getState();
if (state.dashboard.isCoreRunning) {
clearInterval(timer);
try {
const stats = await apiClient.getGlobalStatsTop();
dispatch(getTopStatsSuccess(stats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTopStatsFailure(error));
}
}
}, 100);
};
</s> add </s> remove return {
id,
data,
};
});
</s> add export const normalizeTopStats = stats => (
stats.map(item => ({
name: Object.keys(item)[0],
count: Object.values(item)[0],
}))
); </s> remove export const getStatsRequest = createAction('GET_STATS_REQUEST');
export const getStatsFailure = createAction('GET_STATS_FAILURE');
export const getStatsSuccess = createAction('GET_STATS_SUCCESS');
export const getStats = () => async (dispatch) => {
dispatch(getStatsRequest());
try {
const stats = await apiClient.getGlobalStats();
const processedStats = {
...stats,
avg_processing_time: round(stats.avg_processing_time, 2),
};
dispatch(getStatsSuccess(processedStats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsFailure());
}
};
</s> add </s> remove export const getStatsHistoryRequest = createAction('GET_STATS_HISTORY_REQUEST');
export const getStatsHistoryFailure = createAction('GET_STATS_HISTORY_FAILURE');
export const getStatsHistorySuccess = createAction('GET_STATS_HISTORY_SUCCESS');
export const getStatsHistory = () => async (dispatch) => {
dispatch(getStatsHistoryRequest());
try {
const statsHistory = await apiClient.getGlobalStatsHistory();
const normalizedHistory = normalizeHistory(statsHistory);
dispatch(getStatsHistorySuccess(normalizedHistory));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsHistoryFailure());
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/helpers/helpers.js |
const daysAgo = subDays(Date.now(), interval - 1);
return history.map((item, index) => ({
x: dateFormat(addDays(daysAgo, index), 'D MMM YYYY'),
y: round(item, 2),
}));
}; | <mask> if (!id) {
<mask> id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase());
<mask> }
<mask>
<mask> const dayAgo = subHours(Date.now(), 24);
<mask>
<mask> const data = history[key].map((item, index) => {
<mask> const formatHour = dateFormat(addHours(dayAgo, index), 'ddd HH:00');
<mask> const roundValue = round(item, 2);
<mask>
<mask> return {
<mask> x: formatHour,
<mask> y: roundValue,
<mask> };
<mask> });
<mask>
<mask> return {
<mask> id,
<mask> data,
<mask> };
</s> + client: handle the new statistics format </s> remove export const normalizeHistory = history => Object.keys(history).map((key) => {
let id = STATS_NAMES[key];
if (!id) {
id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase());
</s> add export const normalizeHistory = (history, interval) => {
if (interval === 1 || interval === 7) {
const hoursAgo = subHours(Date.now(), 24 * interval);
return history.map((item, index) => ({
x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'),
y: round(item, 2),
})); </s> remove return {
id,
data,
};
});
</s> add export const normalizeTopStats = stats => (
stats.map(item => ({
name: Object.keys(item)[0],
count: Object.values(item)[0],
}))
); </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST');
export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE');
export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS');
export const getTopStats = () => async (dispatch, getState) => {
dispatch(getTopStatsRequest());
const timer = setInterval(async () => {
const state = getState();
if (state.dashboard.isCoreRunning) {
clearInterval(timer);
try {
const stats = await apiClient.getGlobalStatsTop();
dispatch(getTopStatsSuccess(stats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTopStatsFailure(error));
}
}
}, 100);
};
</s> add </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats }; </s> remove if (stats && stats.top_clients) {
return stats.top_clients[ip];
</s> add if (stats) {
const statsForCurrentIP = stats.find(item => item.name === ip);
return statsForCurrentIP && statsForCurrentIP.count; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/helpers/helpers.js |
export const normalizeTopStats = stats => (
stats.map(item => ({
name: Object.keys(item)[0],
count: Object.values(item)[0],
}))
); | <mask> y: roundValue,
<mask> };
<mask> });
<mask>
<mask> return {
<mask> id,
<mask> data,
<mask> };
<mask> });
<mask>
<mask> export const normalizeFilteringStatus = (filteringStatus) => {
<mask> const { enabled, filters, user_rules: userRules } = filteringStatus;
<mask> const newFilters = filters ? filters.map((filter) => {
<mask> const {
</s> + client: handle the new statistics format </s> remove const dayAgo = subHours(Date.now(), 24);
const data = history[key].map((item, index) => {
const formatHour = dateFormat(addHours(dayAgo, index), 'ddd HH:00');
const roundValue = round(item, 2);
return {
x: formatHour,
y: roundValue,
};
});
</s> add const daysAgo = subDays(Date.now(), interval - 1);
return history.map((item, index) => ({
x: dateFormat(addDays(daysAgo, index), 'D MMM YYYY'),
y: round(item, 2),
}));
}; </s> remove export const normalizeHistory = history => Object.keys(history).map((key) => {
let id = STATS_NAMES[key];
if (!id) {
id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase());
</s> add export const normalizeHistory = (history, interval) => {
if (interval === 1 || interval === 7) {
const hoursAgo = subHours(Date.now(), 24 * interval);
return history.map((item, index) => ({
x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'),
y: round(item, 2),
})); </s> remove export const getStatsRequest = createAction('GET_STATS_REQUEST');
export const getStatsFailure = createAction('GET_STATS_FAILURE');
export const getStatsSuccess = createAction('GET_STATS_SUCCESS');
export const getStats = () => async (dispatch) => {
dispatch(getStatsRequest());
try {
const stats = await apiClient.getGlobalStats();
const processedStats = {
...stats,
avg_processing_time: round(stats.avg_processing_time, 2),
};
dispatch(getStatsSuccess(processedStats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsFailure());
}
};
</s> add </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST');
export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE');
export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS');
export const getTopStats = () => async (dispatch, getState) => {
dispatch(getTopStatsRequest());
const timer = setInterval(async () => {
const state = getState();
if (state.dashboard.isCoreRunning) {
clearInterval(timer);
try {
const stats = await apiClient.getGlobalStatsTop();
dispatch(getTopStatsSuccess(stats));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTopStatsFailure(error));
}
}
}, 100);
};
</s> add </s> remove export const getStatsHistoryRequest = createAction('GET_STATS_HISTORY_REQUEST');
export const getStatsHistoryFailure = createAction('GET_STATS_HISTORY_FAILURE');
export const getStatsHistorySuccess = createAction('GET_STATS_HISTORY_SUCCESS');
export const getStatsHistory = () => async (dispatch) => {
dispatch(getStatsHistoryRequest());
try {
const statsHistory = await apiClient.getGlobalStatsHistory();
const normalizedHistory = normalizeHistory(statsHistory);
dispatch(getStatsHistorySuccess(normalizedHistory));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getStatsHistoryFailure());
}
};
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/helpers/helpers.js |
<mask> const newState = { ...state, isCoreRunning: !state.isCoreRunning, processing: false };
<mask> return newState;
<mask> },
<mask>
<mask> [actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
<mask> [actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
<mask> [actions.getStatsSuccess]: (state, { payload }) => {
<mask> const newState = { ...state, stats: payload, processingStats: false };
<mask> return newState;
<mask> },
<mask>
<mask> [actions.getTopStatsRequest]: state => ({ ...state, processingTopStats: true }),
<mask> [actions.getTopStatsFailure]: state => ({ ...state, processingTopStats: false }),
<mask> [actions.getTopStatsSuccess]: (state, { payload }) => {
<mask> const newState = { ...state, topStats: payload, processingTopStats: false };
<mask> return newState;
<mask> },
<mask>
<mask> [actions.getStatsHistoryRequest]: state => ({ ...state, processingStatsHistory: true }),
<mask> [actions.getStatsHistoryFailure]: state => ({ ...state, processingStatsHistory: false }),
<mask> [actions.getStatsHistorySuccess]: (state, { payload }) => {
<mask> const newState = { ...state, statsHistory: payload, processingStatsHistory: false };
<mask> return newState;
<mask> },
<mask>
<mask> [actions.toggleLogStatusRequest]: state => ({ ...state, logStatusProcessing: true }),
<mask> [actions.toggleLogStatusFailure]: state => ({ ...state, logStatusProcessing: false }),
<mask> [actions.toggleLogStatusSuccess]: (state) => {
<mask> const { queryLogEnabled } = state;
<mask> return ({ ...state, queryLogEnabled: !queryLogEnabled, logStatusProcessing: false });
</s> + client: handle the new statistics format </s> remove const stats = handleActions({
[actions.getStatsConfigRequest]: state => ({ ...state, getConfigProcessing: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, getConfigProcessing: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
getConfigProcessing: false,
}),
</s> add const stats = handleActions(
{
[actions.getStatsConfigRequest]: state => ({ ...state, processingGetConfig: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, processingGetConfig: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingGetConfig: false,
}), </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); </s> remove topStats: [],
stats: {
dns_queries: '',
blocked_filtering: '',
replaced_safebrowsing: '',
replaced_parental: '',
replaced_safesearch: '',
avg_processing_time: '',
},
</s> add </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10),
}, {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
</s> add {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent); </s> remove }, {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
</s> add {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
maxWidth: 190,
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/reducers/index.js |
|
<mask> },
<mask> }, {
<mask> processing: true,
<mask> isCoreRunning: false,
<mask> processingTopStats: true,
<mask> processingStats: true,
<mask> logStatusProcessing: false,
<mask> processingVersion: true,
<mask> processingFiltering: true,
<mask> processingClients: true,
<mask> processingUpdate: false,
</s> + client: handle the new statistics format </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); </s> remove [actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const newState = { ...state, stats: payload, processingStats: false };
return newState;
},
[actions.getTopStatsRequest]: state => ({ ...state, processingTopStats: true }),
[actions.getTopStatsFailure]: state => ({ ...state, processingTopStats: false }),
[actions.getTopStatsSuccess]: (state, { payload }) => {
const newState = { ...state, topStats: payload, processingTopStats: false };
return newState;
},
[actions.getStatsHistoryRequest]: state => ({ ...state, processingStatsHistory: true }),
[actions.getStatsHistoryFailure]: state => ({ ...state, processingStatsHistory: false }),
[actions.getStatsHistorySuccess]: (state, { payload }) => {
const newState = { ...state, statsHistory: payload, processingStatsHistory: false };
return newState;
},
</s> add </s> remove const stats = handleActions({
[actions.getStatsConfigRequest]: state => ({ ...state, getConfigProcessing: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, getConfigProcessing: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
getConfigProcessing: false,
}),
</s> add const stats = handleActions(
{
[actions.getStatsConfigRequest]: state => ({ ...state, processingGetConfig: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, processingGetConfig: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingGetConfig: false,
}), </s> remove {trackerData && <Popover data={trackerData} />}
</div>
);
</s> add );
}, </s> remove {trackerData && <Popover data={trackerData} />}
</div>
);
</s> add );
}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/reducers/index.js |
|
<mask> dnsAddresses: [],
<mask> dnsVersion: '',
<mask> clients: [],
<mask> autoClients: [],
<mask> topStats: [],
<mask> stats: {
<mask> dns_queries: '',
<mask> blocked_filtering: '',
<mask> replaced_safebrowsing: '',
<mask> replaced_parental: '',
<mask> replaced_safesearch: '',
<mask> avg_processing_time: '',
<mask> },
<mask> });
<mask>
<mask> const queryLogs = handleActions({
<mask> [actions.getLogsRequest]: state => ({ ...state, getLogsProcessing: true }),
<mask> [actions.getLogsFailure]: state => ({ ...state, getLogsProcessing: false }),
</s> + client: handle the new statistics format </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); </s> remove [actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const newState = { ...state, stats: payload, processingStats: false };
return newState;
},
[actions.getTopStatsRequest]: state => ({ ...state, processingTopStats: true }),
[actions.getTopStatsFailure]: state => ({ ...state, processingTopStats: false }),
[actions.getTopStatsSuccess]: (state, { payload }) => {
const newState = { ...state, topStats: payload, processingTopStats: false };
return newState;
},
[actions.getStatsHistoryRequest]: state => ({ ...state, processingStatsHistory: true }),
[actions.getStatsHistoryFailure]: state => ({ ...state, processingStatsHistory: false }),
[actions.getStatsHistorySuccess]: (state, { payload }) => {
const newState = { ...state, statsHistory: payload, processingStatsHistory: false };
return newState;
},
</s> add </s> remove const stats = handleActions({
[actions.getStatsConfigRequest]: state => ({ ...state, getConfigProcessing: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, getConfigProcessing: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
getConfigProcessing: false,
}),
</s> add const stats = handleActions(
{
[actions.getStatsConfigRequest]: state => ({ ...state, processingGetConfig: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, processingGetConfig: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingGetConfig: false,
}), </s> remove return {
id,
data,
};
});
</s> add export const normalizeTopStats = stats => (
stats.map(item => ({
name: Object.keys(item)[0],
count: Object.values(item)[0],
}))
); </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10),
}, {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
</s> add {
Header: <Trans>requests_count</Trans>,
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/reducers/index.js |
|
const stats = handleActions(
{
[actions.getStatsConfigRequest]: state => ({ ...state, processingGetConfig: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, processingGetConfig: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingGetConfig: false,
}), | <mask> import { handleActions } from 'redux-actions';
<mask>
<mask> import * as actions from '../actions/stats';
<mask>
<mask> const stats = handleActions({
<mask> [actions.getStatsConfigRequest]: state => ({ ...state, getConfigProcessing: true }),
<mask> [actions.getStatsConfigFailure]: state => ({ ...state, getConfigProcessing: false }),
<mask> [actions.getStatsConfigSuccess]: (state, { payload }) => ({
<mask> ...state,
<mask> interval: payload.interval,
<mask> getConfigProcessing: false,
<mask> }),
<mask>
<mask> [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
<mask> [actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
<mask> [actions.setStatsConfigSuccess]: (state, { payload }) => ({
<mask> ...state,
</s> + client: handle the new statistics format </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
setConfigProcessing: false,
}),
}, {
getConfigProcessing: false,
setConfigProcessing: false,
interval: 1,
});
</s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); </s> remove [actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const newState = { ...state, stats: payload, processingStats: false };
return newState;
},
[actions.getTopStatsRequest]: state => ({ ...state, processingTopStats: true }),
[actions.getTopStatsFailure]: state => ({ ...state, processingTopStats: false }),
[actions.getTopStatsSuccess]: (state, { payload }) => {
const newState = { ...state, topStats: payload, processingTopStats: false };
return newState;
},
[actions.getStatsHistoryRequest]: state => ({ ...state, processingStatsHistory: true }),
[actions.getStatsHistoryFailure]: state => ({ ...state, processingStatsHistory: false }),
[actions.getStatsHistorySuccess]: (state, { payload }) => {
const newState = { ...state, statsHistory: payload, processingStatsHistory: false };
return newState;
},
</s> add </s> remove topStats: [],
stats: {
dns_queries: '',
blocked_filtering: '',
replaced_safebrowsing: '',
replaced_parental: '',
replaced_safesearch: '',
avg_processing_time: '',
},
</s> add </s> remove const Line = props => (
props.data &&
</s> add const Line = ({ data, color }) => (
data && </s> remove import * as actionCreators from '../actions';
</s> add import { toggleProtection, getClients } from '../actions';
import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/reducers/stats.js |
[actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }),
[actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }),
[actions.setStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingSetConfig: false,
}),
[actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const {
dns_queries: dnsQueries,
blocked_filtering: blockedFiltering,
replaced_parental: replacedParental,
replaced_safebrowsing: replacedSafebrowsing,
top_blocked_domains: topBlockedDomains,
top_clients: topClients,
top_queried_domains: topQueriedDomains,
num_blocked_filtering: numBlockedFiltering,
num_dns_queries: numDnsQueries,
num_replaced_parental: numReplacedParental,
num_replaced_safebrowsing: numReplacedSafebrowsing,
num_replaced_safesearch: numReplacedSafesearch,
avg_processing_time: avgProcessingTime,
} = payload;
const newState = {
...state,
processingStats: false,
dnsQueries,
blockedFiltering,
replacedParental,
replacedSafebrowsing,
topBlockedDomains,
topClients,
topQueriedDomains,
numBlockedFiltering,
numDnsQueries,
numReplacedParental,
numReplacedSafebrowsing,
numReplacedSafesearch,
avgProcessingTime,
};
return newState;
},
},
{
processingGetConfig: false,
processingSetConfig: false,
processingStats: true,
interval: 1,
dnsQueries: [],
blockedFiltering: [],
replacedParental: [],
replacedSafebrowsing: [],
topBlockedDomains: [],
topClients: [],
topQueriedDomains: [],
numBlockedFiltering: 0,
numDnsQueries: 0,
numReplacedParental: 0,
numReplacedSafebrowsing: 0,
numReplacedSafesearch: 0,
avgProcessingTime: 0,
},
); | <mask> interval: payload.interval,
<mask> getConfigProcessing: false,
<mask> }),
<mask>
<mask> [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }),
<mask> [actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }),
<mask> [actions.setStatsConfigSuccess]: (state, { payload }) => ({
<mask> ...state,
<mask> interval: payload.interval,
<mask> setConfigProcessing: false,
<mask> }),
<mask> }, {
<mask> getConfigProcessing: false,
<mask> setConfigProcessing: false,
<mask> interval: 1,
<mask> });
<mask>
<mask> export default stats;
</s> + client: handle the new statistics format </s> remove const stats = handleActions({
[actions.getStatsConfigRequest]: state => ({ ...state, getConfigProcessing: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, getConfigProcessing: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
getConfigProcessing: false,
}),
</s> add const stats = handleActions(
{
[actions.getStatsConfigRequest]: state => ({ ...state, processingGetConfig: true }),
[actions.getStatsConfigFailure]: state => ({ ...state, processingGetConfig: false }),
[actions.getStatsConfigSuccess]: (state, { payload }) => ({
...state,
interval: payload.interval,
processingGetConfig: false,
}), </s> remove [actions.getStatsRequest]: state => ({ ...state, processingStats: true }),
[actions.getStatsFailure]: state => ({ ...state, processingStats: false }),
[actions.getStatsSuccess]: (state, { payload }) => {
const newState = { ...state, stats: payload, processingStats: false };
return newState;
},
[actions.getTopStatsRequest]: state => ({ ...state, processingTopStats: true }),
[actions.getTopStatsFailure]: state => ({ ...state, processingTopStats: false }),
[actions.getTopStatsSuccess]: (state, { payload }) => {
const newState = { ...state, topStats: payload, processingTopStats: false };
return newState;
},
[actions.getStatsHistoryRequest]: state => ({ ...state, processingStatsHistory: true }),
[actions.getStatsHistoryFailure]: state => ({ ...state, processingStatsHistory: false }),
[actions.getStatsHistorySuccess]: (state, { payload }) => {
const newState = { ...state, statsHistory: payload, processingStatsHistory: false };
return newState;
},
</s> add </s> remove topStats: [],
stats: {
dns_queries: '',
blocked_filtering: '',
replaced_safebrowsing: '',
replaced_parental: '',
replaced_safesearch: '',
avg_processing_time: '',
},
</s> add </s> remove processingTopStats: true,
processingStats: true,
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f | client/src/reducers/stats.js |
const TABLE_DEFAULT_PAGE_SIZE = 100; | <mask> import Tooltip from '../ui/Tooltip';
<mask> import './Logs.css';
<mask>
<mask> const TABLE_FIRST_PAGE = 0;
<mask> const TABLE_DEFAULT_PAGE_SIZE = 50;
<mask> const INITIAL_REQUEST_DATA = ['', DEFAULT_LOGS_FILTER, TABLE_FIRST_PAGE, TABLE_DEFAULT_PAGE_SIZE];
<mask> const FILTERED_REASON = 'Filtered';
<mask> const RESPONSE_FILTER = {
<mask> ALL: 'all',
<mask> FILTERED: 'filtered',
</s> + client: hide page size option and page info </s> remove renderTotalPagesCount={this.showTotalPagesCount}
</s> add pageText={''}
ofText={''}
renderCurrentPage={() => false}
renderTotalPagesCount={() => false} </s> remove pageText={t('page_table_footer_text')}
ofText={t('of_table_footer_text')}
</s> add </s> remove showPagination={true}
</s> add | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b64d393bdcf89d5d9aa1a83b062a46b74caccef | client/src/components/Logs/index.js |
showPagination={true} | <mask> data={logs || []}
<mask> loading={isLoading}
<mask> showPageJump={false}
<mask> showPageSizeOptions={false}
<mask> onFetchData={this.fetchData}
<mask> onFilteredChange={this.handleFilterChange}
<mask> className="logs__table"
</s> + client: hide page size option and page info </s> remove renderTotalPagesCount={this.showTotalPagesCount}
</s> add pageText={''}
ofText={''}
renderCurrentPage={() => false}
renderTotalPagesCount={() => false} </s> remove pageText={t('page_table_footer_text')}
ofText={t('of_table_footer_text')}
</s> add </s> remove showPagination={true}
</s> add </s> remove const TABLE_DEFAULT_PAGE_SIZE = 50;
</s> add const TABLE_DEFAULT_PAGE_SIZE = 100; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b64d393bdcf89d5d9aa1a83b062a46b74caccef | client/src/components/Logs/index.js |
showPageSizeOptions={false} | <mask> loading={isLoading}
<mask> showPagination={true}
<mask> showPageJump={false}
<mask> onFetchData={this.fetchData}
<mask> onFilteredChange={this.handleFilterChange}
<mask> className="logs__table"
<mask> defaultPageSize={TABLE_DEFAULT_PAGE_SIZE}
</s> + client: hide page size option and page info </s> remove renderTotalPagesCount={this.showTotalPagesCount}
</s> add pageText={''}
ofText={''}
renderCurrentPage={() => false}
renderTotalPagesCount={() => false} </s> remove pageText={t('page_table_footer_text')}
ofText={t('of_table_footer_text')}
</s> add </s> remove showPagination={true}
</s> add </s> remove const TABLE_DEFAULT_PAGE_SIZE = 50;
</s> add const TABLE_DEFAULT_PAGE_SIZE = 100; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b64d393bdcf89d5d9aa1a83b062a46b74caccef | client/src/components/Logs/index.js |
<mask> showPageJump={false}
<mask> onFetchData={this.fetchData}
<mask> onFilteredChange={this.handleFilterChange}
<mask> className="logs__table"
<mask> showPagination={true}
<mask> defaultPageSize={TABLE_DEFAULT_PAGE_SIZE}
<mask> previousText={t('previous_btn')}
<mask> nextText={t('next_btn')}
<mask> loadingText={t('loading_table_status')}
<mask> pageText={t('page_table_footer_text')}
</s> + client: hide page size option and page info </s> remove pageText={t('page_table_footer_text')}
ofText={t('of_table_footer_text')}
</s> add </s> remove renderTotalPagesCount={this.showTotalPagesCount}
</s> add pageText={''}
ofText={''}
renderCurrentPage={() => false}
renderTotalPagesCount={() => false} </s> remove const TABLE_DEFAULT_PAGE_SIZE = 50;
</s> add const TABLE_DEFAULT_PAGE_SIZE = 100; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b64d393bdcf89d5d9aa1a83b062a46b74caccef | client/src/components/Logs/index.js |
|
<mask> defaultPageSize={TABLE_DEFAULT_PAGE_SIZE}
<mask> previousText={t('previous_btn')}
<mask> nextText={t('next_btn')}
<mask> loadingText={t('loading_table_status')}
<mask> pageText={t('page_table_footer_text')}
<mask> ofText={t('of_table_footer_text')}
<mask> rowsText={t('rows_table_footer_text')}
<mask> noDataText={t('no_logs_found')}
<mask> renderTotalPagesCount={this.showTotalPagesCount}
<mask> defaultFilterMethod={(filter, row) => {
<mask> const id = filter.pivotId || filter.id;
</s> + client: hide page size option and page info </s> remove renderTotalPagesCount={this.showTotalPagesCount}
</s> add pageText={''}
ofText={''}
renderCurrentPage={() => false}
renderTotalPagesCount={() => false} </s> remove showPagination={true}
</s> add </s> remove const TABLE_DEFAULT_PAGE_SIZE = 50;
</s> add const TABLE_DEFAULT_PAGE_SIZE = 100; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b64d393bdcf89d5d9aa1a83b062a46b74caccef | client/src/components/Logs/index.js |
|
pageText={''}
ofText={''}
renderCurrentPage={() => false}
renderTotalPagesCount={() => false} | <mask> pageText={t('page_table_footer_text')}
<mask> ofText={t('of_table_footer_text')}
<mask> rowsText={t('rows_table_footer_text')}
<mask> noDataText={t('no_logs_found')}
<mask> renderTotalPagesCount={this.showTotalPagesCount}
<mask> defaultFilterMethod={(filter, row) => {
<mask> const id = filter.pivotId || filter.id;
<mask> return row[id] !== undefined
<mask> ? String(row[id]).indexOf(filter.value) !== -1
<mask> : true;
</s> + client: hide page size option and page info </s> remove pageText={t('page_table_footer_text')}
ofText={t('of_table_footer_text')}
</s> add </s> remove showPagination={true}
</s> add </s> remove const TABLE_DEFAULT_PAGE_SIZE = 50;
</s> add const TABLE_DEFAULT_PAGE_SIZE = 100; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6b64d393bdcf89d5d9aa1a83b062a46b74caccef | client/src/components/Logs/index.js |
"runtime" | <mask> "net/http"
<mask> "os"
<mask> "strings"
<mask> "sync"
<mask> "sync/atomic"
<mask> "time"
<mask>
</s> * dnsfilter: windows: store rules in memory
* dnsfilter: ignore cosmetic rules </s> remove list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, false)
</s> add list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, true) </s> remove IgnoreCosmetic: false,
</s> add IgnoreCosmetic: true,
}
} else if runtime.GOOS == "windows" {
// On Windows we don't pass a file to urlfilter because
// it's difficult to update this file while it's being used.
data, err := ioutil.ReadFile(dataOrFilePath)
if err != nil {
return fmt.Errorf("ioutil.ReadFile(): %s: %s", dataOrFilePath, err)
}
list = &urlfilter.StringRuleList{
ID: id,
RulesText: string(data),
IgnoreCosmetic: true, </s> remove IgnoreCosmetic: false,
</s> add IgnoreCosmetic: true, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ba1d857ac7961ed5a97a85a328398296c520273 | dnsfilter/dnsfilter.go |
IgnoreCosmetic: true, | <mask> if id == 0 {
<mask> list = &urlfilter.StringRuleList{
<mask> ID: 0,
<mask> RulesText: dataOrFilePath,
<mask> IgnoreCosmetic: false,
<mask> }
<mask>
<mask> } else if !fileExists(dataOrFilePath) {
<mask> list = &urlfilter.StringRuleList{
<mask> ID: id,
</s> * dnsfilter: windows: store rules in memory
* dnsfilter: ignore cosmetic rules </s> remove list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, false)
</s> add list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, true) </s> remove IgnoreCosmetic: false,
</s> add IgnoreCosmetic: true,
}
} else if runtime.GOOS == "windows" {
// On Windows we don't pass a file to urlfilter because
// it's difficult to update this file while it's being used.
data, err := ioutil.ReadFile(dataOrFilePath)
if err != nil {
return fmt.Errorf("ioutil.ReadFile(): %s: %s", dataOrFilePath, err)
}
list = &urlfilter.StringRuleList{
ID: id,
RulesText: string(data),
IgnoreCosmetic: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ba1d857ac7961ed5a97a85a328398296c520273 | dnsfilter/dnsfilter.go |
IgnoreCosmetic: true,
}
} else if runtime.GOOS == "windows" {
// On Windows we don't pass a file to urlfilter because
// it's difficult to update this file while it's being used.
data, err := ioutil.ReadFile(dataOrFilePath)
if err != nil {
return fmt.Errorf("ioutil.ReadFile(): %s: %s", dataOrFilePath, err)
}
list = &urlfilter.StringRuleList{
ID: id,
RulesText: string(data),
IgnoreCosmetic: true, | <mask>
<mask> } else if !fileExists(dataOrFilePath) {
<mask> list = &urlfilter.StringRuleList{
<mask> ID: id,
<mask> IgnoreCosmetic: false,
<mask> }
<mask>
<mask> } else {
<mask> var err error
<mask> list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, false)
</s> * dnsfilter: windows: store rules in memory
* dnsfilter: ignore cosmetic rules </s> remove list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, false)
</s> add list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, true) </s> remove IgnoreCosmetic: false,
</s> add IgnoreCosmetic: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ba1d857ac7961ed5a97a85a328398296c520273 | dnsfilter/dnsfilter.go |
list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, true) | <mask> }
<mask>
<mask> } else {
<mask> var err error
<mask> list, err = urlfilter.NewFileRuleList(id, dataOrFilePath, false)
<mask> if err != nil {
<mask> return fmt.Errorf("urlfilter.NewFileRuleList(): %s: %s", dataOrFilePath, err)
<mask> }
<mask> }
<mask> listArray = append(listArray, list)
</s> * dnsfilter: windows: store rules in memory
* dnsfilter: ignore cosmetic rules </s> remove IgnoreCosmetic: false,
</s> add IgnoreCosmetic: true, </s> remove IgnoreCosmetic: false,
</s> add IgnoreCosmetic: true,
}
} else if runtime.GOOS == "windows" {
// On Windows we don't pass a file to urlfilter because
// it's difficult to update this file while it's being used.
data, err := ioutil.ReadFile(dataOrFilePath)
if err != nil {
return fmt.Errorf("ioutil.ReadFile(): %s: %s", dataOrFilePath, err)
}
list = &urlfilter.StringRuleList{
ID: id,
RulesText: string(data),
IgnoreCosmetic: true, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ba1d857ac7961ed5a97a85a328398296c520273 | dnsfilter/dnsfilter.go |
ip4 := ip.To4()
if ip4 == nil {
return nil
}
| <mask>
<mask> s.leasesLock.RLock()
<mask> defer s.leasesLock.RUnlock()
<mask>
<mask> for _, l := range s.leases {
<mask> if l.IP.Equal(ip4) {
<mask> unix := l.Expiry.Unix()
<mask> if unix > now || unix == leaseExpireStatic {
<mask> return l.HWAddr
</s> -(home): fix searching clients by mac address </s> remove if l.Expiry.Unix() > now && l.IP.Equal(ip) {
return l.HWAddr
</s> add if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | dhcpd/dhcpd.go |
if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} | <mask> s.leasesLock.RLock()
<mask> defer s.leasesLock.RUnlock()
<mask>
<mask> for _, l := range s.leases {
<mask> if l.Expiry.Unix() > now && l.IP.Equal(ip) {
<mask> return l.HWAddr
<mask> }
<mask> }
<mask> return nil
<mask> }
<mask>
</s> -(home): fix searching clients by mac address </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | dhcpd/dhcpd.go |
defer func() { _ = os.Remove(dbFilename) }() | <mask> var s = Server{}
<mask> s.conf.DBFilePath = dbFilename
<mask> var p, p2 dhcp4.Packet
<mask> var hw net.HardwareAddr
<mask> var lease *Lease
<mask> var opt dhcp4.Options
</s> -(home): fix searching clients by mac address </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove if l.Expiry.Unix() > now && l.IP.Equal(ip) {
return l.HWAddr
</s> add if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | dhcpd/dhcpd_test.go |
_ = os.Remove("leases.db") | <mask> p.SetCHAddr(hw2)
<mask> lease, _ = s.reserveLease(p)
<mask> lease.Expiry = time.Unix(4000000002, 0)
<mask>
<mask> os.Remove("leases.db")
<mask> s.dbStore()
<mask> s.reset()
<mask>
<mask> s.dbLoad()
<mask> check(t, bytes.Equal(s.leases[0].HWAddr, hw1), "leases[0].HWAddr")
</s> -(home): fix searching clients by mac address </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove if l.Expiry.Unix() > now && l.IP.Equal(ip) {
return l.HWAddr
</s> add if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | dhcpd/dhcpd_test.go |
_ = os.Remove("leases.db") | <mask> check(t, bytes.Equal(s.leases[1].HWAddr, hw2), "leases[1].HWAddr")
<mask> check(t, bytes.Equal(s.leases[1].IP, []byte{1, 1, 1, 2}), "leases[1].IP")
<mask> check(t, s.leases[1].Expiry.Unix() == 4000000002, "leases[1].Expiry")
<mask>
<mask> os.Remove("leases.db")
<mask> }
<mask>
<mask> func TestIsValidSubnetMask(t *testing.T) {
<mask> if !isValidSubnetMask([]byte{255, 255, 255, 0}) {
<mask> t.Fatalf("isValidSubnetMask([]byte{255,255,255,0})")
</s> -(home): fix searching clients by mac address </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove if l.Expiry.Unix() > now && l.IP.Equal(ip) {
return l.HWAddr
</s> add if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | dhcpd/dhcpd_test.go |
"net"
"os" | <mask> package home
<mask>
<mask> import (
<mask> "testing"
<mask> "time"
<mask>
<mask> "github.com/AdguardTeam/AdGuardHome/dhcpd"
</s> -(home): fix searching clients by mac address </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove if l.Expiry.Unix() > now && l.IP.Equal(ip) {
return l.HWAddr
</s> add if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | home/clients_test.go |
"time"
"github.com/AdguardTeam/AdGuardHome/dhcpd" | <mask> "net"
<mask> "os"
<mask> "testing"
<mask>
<mask> "github.com/stretchr/testify/assert"
<mask> )
<mask>
</s> -(home): fix searching clients by mac address </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove os.Remove("leases.db")
</s> add _ = os.Remove("leases.db") </s> remove if l.Expiry.Unix() > now && l.IP.Equal(ip) {
return l.HWAddr
</s> add if l.IP.Equal(ip4) {
unix := l.Expiry.Unix()
if unix > now || unix == leaseExpireStatic {
return l.HWAddr
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6bf512f96fbe5693473a580330ef954fc7457cd2 | home/clients_test.go |
import React, { Component } from 'react'; | <mask> import React from 'react';
<mask> import ReactTable from 'react-table';
<mask> import PropTypes from 'prop-types';
<mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
</s> Add progress bar to the stats tables </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/BlockedDomains.js |
import Cell from '../ui/Cell'; | <mask> import PropTypes from 'prop-types';
<mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
<mask>
<mask> import { getPercent } from '../../helpers/helpers';
<mask> import { STATUS_COLORS } from '../../helpers/constants';
<mask>
<mask> class BlockedDomains extends Component {
</s> Add progress bar to the stats tables </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/BlockedDomains.js |
import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants'; | <mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
<mask>
<mask> const Clients = props => (
<mask> <Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<mask> <ReactTable
<mask> data={map(props.topBlockedDomains, (value, prop) => (
<mask> { ip: prop, domain: value }
<mask> ))}
<mask> columns={[{
<mask> Header: 'IP',
<mask> accessor: 'ip',
<mask> }, {
<mask> Header: 'Domain name',
<mask> accessor: 'domain',
<mask> }]}
<mask> showPagination={false}
<mask> noDataText="No domains found"
<mask> minRows={6}
<mask> className="-striped -highlight card-table-overflow"
<mask> />
<mask> </Card>
<mask> );
<mask>
<mask> Clients.propTypes = {
<mask> topBlockedDomains: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
</s> Add progress bar to the stats tables </s> remove const QueriedDomains = props => (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class QueriedDomains extends Component {
getPercentColor = (percent) => {
if (percent > 10) {
return STATUS_COLORS.red;
} else if (percent > 5) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.green;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} </s> remove const Clients = props => (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove refreshButton: PropTypes.node,
</s> add blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/BlockedDomains.js |
class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { | <mask> />
<mask> </Card>
<mask> );
<mask>
<mask> Clients.propTypes = {
<mask> topBlockedDomains: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
<mask>
<mask> export default Clients;
</s> Add progress bar to the stats tables </s> remove refreshButton: PropTypes.node,
</s> add blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove export default Clients;
</s> add export default BlockedDomains; </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove const Clients = props => (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Domain name',
accessor: 'domain',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/BlockedDomains.js |
blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, | <mask> );
<mask>
<mask> Clients.propTypes = {
<mask> topBlockedDomains: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
<mask>
<mask> export default Clients;
</s> Add progress bar to the stats tables </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove export default Clients;
</s> add export default BlockedDomains; </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove const Clients = props => (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Domain name',
accessor: 'domain',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/BlockedDomains.js |
export default BlockedDomains; | <mask> topBlockedDomains: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
<mask>
<mask> export default Clients;
</s> Add progress bar to the stats tables </s> remove refreshButton: PropTypes.node,
</s> add blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove refreshButton: PropTypes.node,
</s> add refreshButton: PropTypes.node.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/BlockedDomains.js |
import React, { Component } from 'react'; | <mask> import React from 'react';
<mask> import ReactTable from 'react-table';
<mask> import PropTypes from 'prop-types';
<mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
</s> Add progress bar to the stats tables | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/Clients.js |
import Cell from '../ui/Cell'; | <mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
<mask>
<mask> import { getPercent } from '../../helpers/helpers';
<mask> import { STATUS_COLORS } from '../../helpers/constants';
<mask>
<mask> class Clients extends Component {
<mask> getPercentColor = (percent) => {
</s> Add progress bar to the stats tables </s> remove const Clients = props => (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} </s> remove const Clients = props => (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Domain name',
accessor: 'domain',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants'; </s> remove const QueriedDomains = props => (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class QueriedDomains extends Component {
getPercentColor = (percent) => {
if (percent > 10) {
return STATUS_COLORS.red;
} else if (percent > 5) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.green;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/Clients.js |
import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} | <mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
<mask>
<mask> const Clients = props => (
<mask> <Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<mask> <ReactTable
<mask> data={map(props.topClients, (value, prop) => (
<mask> { ip: prop, count: value }
<mask> ))}
<mask> columns={[{
<mask> Header: 'IP',
<mask> accessor: 'ip',
<mask> }, {
<mask> Header: 'Requests count',
<mask> accessor: 'count',
<mask> }]}
<mask> showPagination={false}
<mask> noDataText="No clients found"
<mask> minRows={6}
<mask> className="-striped -highlight card-table-overflow"
<mask> />
<mask> </Card>
<mask> );
<mask>
<mask> Clients.propTypes = {
<mask> topClients: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
</s> Add progress bar to the stats tables </s> remove const QueriedDomains = props => (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class QueriedDomains extends Component {
getPercentColor = (percent) => {
if (percent > 10) {
return STATUS_COLORS.red;
} else if (percent > 5) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.green;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} </s> remove const Clients = props => (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Domain name',
accessor: 'domain',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants'; </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/Clients.js |
dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, | <mask> );
<mask>
<mask> Clients.propTypes = {
<mask> topClients: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
<mask>
<mask> export default Clients;
</s> Add progress bar to the stats tables </s> remove refreshButton: PropTypes.node,
</s> add blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove export default Clients;
</s> add export default BlockedDomains; </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove const Clients = props => (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/Clients.js |
refreshButton: PropTypes.node.isRequired, | <mask> replacedSafebrowsing: PropTypes.number.isRequired,
<mask> replacedParental: PropTypes.number.isRequired,
<mask> replacedSafesearch: PropTypes.number.isRequired,
<mask> avgProcessingTime: PropTypes.number.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
<mask>
<mask> export default Counters;
</s> Add progress bar to the stats tables </s> remove refreshButton: PropTypes.node,
</s> add blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove export default Clients;
</s> add export default BlockedDomains; </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/Counters.js |
import React, { Component } from 'react'; | <mask> import React from 'react';
<mask> import ReactTable from 'react-table';
<mask> import PropTypes from 'prop-types';
<mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
</s> Add progress bar to the stats tables | [
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/QueriedDomains.js |
import Cell from '../ui/Cell'; | <mask> import PropTypes from 'prop-types';
<mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
<mask>
<mask> import { getPercent } from '../../helpers/helpers';
<mask> import { STATUS_COLORS } from '../../helpers/constants';
<mask>
</s> Add progress bar to the stats tables </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; </s> remove import React from 'react';
</s> add import React, { Component } from 'react'; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/QueriedDomains.js |
import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class QueriedDomains extends Component {
getPercentColor = (percent) => {
if (percent > 10) {
return STATUS_COLORS.red;
} else if (percent > 5) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.green;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} | <mask> import map from 'lodash/map';
<mask>
<mask> import Card from '../ui/Card';
<mask>
<mask> const QueriedDomains = props => (
<mask> <Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<mask> <ReactTable
<mask> data={map(props.topQueriedDomains, (value, prop) => (
<mask> { ip: prop, count: value }
<mask> ))}
<mask> columns={[{
<mask> Header: 'IP',
<mask> accessor: 'ip',
<mask> }, {
<mask> Header: 'Requests count',
<mask> accessor: 'count',
<mask> }]}
<mask> showPagination={false}
<mask> noDataText="No domains found"
<mask> minRows={6}
<mask> className="-striped -highlight card-table-overflow"
<mask> />
<mask> </Card>
<mask> );
<mask>
<mask> QueriedDomains.propTypes = {
<mask> topQueriedDomains: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
</s> Add progress bar to the stats tables </s> remove const Clients = props => (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} </s> remove const Clients = props => (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Domain name',
accessor: 'domain',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants'; </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/QueriedDomains.js |
dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, | <mask> );
<mask>
<mask> QueriedDomains.propTypes = {
<mask> topQueriedDomains: PropTypes.object.isRequired,
<mask> refreshButton: PropTypes.node,
<mask> };
<mask>
<mask> export default QueriedDomains;
</s> Add progress bar to the stats tables </s> remove refreshButton: PropTypes.node,
</s> add dnsQueries: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove refreshButton: PropTypes.node,
</s> add blockedFiltering: PropTypes.number.isRequired,
replacedSafebrowsing: PropTypes.number.isRequired,
replacedParental: PropTypes.number.isRequired,
refreshButton: PropTypes.node.isRequired, </s> remove export default Clients;
</s> add export default BlockedDomains; </s> remove const QueriedDomains = props => (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class QueriedDomains extends Component {
getPercentColor = (percent) => {
if (percent > 10) {
return STATUS_COLORS.red;
} else if (percent > 5) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.green;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top queried domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topQueriedDomains, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/QueriedDomains.js |
dnsQueries={dashboard.stats.dns_queries}
blockedFiltering={dashboard.stats.blocked_filtering}
replacedSafebrowsing={dashboard.stats.replaced_safebrowsing}
replacedParental={dashboard.stats.replaced_parental} | <mask> <Statistics
<mask> history={dashboard.statsHistory}
<mask> refreshButton={refreshButton}
<mask> />
<mask> </div>
<mask> }
<mask> <div className="col-lg-6">
</s> Add progress bar to the stats tables </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove const Clients = props => (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/index.js |
dnsQueries={dashboard.stats.dns_queries} | <mask> {dashboard.topStats &&
<mask> <Fragment>
<mask> <div className="col-lg-6">
<mask> <Clients
<mask> refreshButton={refreshButton}
<mask> topClients={dashboard.topStats.top_clients}
<mask> />
<mask> </div>
<mask> <div className="col-lg-6">
<mask> <QueriedDomains
</s> Add progress bar to the stats tables </s> remove export const getPercent = (amount, number) => round(100 / (amount / number));
</s> add export const getPercent = (amount, number) => {
if (amount > 0 && number > 0) {
return round(100 / (amount / number), 2);
}
return 0;
}; </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/index.js |
dnsQueries={dashboard.stats.dns_queries} | <mask> />
<mask> </div>
<mask> <div className="col-lg-6">
<mask> <QueriedDomains
<mask> refreshButton={refreshButton}
<mask> topQueriedDomains={dashboard.topStats.top_queried_domains}
<mask> />
<mask> </div>
<mask> <div className="col-lg-6">
</s> Add progress bar to the stats tables </s> remove Clients.propTypes = {
</s> add class BlockedDomains extends Component {
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'domain',
Cell: ({ value }) => {
const {
blockedFiltering,
replacedSafebrowsing,
replacedParental,
} = this.props;
const blocked = blockedFiltering + replacedSafebrowsing + replacedParental;
const percent = getPercent(blocked, value);
return (
<Cell value={value} percent={percent} color={STATUS_COLORS.red} />
);
},
}];
render() {
return (
<Card title="Top blocked domains" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topBlockedDomains, (value, prop) => (
{ ip: prop, domain: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No domains found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
}
BlockedDomains.propTypes = { </s> remove const Clients = props => (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={props.refreshButton}>
<ReactTable
data={map(props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={[{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
}]}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
</s> add import { getPercent } from '../../helpers/helpers';
import { STATUS_COLORS } from '../../helpers/constants';
class Clients extends Component {
getPercentColor = (percent) => {
if (percent > 50) {
return STATUS_COLORS.green;
} else if (percent > 10) {
return STATUS_COLORS.yellow;
}
return STATUS_COLORS.red;
}
columns = [{
Header: 'IP',
accessor: 'ip',
}, {
Header: 'Requests count',
accessor: 'count',
Cell: ({ value }) => {
const percent = getPercent(this.props.dnsQueries, value);
const percentColor = this.getPercentColor(percent);
return (
<Cell value={value} percent={percent} color={percentColor} />
);
},
}];
render() {
return (
<Card title="Top clients" subtitle="for the last 24 hours" bodyType="card-table" refresh={this.props.refreshButton}>
<ReactTable
data={map(this.props.topClients, (value, prop) => (
{ ip: prop, count: value }
))}
columns={this.columns}
showPagination={false}
noDataText="No clients found"
minRows={6}
className="-striped -highlight card-table-overflow"
/>
</Card>
);
}
} | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | https://github.com/AdguardTeam/AdGuardHome/commit/6ca881ee86f586486fa35205eec7617d27e41a72 | client/src/components/Dashboard/index.js |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.