Merge: - client: block/unblock client without requesting stats
Closes #896 Squashed commit of the following: commit 66b781438aa668a16b19455c3e0dc5100417d869 Author: Ildar Kamalov <i.kamalov@adguard.com> Date: Mon Feb 3 12:59:25 2020 +0300 - client: block/unblock client without requesting stats commit e70f62738d549e32339bae3d5e996a912b99c21d Author: Ildar Kamalov <i.kamalov@adguard.com> Date: Mon Feb 3 12:22:13 2020 +0300 - client: get current access settings before set commit 65c59d1d55f3255f33f917b61b6ab2c6c2e54271 Author: Ildar Kamalov <i.kamalov@adguard.com> Date: Mon Feb 3 12:21:12 2020 +0300 * client: mode svg-url-loader to devDependencies
This commit is contained in:
@@ -2,7 +2,7 @@ import { createAction } from 'redux-actions';
|
||||
|
||||
import apiClient from '../api/Api';
|
||||
import { addErrorToast, addSuccessToast } from './index';
|
||||
import { normalizeTopStats, secondsToMilliseconds, getParamsForClientsSearch, addClientInfo, addClientStatus } from '../helpers/helpers';
|
||||
import { normalizeTopStats, secondsToMilliseconds, getParamsForClientsSearch, addClientInfo } from '../helpers/helpers';
|
||||
|
||||
export const getStatsConfigRequest = createAction('GET_STATS_CONFIG_REQUEST');
|
||||
export const getStatsConfigFailure = createAction('GET_STATS_CONFIG_FAILURE');
|
||||
@@ -46,15 +46,12 @@ export const getStats = () => async (dispatch) => {
|
||||
const normalizedTopClients = normalizeTopStats(stats.top_clients);
|
||||
const clientsParams = getParamsForClientsSearch(normalizedTopClients, 'name');
|
||||
const clients = await apiClient.findClients(clientsParams);
|
||||
const accessData = await apiClient.getAccessList();
|
||||
const { disallowed_clients } = accessData;
|
||||
const topClientsWithInfo = addClientInfo(normalizedTopClients, clients, 'name');
|
||||
const topClientsWithStatus = addClientStatus(topClientsWithInfo, disallowed_clients, 'name');
|
||||
|
||||
const normalizedStats = {
|
||||
...stats,
|
||||
top_blocked_domains: normalizeTopStats(stats.top_blocked_domains),
|
||||
top_clients: topClientsWithStatus,
|
||||
top_clients: topClientsWithInfo,
|
||||
top_queried_domains: normalizeTopStats(stats.top_queried_domains),
|
||||
avg_processing_time: secondsToMilliseconds(stats.avg_processing_time),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user