+ client: added name for client

This commit is contained in:
Ildar Kamalov 2019-03-20 17:04:32 +03:00 committed by Simon Zolin
parent 5210d214ec
commit bc0b0af06b
8 changed files with 86 additions and 8 deletions
client/src/helpers

View file

@ -203,3 +203,8 @@ export const redirectToCurrentProtocol = (values, httpPort = 80) => {
};
export const normalizeTextarea = text => text && text.replace(/[;, ]/g, '\n').split('\n').filter(n => n);
export const getClientName = (clients, ip) => {
const client = clients.find(item => ip === item.ip);
return (client && client.name) || '';
};