- client: sort clients table by requests count by default
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user