mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-29 10:28:53 +03:00
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:
parent
87789679f5
commit
c131ac445a
2 changed files with 21 additions and 9 deletions
|
@ -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)}
|
||||||
|
|
|
@ -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) {
|
||||||
|
if (isLogs) {
|
||||||
nameContainer = !whois_info && isDetailed
|
nameContainer = !whois_info && isDetailed
|
||||||
? <small title={value}>{value}</small>
|
? (
|
||||||
: <div className="logs__text logs__text--nowrap" title={`${name} (${value})`}>
|
<small title={value}>{value}</small>
|
||||||
{name}
|
) : (
|
||||||
{' '}
|
<div className="logs__text logs__text--nowrap" title={`${name} (${value})`}>
|
||||||
<small>{`(${value})`}</small>
|
{name} <small>{`(${value})`}</small>
|
||||||
</div>;
|
</div>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
nameContainer = (
|
||||||
|
<div
|
||||||
|
className="logs__text logs__text--nowrap"
|
||||||
|
title={`${name} (${value})`}
|
||||||
|
>
|
||||||
|
{name} <small>{`(${value})`}</small>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (whois_info && isDetailed) {
|
if (whois_info && isDetailed) {
|
||||||
|
|
Loading…
Reference in a new issue