Skip to content

Commit

Permalink
ADG-8259 fix server from cache label
Browse files Browse the repository at this point in the history
  • Loading branch information
IldarKamalov committed Mar 7, 2024
1 parent 5df1d32 commit 8274faa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]).
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions client/src/__locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,7 @@
"parental_control": "Parental Control",
"safe_browsing": "Safe Browsing",
"served_from_cache": "{{value}} <i>(served from cache)</i>",
"served_from_cache_label": "Served from cache",
"form_error_password_length": "Password must be {{min}} to {{max}} characters long",
"anonymizer_notification": "<0>Note:</0> IP anonymization is enabled. You can disable it in <1>General settings</1>.",
"confirm_dns_cache_clear": "Are you sure you want to clear DNS cache?",
Expand Down
14 changes: 10 additions & 4 deletions client/src/components/Logs/Cells/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: <i /> })
: upstream;

const onBlockingForClientClick = () => {
dispatch(toggleBlockingForClient(buttonType, domain, clientNameBlockingFor));
Expand Down Expand Up @@ -192,7 +189,16 @@ const Row = memo(({
className="link--green">{sourceData.name}
</a>,
response_details: 'title',
install_settings_dns: upstreamString,
install_settings_dns: upstream,
...(cached
&& {
served_from_cache_label: (
<svg className="icons icon--20 icon--green">
<use xlinkHref="#check" />
</svg>
),
}
),
elapsed: formattedElapsedMs,
...(rules.length > 0
&& { rule_label: getRulesToFilterList(rules, filters, whitelistFilters) }
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/ui/Icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ const Icons = () => (
<path fillRule="evenodd" clipRule="evenodd" d="M12 13.5C11.1716 13.5 10.5 12.8284 10.5 12C10.5 11.1716 11.1716 10.5 12 10.5C12.8284 10.5 13.5 11.1716 13.5 12C13.5 12.8284 12.8284 13.5 12 13.5Z" fill="currentColor" />
<path fillRule="evenodd" clipRule="evenodd" d="M12 20C11.1716 20 10.5 19.3284 10.5 18.5C10.5 17.6716 11.1716 17 12 17C12.8284 17 13.5 17.6716 13.5 18.5C13.5 19.3284 12.8284 20 12 20Z" fill="currentColor" />
</symbol>

<symbol id="check" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
<path d="M5 11.7665L10.5878 17L19 8" stroke="#67B279" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" />
</symbol>
</svg>
);

Expand Down

0 comments on commit 8274faa

Please sign in to comment.