- client: Fix mobile query log

Fix #1828

* commit '036ab4128df678f5aa6037f6ad622e8f428c5efa':
  - client: Fix mobile query log
This commit is contained in:
Andrey Meshkov 2020-07-06 19:34:41 +03:00
commit 36f3218b1c
5 changed files with 35 additions and 26 deletions

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<meta name="google" content="notranslate"> <meta name="google" content="notranslate">
<meta http-equiv="x-dns-prefetch-control" content="off"> <meta http-equiv="x-dns-prefetch-control" content="off">

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<meta name="google" content="notranslate"> <meta name="google" content="notranslate">
<link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" /> <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" />

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, shrink-to-fit=no">
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">
<meta name="google" content="notranslate"> <meta name="google" content="notranslate">
<link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" /> <link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon-180x180.png" />

View File

@ -2,33 +2,12 @@ import React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { formatElapsedMs } from '../../../helpers/helpers'; import { formatElapsedMs } from '../../../helpers/helpers';
import { import {
CUSTOM_FILTERING_RULES_ID,
FILTERED_STATUS, FILTERED_STATUS,
FILTERED_STATUS_TO_META_MAP, FILTERED_STATUS_TO_META_MAP,
} from '../../../helpers/constants'; } from '../../../helpers/constants';
import getHintElement from './getHintElement'; import getHintElement from './getHintElement';
const getFilterName = (filters, whitelistFilters, filterId, t) => { const getResponseCell = (row, filtering, t, isDetailed, getFilterName) => {
if (filterId === CUSTOM_FILTERING_RULES_ID) {
return t('custom_filter_rules');
}
const filter = filters.find((filter) => filter.id === filterId)
|| whitelistFilters.find((filter) => filter.id === filterId);
let filterName = '';
if (filter) {
filterName = filter.name;
}
if (!filterName) {
filterName = t('unknown_filter', { filterId });
}
return filterName;
};
const getResponseCell = (row, filtering, t, isDetailed) => {
const { const {
reason, filterId, rule, status, upstream, elapsedMs, domain, response, reason, filterId, rule, status, upstream, elapsedMs, domain, response,
} = row.original; } = row.original;
@ -98,6 +77,7 @@ const getResponseCell = (row, filtering, t, isDetailed) => {
[FILTERED_STATUS.FILTERED_BLACK_LIST]: { [FILTERED_STATUS.FILTERED_BLACK_LIST]: {
domain, domain,
encryption_status: boldStatusLabel, encryption_status: boldStatusLabel,
filter,
install_settings_dns: upstream, install_settings_dns: upstream,
elapsed: formattedElapsedMs, elapsed: formattedElapsedMs,
response_code: status, response_code: status,

View File

@ -12,6 +12,7 @@ import {
FILTERED_STATUS_TO_META_MAP, FILTERED_STATUS_TO_META_MAP,
TABLE_DEFAULT_PAGE_SIZE, TABLE_DEFAULT_PAGE_SIZE,
SCHEME_TO_PROTOCOL_MAP, SCHEME_TO_PROTOCOL_MAP,
CUSTOM_FILTERING_RULES_ID,
} from '../../helpers/constants'; } from '../../helpers/constants';
import getDateCell from './Cells/getDateCell'; import getDateCell from './Cells/getDateCell';
import getDomainCell from './Cells/getDomainCell'; import getDomainCell from './Cells/getDomainCell';
@ -85,6 +86,27 @@ const Table = (props) => {
getFilteringStatus(); getFilteringStatus();
}; };
const getFilterName = (filters, whitelistFilters, filterId, t) => {
if (filterId === CUSTOM_FILTERING_RULES_ID) {
return t('custom_filter_rules');
}
const filter = filters.find((filter) => filter.id === filterId)
|| whitelistFilters.find((filter) => filter.id === filterId);
let filterName = '';
if (filter) {
filterName = filter.name;
}
if (!filterName) {
filterName = t('unknown_filter', { filterId });
}
return filterName;
};
const columns = [ const columns = [
{ {
Header: t('time_table_header'), Header: t('time_table_header'),
@ -125,6 +147,7 @@ const Table = (props) => {
filtering, filtering,
t, t,
isDetailed, isDetailed,
getFilterName,
), ),
minWidth: 150, minWidth: 150,
maxHeight: 60, maxHeight: 60,
@ -276,6 +299,7 @@ const Table = (props) => {
upstream, upstream,
type, type,
client_proto, client_proto,
filterId,
} = rowInfo.original; } = rowInfo.original;
const hasTracker = !!tracker; const hasTracker = !!tracker;
@ -334,6 +358,10 @@ const Table = (props) => {
className="title--border bg--danger text-center">{t(buttonType)}</div>, className="title--border bg--danger text-center">{t(buttonType)}</div>,
}; };
const { filters, whitelistFilters } = filtering;
const filter = getFilterName(filters, whitelistFilters, filterId, t);
const detailedDataBlocked = { const detailedDataBlocked = {
time_table_header: formatTime(time, LONG_TIME_FORMAT), time_table_header: formatTime(time, LONG_TIME_FORMAT),
date: formatDateTime(time, DEFAULT_SHORT_DATE_FORMAT_OPTIONS), date: formatDateTime(time, DEFAULT_SHORT_DATE_FORMAT_OPTIONS),
@ -350,6 +378,7 @@ const Table = (props) => {
response_details: 'title', response_details: 'title',
install_settings_dns: upstream, install_settings_dns: upstream,
elapsed: formattedElapsedMs, elapsed: formattedElapsedMs,
filter,
response_table_header: response?.join('\n'), response_table_header: response?.join('\n'),
[buttonType]: <div onClick={onToggleBlock} [buttonType]: <div onClick={onToggleBlock}
className="title--border text-center">{t(buttonType)}</div>, className="title--border text-center">{t(buttonType)}</div>,