cherry-pick: 4517 domain specific test
Merge in DNS/adguard-home from 4517-domain-specific-test to master
Updates #4517.
Squashed commit of the following:
commit 03a803f831749a060923ec966592696f99591786
Merge: 8ea24170 f5959a0d
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Jul 29 19:17:28 2022 +0300
Merge branch 'master' into 4517-domain-specific-test
commit 8ea2417036547996bb2d39b75b0ff31de4fe9b21
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Jul 29 18:44:26 2022 +0300
all: log changes, imp docs
commit aa74c8be64f2796a2dfa7166f0155fff5bb395b6
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Jul 29 18:07:12 2022 +0300
dnsforward: imp logging
commit 02dccca4e7d766bbfbe0826933e8be70fcd93f58
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Jul 29 17:24:08 2022 +0300
all: imp code, docs
commit 3b21067d07b208baf574a34fb06ec808b37c4ee3
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Fri Jul 29 13:34:55 2022 +0300
client: add warning toast
commit ea2272dc77f87e34dc6aff0af99c7a51a04e3770
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Jul 28 20:11:55 2022 +0300
dnsforward: imp err msg, docs
commit fd9ee82afef9d93961c30ebafcc7a11d984247b5
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Jul 28 19:24:58 2022 +0300
dnsforward: test doain specific upstreams
commit 9a83ebfa7a73bf4e03eaf1ff4a33f79771159fc7
Author: Eugene Burkov <E.Burkov@AdGuard.COM>
Date: Thu Jul 28 18:22:49 2022 +0300
dnsforward: merge some logic
This commit is contained in:
committed by
Ainar Garipov
parent
d1e735a003
commit
f7bc2273a7
@@ -222,6 +222,7 @@
|
||||
"updated_upstream_dns_toast": "Upstream servers successfully saved",
|
||||
"dns_test_ok_toast": "Specified DNS servers are working correctly",
|
||||
"dns_test_not_ok_toast": "Server \"{{key}}\": could not be used, please check that you've written it correctly",
|
||||
"dns_test_warning_toast": "Server \"{{key}}\" does not respond to test requests and may not work properly",
|
||||
"unblock": "Unblock",
|
||||
"block": "Block",
|
||||
"disallow_this_client": "Disallow this client",
|
||||
|
||||
@@ -314,13 +314,15 @@ export const testUpstream = (
|
||||
const testMessages = Object.keys(upstreamResponse)
|
||||
.map((key) => {
|
||||
const message = upstreamResponse[key];
|
||||
if (message !== 'OK') {
|
||||
if (message.startsWith('WARNING:')) {
|
||||
dispatch(addErrorToast({ error: i18next.t('dns_test_warning_toast', { key }) }));
|
||||
} else if (message !== 'OK') {
|
||||
dispatch(addErrorToast({ error: i18next.t('dns_test_not_ok_toast', { key }) }));
|
||||
}
|
||||
return message;
|
||||
});
|
||||
|
||||
if (testMessages.every((message) => message === 'OK')) {
|
||||
if (testMessages.every((message) => message === 'OK' || message.startsWith('WARNING:'))) {
|
||||
dispatch(addSuccessToast('dns_test_ok_toast'));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user