mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-23 13:35:38 +03:00
Merge pull request in DNS/adguard-dns from fix/688 to master
* commit 'e231230f1b2045b705602b2c9d3a14c47f276273': - client: fixed leases table on mobile
This commit is contained in:
commit
b453d9f41d
1 changed files with 41 additions and 24 deletions
|
@ -1,32 +1,49 @@
|
||||||
import React from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import ReactTable from 'react-table';
|
import ReactTable from 'react-table';
|
||||||
import { Trans, withNamespaces } from 'react-i18next';
|
import { Trans, withNamespaces } from 'react-i18next';
|
||||||
|
|
||||||
const columns = [{
|
class Leases extends Component {
|
||||||
Header: 'MAC',
|
cellWrap = ({ value }) => (
|
||||||
accessor: 'mac',
|
<div className="logs__row logs__row--overflow">
|
||||||
}, {
|
<span className="logs__text" title={value}>
|
||||||
Header: 'IP',
|
{value}
|
||||||
accessor: 'ip',
|
</span>
|
||||||
}, {
|
</div>
|
||||||
Header: <Trans>dhcp_table_hostname</Trans>,
|
);
|
||||||
accessor: 'hostname',
|
|
||||||
}, {
|
|
||||||
Header: <Trans>dhcp_table_expires</Trans>,
|
|
||||||
accessor: 'expires',
|
|
||||||
}];
|
|
||||||
|
|
||||||
const Leases = props => (
|
render() {
|
||||||
<ReactTable
|
const { leases, t } = this.props;
|
||||||
data={props.leases || []}
|
return (
|
||||||
columns={columns}
|
<ReactTable
|
||||||
showPagination={false}
|
data={leases || []}
|
||||||
noDataText={ props.t('dhcp_leases_not_found') }
|
columns={[
|
||||||
minRows={6}
|
{
|
||||||
className="-striped -highlight card-table-overflow"
|
Header: 'MAC',
|
||||||
/>
|
accessor: 'mac',
|
||||||
);
|
Cell: this.cellWrap,
|
||||||
|
}, {
|
||||||
|
Header: 'IP',
|
||||||
|
accessor: 'ip',
|
||||||
|
Cell: this.cellWrap,
|
||||||
|
}, {
|
||||||
|
Header: <Trans>dhcp_table_hostname</Trans>,
|
||||||
|
accessor: 'hostname',
|
||||||
|
Cell: this.cellWrap,
|
||||||
|
}, {
|
||||||
|
Header: <Trans>dhcp_table_expires</Trans>,
|
||||||
|
accessor: 'expires',
|
||||||
|
Cell: this.cellWrap,
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
showPagination={false}
|
||||||
|
noDataText={t('dhcp_leases_not_found')}
|
||||||
|
minRows={6}
|
||||||
|
className="-striped -highlight card-table-overflow"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Leases.propTypes = {
|
Leases.propTypes = {
|
||||||
leases: PropTypes.array,
|
leases: PropTypes.array,
|
||||||
|
|
Loading…
Reference in a new issue