- client: fix naming

This commit is contained in:
Ildar Kamalov 2019-09-26 12:17:58 +03:00
parent 63efce0309
commit 563f8031dc
3 changed files with 18 additions and 14 deletions

View File

@ -4,8 +4,11 @@ import { withNamespaces } from 'react-i18next';
import ReactTable from 'react-table';
import Card from '../../ui/Card';
import WrapCell from './WrapCell';
import whoisCell from './whoisCell';
import wrapCell from './wrapCell';
const COLUMN_MIN_WIDTH = 200;
class AutoClients extends Component {
getStats = (ip, stats) => {
@ -21,31 +24,31 @@ class AutoClients extends Component {
{
Header: this.props.t('table_client'),
accessor: 'ip',
minWidth: 200,
Cell: wrapCell,
minWidth: COLUMN_MIN_WIDTH,
Cell: WrapCell,
},
{
Header: this.props.t('table_name'),
accessor: 'name',
minWidth: 200,
Cell: wrapCell,
minWidth: COLUMN_MIN_WIDTH,
Cell: WrapCell,
},
{
Header: this.props.t('source_label'),
accessor: 'source',
minWidth: 200,
Cell: wrapCell,
minWidth: COLUMN_MIN_WIDTH,
Cell: WrapCell,
},
{
Header: this.props.t('whois'),
accessor: 'whois_info',
minWidth: 200,
minWidth: COLUMN_MIN_WIDTH,
Cell: whoisCell(this.props.t),
},
{
Header: this.props.t('requests_count'),
accessor: 'statistics',
minWidth: 200,
minWidth: COLUMN_MIN_WIDTH,
Cell: (row) => {
const clientIP = row.original.ip;
const clientStats = clientIP && this.getStats(clientIP, this.props.topClients);

View File

@ -6,7 +6,8 @@ import ReactTable from 'react-table';
import { MODAL_TYPE, CLIENT_ID } from '../../../helpers/constants';
import Card from '../../ui/Card';
import Modal from './Modal';
import wrapCell from './wrapCell';
import WrapCell from './WrapCell';
import whoisCell from './whoisCell';
class ClientsTable extends Component {
@ -103,7 +104,7 @@ class ClientsTable extends Component {
Header: this.props.t('table_name'),
accessor: 'name',
minWidth: 120,
Cell: wrapCell,
Cell: WrapCell,
},
{
Header: this.props.t('settings'),

View File

@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
const wrapCell = ({ value }) => (
const WrapCell = ({ value }) => (
<div className="logs__row logs__row--overflow">
<span className="logs__text" title={value}>
{value || ''}
@ -9,8 +9,8 @@ const wrapCell = ({ value }) => (
</div>
);
wrapCell.propTypes = {
WrapCell.propTypes = {
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
};
export default wrapCell;
export default WrapCell;