From 8274faaf39c62d1777c21ab5d9b6fdfd88674527 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Thu, 7 Mar 2024 09:56:50 +0300 Subject: [PATCH] ADG-8259 fix server from cache label --- CHANGELOG.md | 2 ++ client/src/__locales/en.json | 1 + client/src/components/Logs/Cells/index.js | 14 ++++++++++---- client/src/components/ui/Icons.js | 4 ++++ 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72f8f825553..8987d34cf26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -61,6 +61,7 @@ NOTE: Add new changes BELOW THIS COMMENT. ### Fixed +- Missing "served from cache" label on long DNS server strings ([#6740]). - Missing IP addresses in logs when querying for domain names from the ignore lists. - Wrong algorithm for caching bootstrapped upstream addresses ([#6723]). @@ -74,6 +75,7 @@ NOTE: Add new changes BELOW THIS COMMENT. [#6610]: https://github.com/AdguardTeam/AdGuardHome/issues/6610 [#6679]: https://github.com/AdguardTeam/AdGuardHome/issues/6679 [#6711]: https://github.com/AdguardTeam/AdGuardHome/issues/6711 +[#6740]: https://github.com/AdguardTeam/AdGuardHome/issues/6740 [go-toolchain]: https://go.dev/blog/toolchain [go-1.21.8]: https://groups.google.com/g/golang-announce/c/5pwGVUPoMbg diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index bc3e459cd7c..a25165a7cf5 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -679,6 +679,7 @@ "parental_control": "Parental Control", "safe_browsing": "Safe Browsing", "served_from_cache": "{{value}} (served from cache)", + "served_from_cache_label": "Served from cache", "form_error_password_length": "Password must be {{min}} to {{max}} characters long", "anonymizer_notification": "<0>Note: IP anonymization is enabled. You can disable it in <1>General settings.", "confirm_dns_cache_clear": "Are you sure you want to clear DNS cache?", diff --git a/client/src/components/Logs/Cells/index.js b/client/src/components/Logs/Cells/index.js index fe32b104cd9..df46a429044 100644 --- a/client/src/components/Logs/Cells/index.js +++ b/client/src/components/Logs/Cells/index.js @@ -118,9 +118,6 @@ 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: }) - : upstream; const onBlockingForClientClick = () => { dispatch(toggleBlockingForClient(buttonType, domain, clientNameBlockingFor)); @@ -192,7 +189,16 @@ const Row = memo(({ className="link--green">{sourceData.name} , response_details: 'title', - install_settings_dns: upstreamString, + install_settings_dns: upstream, + ...(cached + && { + served_from_cache_label: ( + + + + ), + } + ), elapsed: formattedElapsedMs, ...(rules.length > 0 && { rule_label: getRulesToFilterList(rules, filters, whitelistFilters) } diff --git a/client/src/components/ui/Icons.js b/client/src/components/ui/Icons.js index af5ca52c2b0..9db66d38a85 100644 --- a/client/src/components/ui/Icons.js +++ b/client/src/components/ui/Icons.js @@ -245,6 +245,10 @@ const Icons = () => ( + + + + );