Merge branch 'master' of ssh://bit.adguard.com:7999/dns/adguard-home

This commit is contained in:
Andrey Meshkov
2020-01-30 19:18:20 +03:00
20 changed files with 274 additions and 78 deletions

View File

@@ -456,3 +456,8 @@ export const DETAILED_DATE_FORMAT_OPTIONS = {
};
export const CUSTOM_FILTERING_RULES_ID = 0;
export const ACTION = {
block: 'block',
unblock: 'unblock',
};

View File

@@ -122,6 +122,17 @@ export const addClientInfo = (data, clients, param) => (
})
);
export const addClientStatus = (data, disallowedClients, param) => (
data.map((row) => {
const clientIp = row[param];
const blocked = !!(disallowedClients && disallowedClients.includes(clientIp));
return {
...row,
blocked,
};
})
);
export const normalizeFilteringStatus = (filteringStatus) => {
const {
enabled, filters, user_rules: userRules, interval,
@@ -275,7 +286,13 @@ export const redirectToCurrentProtocol = (values, httpPort = 80) => {
}
};
export const normalizeTextarea = text => text && text.replace(/[;, ]/g, '\n').split('\n').filter(n => n);
export const normalizeTextarea = (text) => {
if (!text) {
return [];
}
return text.replace(/[;, ]/g, '\n').split('\n').filter(n => n);
};
/**
* Normalizes the topClients array