mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-01 05:31:38 +03:00
- client: sort clients table by requests count by default
This commit is contained in:
parent
b54bf94697
commit
57c031c1c6
5 changed files with 40 additions and 35 deletions
client/src/helpers
|
@ -261,6 +261,13 @@ export const redirectToCurrentProtocol = (values, httpPort = 80) => {
|
|||
|
||||
export const normalizeTextarea = text => text && text.replace(/[;, ]/g, '\n').split('\n').filter(n => n);
|
||||
|
||||
export const normalizeTopClients = clients => clients.reduce((accumulator, clientObj) => {
|
||||
const { name, count } = clientObj;
|
||||
const idToCountMap = accumulator;
|
||||
idToCountMap[name] = count;
|
||||
return idToCountMap;
|
||||
}, {});
|
||||
|
||||
export const getClientInfo = (clients, ip) => {
|
||||
const client = clients
|
||||
.find(item => item.ip_addrs && item.ip_addrs.find(clientIp => clientIp === ip));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue