mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-12-15 11:22:49 +03:00
parent
47a9c6555e
commit
1cdbe3f879
@ -4,6 +4,8 @@ import ReactTable from 'react-table';
|
|||||||
import { saveAs } from 'file-saver/FileSaver';
|
import { saveAs } from 'file-saver/FileSaver';
|
||||||
import escapeRegExp from 'lodash/escapeRegExp';
|
import escapeRegExp from 'lodash/escapeRegExp';
|
||||||
import endsWith from 'lodash/endsWith';
|
import endsWith from 'lodash/endsWith';
|
||||||
|
|
||||||
|
import { formatTime } from '../../helpers/helpers';
|
||||||
import PageTitle from '../ui/PageTitle';
|
import PageTitle from '../ui/PageTitle';
|
||||||
import Card from '../ui/Card';
|
import Card from '../ui/Card';
|
||||||
import Loading from '../ui/Loading';
|
import Loading from '../ui/Loading';
|
||||||
@ -83,6 +85,7 @@ class Logs extends Component {
|
|||||||
accessor: 'time',
|
accessor: 'time',
|
||||||
maxWidth: 110,
|
maxWidth: 110,
|
||||||
filterable: false,
|
filterable: false,
|
||||||
|
Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>),
|
||||||
}, {
|
}, {
|
||||||
Header: 'Domain name',
|
Header: 'Domain name',
|
||||||
accessor: 'domain',
|
accessor: 'domain',
|
||||||
@ -261,8 +264,8 @@ class Logs extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</PageTitle>
|
</PageTitle>
|
||||||
<Card>
|
<Card>
|
||||||
{queryLogEnabled && queryLogs.processing && <Loading />}
|
{queryLogEnabled && queryLogs.getLogsProcessing && <Loading />}
|
||||||
{queryLogEnabled && !queryLogs.processing &&
|
{queryLogEnabled && !queryLogs.getLogsProcessing &&
|
||||||
this.renderLogs(queryLogs.logs)}
|
this.renderLogs(queryLogs.logs)}
|
||||||
</Card>
|
</Card>
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
@ -6,7 +6,7 @@ import round from 'lodash/round';
|
|||||||
|
|
||||||
import { STATS_NAMES } from './constants';
|
import { STATS_NAMES } from './constants';
|
||||||
|
|
||||||
const formatTime = (time) => {
|
export const formatTime = (time) => {
|
||||||
const parsedTime = dateParse(time);
|
const parsedTime = dateParse(time);
|
||||||
return dateFormat(parsedTime, 'HH:mm:ss');
|
return dateFormat(parsedTime, 'HH:mm:ss');
|
||||||
};
|
};
|
||||||
@ -26,7 +26,7 @@ export const normalizeLogs = logs => logs.map((log) => {
|
|||||||
return `${type}: ${value} (ttl=${ttl})`;
|
return `${type}: ${value} (ttl=${ttl})`;
|
||||||
}) : [];
|
}) : [];
|
||||||
return {
|
return {
|
||||||
time: formatTime(time),
|
time,
|
||||||
domain,
|
domain,
|
||||||
type,
|
type,
|
||||||
response: responsesArray,
|
response: responsesArray,
|
||||||
|
Loading…
Reference in New Issue
Block a user