mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-04-30 13:11:37 +03:00
+ client: handle per-client settings
This commit is contained in:
parent
22c7efd2d1
commit
22d3c38df2
16 changed files with 863 additions and 40 deletions
client/src/helpers
|
@ -208,3 +208,21 @@ export const getClientName = (clients, ip) => {
|
|||
const client = clients.find(item => ip === item.ip);
|
||||
return (client && client.name) || '';
|
||||
};
|
||||
|
||||
export const sortClients = (clients) => {
|
||||
const compare = (a, b) => {
|
||||
const nameA = a.name.toUpperCase();
|
||||
const nameB = b.name.toUpperCase();
|
||||
let comparison = 0;
|
||||
|
||||
if (nameA > nameB) {
|
||||
comparison = 1;
|
||||
} else if (nameA < nameB) {
|
||||
comparison = -1;
|
||||
}
|
||||
|
||||
return comparison;
|
||||
};
|
||||
|
||||
return clients.sort(compare);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue