Merge: - client: fix names of clients in the top clients list

Closes #1893

Squashed commit of the following:

commit e5de0c4f53558e1ad89dc0069192e534f244f120
Author: Ildar Kamalov <ik@adguard.com>
Date:   Mon Jul 20 14:29:23 2020 +0300

    - client: fix names of clients in the top clients list
This commit is contained in:
Ildar Kamalov 2020-07-20 15:25:28 +03:00
parent 87789679f5
commit c131ac445a
2 changed files with 21 additions and 9 deletions

View file

@ -62,7 +62,7 @@ const clientCell = (t, toggleClientStatus, processing, disallowedClients) => fun
return ( return (
<> <>
<div className="logs__row logs__row--overflow logs__row--column"> <div className="logs__row logs__row--overflow logs__row--column">
{formatClientCell(row, true)} {formatClientCell(row, true, false)}
</div> </div>
{ipMatchListStatus !== IP_MATCH_LIST_STATUS.CIDR {ipMatchListStatus !== IP_MATCH_LIST_STATUS.CIDR
&& renderBlockingButton(ipMatchListStatus, value, toggleClientStatus, processing)} && renderBlockingButton(ipMatchListStatus, value, toggleClientStatus, processing)}

View file

@ -24,7 +24,7 @@ const getFormattedWhois = (whois) => {
); );
}; };
export const formatClientCell = (row, isDetailed = false) => { export const formatClientCell = (row, isDetailed = false, isLogs = true) => {
const { value, original: { info } } = row; const { value, original: { info } } = row;
let whoisContainer = ''; let whoisContainer = '';
let nameContainer = value; let nameContainer = value;
@ -33,13 +33,25 @@ export const formatClientCell = (row, isDetailed = false) => {
const { name, whois_info } = info; const { name, whois_info } = info;
if (name) { if (name) {
nameContainer = !whois_info && isDetailed if (isLogs) {
? <small title={value}>{value}</small> nameContainer = !whois_info && isDetailed
: <div className="logs__text logs__text--nowrap" title={`${name} (${value})`}> ? (
{name} <small title={value}>{value}</small>
{' '} ) : (
<small>{`(${value})`}</small> <div className="logs__text logs__text--nowrap" title={`${name} (${value})`}>
</div>; {name}&nbsp;<small>{`(${value})`}</small>
</div>
);
} else {
nameContainer = (
<div
className="logs__text logs__text--nowrap"
title={`${name} (${value})`}
>
{name}&nbsp;<small>{`(${value})`}</small>
</div>
);
}
} }
if (whois_info && isDetailed) { if (whois_info && isDetailed) {