Pull request: 3772 cache upstreams
Merge in DNS/adguard-home from 3772-cache-upstreams to master
Updates #3772.
Squashed commit of the following:
commit 809e874fe8847fdbd7f8a7221f18393509f41339
Merge: 5774798c 2d328ea8
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Tue Dec 7 17:15:59 2021 +0300
Merge branch 'master' into 3772-cache-upstreams
commit 5774798ce1897bf292be49410794ce06cd084f93
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Dec 7 16:48:38 2021 +0300
client: fix formatting
commit 4b4bb668c762c9b4d47cf40a007f34fe47a6e260
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Dec 7 16:47:18 2021 +0300
client: remove comment
commit a2a9f904a6ab52194bb811a2a83967660a25f2cc
Author: Ildar Kamalov <ik@adguard.com>
Date: Tue Dec 7 16:45:31 2021 +0300
client: handle cached upstream
commit a56804c4910da838cb10c8ef0af2a525e9722b1c
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Nov 26 15:33:43 2021 +0300
querylog: rm todo
commit 16c0a62ad2dfc7fcb5a6adbc868b296b7840fd27
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Nov 26 15:31:53 2021 +0300
all: revise log of changes
commit 9f4b793205f17b6e85d74e83126093ed09eb24e3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Nov 25 17:23:42 2021 +0300
WIP
commit 7fbc6d596295570d2c61c3e507160f65c9adccb8
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Nov 25 17:03:42 2021 +0300
all: imp upstream info in querylog
This commit is contained in:
@@ -47,7 +47,6 @@
|
||||
"form_error_server_name": "Invalid server name",
|
||||
"form_error_subnet": "Subnet \"{{cidr}}\" does not contain the IP address \"{{ip}}\"",
|
||||
"form_error_positive": "Must be greater than 0",
|
||||
"form_error_negative": "Must be equal to 0 or greater",
|
||||
"out_of_range_error": "Must be out of range \"{{start}}\"-\"{{end}}\"",
|
||||
"lower_range_start_error": "Must be lower than range start",
|
||||
"greater_range_start_error": "Must be greater than range start",
|
||||
@@ -627,5 +626,6 @@
|
||||
"experimental": "Experimental",
|
||||
"use_saved_key": "Use the previously saved key",
|
||||
"parental_control": "Parental control",
|
||||
"safe_browsing": "Safe browsing"
|
||||
"safe_browsing": "Safe browsing",
|
||||
"served_from_cache": "{{value}} <i>(served from cache)</i>"
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ const ResponseCell = ({
|
||||
upstream,
|
||||
rules,
|
||||
service_name,
|
||||
cached,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const filters = useSelector((state) => state.filtering.filters, shallowEqual);
|
||||
@@ -36,6 +37,9 @@ const ResponseCell = ({
|
||||
|
||||
const statusLabel = t(isBlockedByResponse ? 'blocked_by_cname_or_ip' : FILTERED_STATUS_TO_META_MAP[reason]?.LABEL || reason);
|
||||
const boldStatusLabel = <span className="font-weight-bold">{statusLabel}</span>;
|
||||
const upstreamString = cached
|
||||
? t('served_from_cache', { value: upstream, i: <i /> })
|
||||
: upstream;
|
||||
|
||||
const renderResponses = (responseArr) => {
|
||||
if (!responseArr || responseArr.length === 0) {
|
||||
@@ -53,7 +57,7 @@ const ResponseCell = ({
|
||||
|
||||
const COMMON_CONTENT = {
|
||||
encryption_status: boldStatusLabel,
|
||||
install_settings_dns: upstream,
|
||||
install_settings_dns: upstreamString,
|
||||
elapsed: formattedElapsedMs,
|
||||
response_code: status,
|
||||
...(service_name
|
||||
@@ -90,8 +94,9 @@ const ResponseCell = ({
|
||||
|
||||
const detailedInfo = getDetailedInfo(reason);
|
||||
|
||||
return <div className="logs__cell logs__cell--response" role="gridcell">
|
||||
<IconTooltip
|
||||
return (
|
||||
<div className="logs__cell logs__cell--response" role="gridcell">
|
||||
<IconTooltip
|
||||
className={classNames('icons mr-4 icon--24 icon--lightgray', { 'my-3': isDetailed })}
|
||||
columnClass='grid grid--limited'
|
||||
tooltipClass='px-5 pb-5 pt-4 mw-75 custom-tooltip__response-details'
|
||||
@@ -100,14 +105,15 @@ const ResponseCell = ({
|
||||
title='response_details'
|
||||
content={content}
|
||||
placement='bottom'
|
||||
/>
|
||||
<div className="text-truncate">
|
||||
<div className="text-truncate" title={statusLabel}>{statusLabel}</div>
|
||||
{isDetailed && <div
|
||||
className="detailed-info d-none d-sm-block pt-1 text-truncate"
|
||||
title={detailedInfo}>{detailedInfo}</div>}
|
||||
/>
|
||||
<div className="text-truncate">
|
||||
<div className="text-truncate" title={statusLabel}>{statusLabel}</div>
|
||||
{isDetailed && <div
|
||||
className="detailed-info d-none d-sm-block pt-1 text-truncate"
|
||||
title={detailedInfo}>{detailedInfo}</div>}
|
||||
</div>
|
||||
</div>
|
||||
</div>;
|
||||
);
|
||||
};
|
||||
|
||||
ResponseCell.propTypes = {
|
||||
@@ -117,6 +123,7 @@ ResponseCell.propTypes = {
|
||||
response: propTypes.array.isRequired,
|
||||
status: propTypes.string.isRequired,
|
||||
upstream: propTypes.string.isRequired,
|
||||
cached: propTypes.bool.isRequired,
|
||||
rules: propTypes.arrayOf(propTypes.shape({
|
||||
text: propTypes.string.isRequired,
|
||||
filter_list_id: propTypes.number.isRequired,
|
||||
|
||||
@@ -76,6 +76,7 @@ const Row = memo(({
|
||||
originalResponse,
|
||||
status,
|
||||
service_name,
|
||||
cached,
|
||||
} = rowProps;
|
||||
|
||||
const hasTracker = !!tracker;
|
||||
@@ -116,6 +117,9 @@ const Row = memo(({
|
||||
|
||||
const blockingForClientKey = isFiltered ? 'unblock_for_this_client_only' : 'block_for_this_client_only';
|
||||
const clientNameBlockingFor = getBlockingClientName(clients, client);
|
||||
const upstreamString = cached
|
||||
? t('served_from_cache', { value: upstream, i: <i /> })
|
||||
: upstream;
|
||||
|
||||
const onBlockingForClientClick = () => {
|
||||
dispatch(toggleBlockingForClient(buttonType, domain, clientNameBlockingFor));
|
||||
@@ -175,7 +179,7 @@ const Row = memo(({
|
||||
className="link--green">{sourceData.name}
|
||||
</a>,
|
||||
response_details: 'title',
|
||||
install_settings_dns: upstream,
|
||||
install_settings_dns: upstreamString,
|
||||
elapsed: formattedElapsedMs,
|
||||
...(rules.length > 0
|
||||
&& { rule_label: getRulesToFilterList(rules, filters, whitelistFilters) }
|
||||
@@ -230,6 +234,7 @@ Row.propTypes = {
|
||||
time: propTypes.string.isRequired,
|
||||
tracker: propTypes.object,
|
||||
upstream: propTypes.string.isRequired,
|
||||
cached: propTypes.bool.isRequired,
|
||||
type: propTypes.string.isRequired,
|
||||
client_proto: propTypes.string.isRequired,
|
||||
client_id: propTypes.string,
|
||||
|
||||
@@ -75,6 +75,7 @@ export const normalizeLogs = (logs) => logs.map((log) => {
|
||||
service_name,
|
||||
original_answer,
|
||||
upstream,
|
||||
cached,
|
||||
} = log;
|
||||
|
||||
const { name: domain, unicode_name: unicodeName, type } = question;
|
||||
@@ -116,6 +117,7 @@ export const normalizeLogs = (logs) => logs.map((log) => {
|
||||
answer_dnssec,
|
||||
elapsedMs,
|
||||
upstream,
|
||||
cached,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -230,17 +230,6 @@ export const validateMac = (value) => {
|
||||
return undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param value {number}
|
||||
* @returns {boolean|*}
|
||||
*/
|
||||
export const validateBiggerOrEqualZeroValue = (value) => {
|
||||
if (value < 0) {
|
||||
return 'form_error_negative';
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param value {number}
|
||||
* @returns {undefined|string}
|
||||
|
||||
Reference in New Issue
Block a user