+ client: add whois info to dashboard and logs

This commit is contained in:
Ildar Kamalov
2019-09-23 16:02:47 +03:00
parent 9e4f80f3c1
commit a52715e086
6 changed files with 86 additions and 46 deletions

View File

@@ -0,0 +1,32 @@
import React, { Fragment } from 'react';
import { getClientInfo } from './helpers';
export const formatClientCell = (value, clients, autoClients) => {
const clientInfo = getClientInfo(clients, value) || getClientInfo(autoClients, value);
const { name, whois } = clientInfo;
if (whois && name) {
return (
<Fragment>
<div className="logs__text logs__text--wrap" title={`${name} (${value})`}>
{name} <small className="text-muted-dark">({value})</small>
</div>
<div className="logs__text logs__text--wrap" title={whois}>
<small className="text-muted">{whois}</small>
</div>
</Fragment>
);
} else if (name) {
return (
<span className="logs__text logs__text--wrap" title={`${name} (${value})`}>
{name} <small>({value})</small>
</span>
);
}
return (
<span className="logs__text" title={value}>
{value}
</span>
);
};