- client: Fix mobile query log

This commit is contained in:
ArtemBaskal 2020-07-06 19:28:07 +03:00
parent 4f8138bdce
commit 036ab4128d
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),
@ -346,10 +374,11 @@ const Table = (props) => {
category_label: hasTracker && captitalizeWords(tracker.category), category_label: hasTracker && captitalizeWords(tracker.category),
source_label: hasTracker && sourceData source_label: hasTracker && sourceData
&& <a href={sourceData.url} target="_blank" rel="noopener noreferrer" && <a href={sourceData.url} target="_blank" rel="noopener noreferrer"
className="link--green">{sourceData.name}</a>, className="link--green">{sourceData.name}</a>,
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>,