docstring_tokens
stringlengths
0
76.5k
code_tokens
stringlengths
75
1.81M
label_window
sequencelengths
4
2.12k
html_url
stringlengths
74
116
file_name
stringlengths
3
311
<mask> github.com/gobuffalo/packd v0.0.0-20181031195726-c82734870264 h1:roWyi0eEdiFreSqW9V1wT9pNOVzrpo2NWsxja53slX0= <mask> github.com/gobuffalo/packd v0.0.0-20181031195726-c82734870264/go.mod h1:Yf2toFaISlyQrr5TfO3h6DB9pl9mZRmyvBGQb/aQ/pI= <mask> github.com/gobuffalo/packr v1.19.0 h1:3UDmBDxesCOPF8iZdMDBBWKfkBoYujIMIZePnobqIUI= <mask> github.com/gobuffalo/packr v1.19.0/go.mod h1:MstrNkfCQhd5o+Ct4IJ0skWlxN8emOq8DsoT1G98VIU= <mask> github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4= <mask> github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= <mask> github.com/inconshreveable/go-vhost v0.0.0-20160627193104-06d84117953b/go.mod h1:aA6DnFhALT3zH0y+A39we+zbrdMC2N0X/q21e6FI0LU= <mask> github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= <mask> github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= <mask> github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= <mask> github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= </s> Revert "* dnsfilter: use fastcache instead of gcache" This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/VictoriaMetrics/fastcache v1.5.1 github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 </s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 </s> remove github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY= github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= </s> add </s> remove return cachedValue, true </s> add // since it can be something else, validate that it belongs to proper type cachedValue, ok := rawValue.(Result) if !ok { // this is not our type -- error text := "SHOULD NOT HAPPEN: entry with invalid type was found in lookup cache" log.Println(text) return } isFound = ok return cachedValue, isFound </s> remove "github.com/VictoriaMetrics/fastcache" </s> add </s> remove safebrowsingCache *fastcache.Cache parentalCache *fastcache.Cache safeSearchCache *fastcache.Cache </s> add safebrowsingCache gcache.Cache parentalCache gcache.Cache safeSearchCache gcache.Cache
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
go.sum
<mask> github.com/shirou/gopsutil v2.18.12+incompatible h1:1eaJvGomDnH74/5cF4CTmTbLHAriGFsTZppLXDX93OM= <mask> github.com/shirou/gopsutil v2.18.12+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= <mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U= <mask> github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= <mask> github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= <mask> github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9 h1:5Cp3cVwpQP4aCQ6jx6dNLP3IarbYiuStmIzYu+BjQwY= <mask> github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= <mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0 h1:mu7brOsdaH5Dqf93vdch+mr/0To8Sgc+yInt/jE/RJM= <mask> github.com/sparrc/go-ping v0.0.0-20181106165434-ef3ab45e41b0/go.mod h1:eMyUVp6f/5jnzM+3zahzl7q6UXLbgSc3MKg/+ow9QW0= <mask> github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= <mask> github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= <mask> github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= </s> Revert "* dnsfilter: use fastcache instead of gcache" This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize) </s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove "github.com/VictoriaMetrics/fastcache" </s> add </s> remove safebrowsingCache *fastcache.Cache parentalCache *fastcache.Cache safeSearchCache *fastcache.Cache </s> add safebrowsingCache gcache.Cache parentalCache gcache.Cache safeSearchCache gcache.Cache </s> remove func setCacheResult(cache *fastcache.Cache, host string, res Result) { var buf bytes.Buffer enc := gob.NewEncoder(&buf) _ = enc.Encode(res) cache.Set([]byte(host), buf.Bytes()) log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len()) </s> add func setCacheResult(cache gcache.Cache, host string, res Result) { err := cache.Set(host, res) if err != nil { log.Debug("cache.Set: %s", err) return } log.Debug("Stored in cache %p: %s", cache, host) </s> remove func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) { </s> add func getCachedResult(cache gcache.Cache, host string) (result Result, isFound bool) {
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
go.sum
"blocking_mode_default": "Default: Respond with zero IP address (0.0.0.0 for A; :: for AAAA) when blocked by Adblock-style rule; respond with the IP address specified in the rule when blocked by /etc/hosts-style rule",
<mask> "edns_cs_desc": "If enabled, AdGuard Home will be sending clients' subnets to the DNS servers.", <mask> "rate_limit_desc": "The number of requests per second that a single client is allowed to make (setting it to 0 means unlimited)", <mask> "blocking_ipv4_desc": "IP address to be returned for a blocked A request", <mask> "blocking_ipv6_desc": "IP address to be returned for a blocked AAAA request", <mask> "blocking_mode_default": "Default: Respond with REFUSED when blocked by Adblock-style rule; respond with the IP address specified in the rule when blocked by /etc/hosts-style rule", <mask> "blocking_mode_refused": "REFUSED: Respond with REFUSED code", <mask> "blocking_mode_nxdomain": "NXDOMAIN: Respond with NXDOMAIN code", <mask> "blocking_mode_null_ip": "Null IP: Respond with zero IP address (0.0.0.0 for A; :: for AAAA)", <mask> "blocking_mode_custom_ip": "Custom IP: Respond with a manually set IP address", <mask> "upstream_dns_client_desc": "If you keep this field empty, AdGuard Home will use the servers configured in the <0>DNS settings</0>.", </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0")))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
client/src/__locales/en.json
// Default blocking - NULL IP
<mask> } <mask> addr := s.dnsProxy.Addr(proxy.ProtoUDP) <mask> <mask> // <mask> // Default blocking - REFUSED <mask> // <mask> req := dns.Msg{} <mask> req.Id = dns.Id() <mask> req.RecursionDesired = true <mask> req.Question = []dns.Question{ </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0")))
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/dnsforward_test.go
assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0")))
<mask> reply, err := dns.Exchange(&req, addr.String()) <mask> if err != nil { <mask> t.Fatalf("Couldn't talk to server %s: %s", addr, err) <mask> } <mask> assert.Equal(t, dns.RcodeRefused, reply.Rcode) <mask> <mask> err = s.Stop() <mask> if err != nil { <mask> t.Fatalf("DNS server failed to stop: %s", err) <mask> } </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/dnsforward_test.go
assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0")))
<mask> // response is blocked <mask> req := createTestMessage("badhost.") <mask> reply, err := dns.Exchange(req, addr.String()) <mask> assert.Nil(t, err, nil) <mask> assert.Equal(t, dns.RcodeRefused, reply.Rcode) <mask> <mask> // 'whitelist.example.org' has a canonical name 'null.example.org' which is blocked by filters <mask> // but 'whitelist.example.org' is in a whitelist: <mask> // response isn't blocked <mask> req = createTestMessage("whitelist.example.org.") </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove "blocking_mode_default": "Default: Respond with REFUSED when blocked by Adblock-style rule; respond with the IP address specified in the rule when blocked by /etc/hosts-style rule", </s> add "blocking_mode_default": "Default: Respond with zero IP address (0.0.0.0 for A; :: for AAAA) when blocked by Adblock-style rule; respond with the IP address specified in the rule when blocked by /etc/hosts-style rule", </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove // Default blocking - REFUSED </s> add // Default blocking - NULL IP </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/dnsforward_test.go
assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0")))
<mask> // response is blocked <mask> req = createTestMessage("example.org.") <mask> reply, err = dns.Exchange(req, addr.String()) <mask> assert.Nil(t, err) <mask> assert.Equal(t, dns.RcodeRefused, reply.Rcode) <mask> <mask> _ = s.Stop() <mask> } <mask> <mask> func TestClientRulesForCNAMEMatching(t *testing.T) { </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0"))) </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/dnsforward_test.go
// https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet
<mask> } <mask> <mask> // disable Mozilla DoH <mask> if (d.Req.Question[0].Qtype == dns.TypeA || d.Req.Question[0].Qtype == dns.TypeAAAA) && <mask> d.Req.Question[0].Name == "use-application-dns.net." { <mask> d.Res = s.genNXDomain(d.Req) <mask> return resultFinish <mask> } </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove d.Res = s.makeResponseREFUSED(d.Req) </s> add d.Res = s.genNXDomain(d.Req) </s> remove return s.makeResponseREFUSED(m) </s> add if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m) </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/handle_dns.go
d.Res = s.genNXDomain(d.Req)
<mask> <mask> // disable Mozilla DoH <mask> if (d.Req.Question[0].Qtype == dns.TypeA || d.Req.Question[0].Qtype == dns.TypeAAAA) && <mask> d.Req.Question[0].Name == "use-application-dns.net." { <mask> d.Res = s.makeResponseREFUSED(d.Req) <mask> return resultFinish <mask> } <mask> <mask> return resultDone <mask> } </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove return s.makeResponseREFUSED(m) </s> add if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m) </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/handle_dns.go
if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m)
<mask> func (s *Server) genDNSFilterMessage(d *proxy.DNSContext, result *dnsfilter.Result) *dns.Msg { <mask> m := d.Req <mask> <mask> if m.Question[0].Qtype != dns.TypeA && m.Question[0].Qtype != dns.TypeAAAA { <mask> return s.makeResponseREFUSED(m) <mask> } <mask> <mask> switch result.Reason { <mask> case dnsfilter.FilteredSafeBrowsing: <mask> return s.genBlockedHost(m, s.conf.SafeBrowsingBlockHost, d) </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove d.Res = s.makeResponseREFUSED(d.Req) </s> add d.Res = s.genNXDomain(d.Req)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/msg.go
return s.makeResponseNullIP(m)
<mask> } <mask> <mask> if s.conf.BlockingMode == "null_ip" { <mask> // it means that we should return 0.0.0.0 or :: for any blocked request <mask> <mask> switch m.Question[0].Qtype { <mask> case dns.TypeA: <mask> return s.genARecord(m, []byte{0, 0, 0, 0}) <mask> case dns.TypeAAAA: <mask> return s.genAAAARecord(m, net.IPv6zero) <mask> } <mask> <mask> } else if s.conf.BlockingMode == "custom_ip" { <mask> // means that we should return custom IP for any blocked request <mask> <mask> switch m.Question[0].Qtype { </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove return s.makeResponseREFUSED(m) </s> add if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m) </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove d.Res = s.makeResponseREFUSED(d.Req) </s> add d.Res = s.genNXDomain(d.Req)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/msg.go
// For host-type rules, return null IP
<mask> } <mask> <mask> // Default blocking mode <mask> // If there's an IP specified in the rule, return it <mask> // If there is no IP, return REFUSED <mask> if result.IP != nil { <mask> return s.genResponseWithIP(m, result.IP) <mask> } <mask> return s.makeResponseREFUSED(m) <mask> } </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove // Default blocking - REFUSED </s> add // Default blocking - NULL IP </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove return s.makeResponseREFUSED(m) </s> add if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/msg.go
return s.makeResponseNullIP(m)
<mask> // If there is no IP, return REFUSED <mask> if result.IP != nil { <mask> return s.genResponseWithIP(m, result.IP) <mask> } <mask> return s.makeResponseREFUSED(m) <mask> } <mask> } <mask> <mask> func (s *Server) genServerFailure(request *dns.Msg) *dns.Msg { <mask> resp := dns.Msg{} </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP </s> remove return s.makeResponseREFUSED(m) </s> add if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m) </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove d.Res = s.makeResponseREFUSED(d.Req) </s> add d.Res = s.genNXDomain(d.Req)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/msg.go
// Respond with 0.0.0.0 for A, :: for AAAA, empty response for other types func (s *Server) makeResponseNullIP(req *dns.Msg) *dns.Msg { if req.Question[0].Qtype == dns.TypeA { return s.genARecord(req, []byte{0, 0, 0, 0}) } else if req.Question[0].Qtype == dns.TypeAAAA { return s.genAAAARecord(req, net.IPv6zero) } return s.makeResponse(req) }
<mask> return resp <mask> } <mask> <mask> func (s *Server) genBlockedHost(request *dns.Msg, newAddr string, d *proxy.DNSContext) *dns.Msg { <mask> <mask> ip := net.ParseIP(newAddr) <mask> if ip != nil { <mask> return s.genResponseWithIP(request, ip) <mask> } </s> * DNS: set default blocking mode to Null IP for A/AAAA, empty response for others Close #1914 Squashed commit of the following: commit cb127a9a409b2f228848fb838535f3db6e9d32a9 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:37:11 2020 +0300 return empty response if not A/AAAA qtype commit 175a736d7d69619022db92a9250c382ad7fc9996 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:21:51 2020 +0300 fix commit 03aab89d2da00ede3aad6eb5a5bb2d545444a186 Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:18:11 2020 +0300 fix tests commit 4225d511df910aae2df4651231c01a8a13bb937f Author: Simon Zolin <[email protected]> Date: Fri Oct 2 12:02:11 2020 +0300 * DNS: set default blocking mode to Null IP for A/AAAA, NXDOMAIN for others </s> remove return s.makeResponseREFUSED(m) </s> add return s.makeResponseNullIP(m) </s> remove return s.makeResponseREFUSED(m) </s> add if s.conf.BlockingMode == "null_ip" { return s.makeResponse(m) } return s.genNXDomain(m) </s> remove // If there is no IP, return REFUSED </s> add // For host-type rules, return null IP </s> remove switch m.Question[0].Qtype { case dns.TypeA: return s.genARecord(m, []byte{0, 0, 0, 0}) case dns.TypeAAAA: return s.genAAAARecord(m, net.IPv6zero) } </s> add return s.makeResponseNullIP(m) </s> remove assert.Equal(t, dns.RcodeRefused, reply.Rcode) </s> add assert.Equal(t, dns.RcodeSuccess, reply.Rcode) assert.True(t, reply.Answer[0].(*dns.A).A.Equal(net.ParseIP("0.0.0.0")))
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
dnsforward/msg.go
"upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream. Use tls:\/\/ prefix for DNS over TLS servers.",
<mask> "no_servers_specified": "No servers specified", <mask> "no_settings": "No settings", <mask> "general_settings": "General settings", <mask> "upstream_dns": "Upstream DNS servers", <mask> "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream.", <mask> "test_upstream_btn": "Test upstreams", <mask> "apply_btn": "Apply", <mask> "disabled_filtering_toast": "Disabled filtering", <mask> "enabled_filtering_toast": "Enabled filtering", <mask> "disabled_safe_browsing_toast": "Disabled safebrowsing", </s> Fix #453: Added upstream examples </s> remove <code>https://cloudflare-dns.com/dns-query</code> - { t('example_upstream_doh') } </s> add <code>https://cloudflare-dns.com/dns-query</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_doh') }} /> </s> remove <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - { t('example_upstream_dot') } </s> add <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_dot') }} /> </s> remove "enforced_save_search": "\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", </s> add "enforced_save_search": "\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
client/src/__locales/en.json
"enforced_save_search": "\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a",
<mask> "number_of_dns_query_24_hours": "\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e DNS-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0437\u0430 24 \u0447\u0430\u0441\u0430", <mask> "number_of_dns_query_blocked_24_hours": "\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e DNS-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u043c\u0438 \u0438 \u0431\u043b\u043e\u043a-\u0441\u043f\u0438\u0441\u043a\u0430\u043c\u0438", <mask> "number_of_dns_query_blocked_24_hours_by_sec": "\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e DNS-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432, \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u043c \u0410\u043d\u0442\u0438\u0444\u0438\u0448\u0438\u043d\u0433\u0430 AdGuard", <mask> "number_of_dns_query_blocked_24_hours_adult": "\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \"\u0441\u0430\u0439\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0437\u0440\u043e\u0441\u043b\u044b\u0445\"", <mask> "enforced_save_search": "\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", <mask> "number_of_dns_query_to_safe_search": "\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 DNS \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u044b\u043b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0411\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", <mask> "average_processing_time": "\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430", <mask> "average_processing_time_hint": "\u0421\u0440\u0435\u0434\u043d\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 DNS \u0432 \u043c\u0438\u043b\u043b\u0438\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445", <mask> "block_domain_use_filters_and_hosts": "\u0411\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043c\u0435\u043d\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432 \u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u0445\u043e\u0441\u0442\u043e\u0432", <mask> "filters_block_toggle_hint": "\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0431\u043b\u043e\u043a\u0438\u0440\u043e\u0432\u043a\u0438 \u0432 <a href='#filters'> \"\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0445\"<\/a>.", </s> Fix #453: Added upstream examples </s> remove <code>https://cloudflare-dns.com/dns-query</code> - { t('example_upstream_doh') } </s> add <code>https://cloudflare-dns.com/dns-query</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_doh') }} /> </s> remove <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - { t('example_upstream_dot') } </s> add <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_dot') }} /> </s> remove "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream.", </s> add "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream. Use tls:\/\/ prefix for DNS over TLS servers.",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
client/src/__locales/ru.json
<code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_dot') }} />
<mask> <li> <mask> <code>1.1.1.1</code> - { t('example_upstream_regular') } <mask> </li> <mask> <li> <mask> <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - { t('example_upstream_dot') } <mask> </li> <mask> <li> <mask> <code>https://cloudflare-dns.com/dns-query</code> - { t('example_upstream_doh') } <mask> </li> <mask> <li> </s> Fix #453: Added upstream examples </s> remove <code>https://cloudflare-dns.com/dns-query</code> - { t('example_upstream_doh') } </s> add <code>https://cloudflare-dns.com/dns-query</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_doh') }} /> </s> remove "enforced_save_search": "\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", </s> add "enforced_save_search": "\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", </s> remove "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream.", </s> add "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream. Use tls:\/\/ prefix for DNS over TLS servers.",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
client/src/components/Settings/Upstream.js
<code>https://cloudflare-dns.com/dns-query</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_doh') }} />
<mask> <li> <mask> <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - { t('example_upstream_dot') } <mask> </li> <mask> <li> <mask> <code>https://cloudflare-dns.com/dns-query</code> - { t('example_upstream_doh') } <mask> </li> <mask> <li> <mask> <code>tcp://1.1.1.1</code> - { t('example_upstream_tcp') } <mask> </li> <mask> </ol> </s> Fix #453: Added upstream examples </s> remove <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - { t('example_upstream_dot') } </s> add <code>tls://1dot1dot1dot1.cloudflare-dns.com</code> - <span dangerouslySetInnerHTML={{ __html: t('example_upstream_dot') }} /> </s> remove "enforced_save_search": "\u0423\u0441\u0438\u043b\u0435\u043d\u043d\u044b\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", </s> add "enforced_save_search": "\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a", </s> remove "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream.", </s> add "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use <a href='https:\/\/1.1.1.1\/' target='_blank'>Cloudflare DNS<\/a> as an upstream. Use tls:\/\/ prefix for DNS over TLS servers.",
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
client/src/components/Settings/Upstream.js
clients.etcHosts = etcHosts
<mask> clients.allTags[t] = false <mask> } <mask> <mask> clients.dhcpServer = dhcpServer <mask> if etcHosts != nil { <mask> clients.etcHosts = etcHosts <mask> } <mask> clients.addFromConfig(objects) <mask> <mask> if !clients.testing { <mask> clients.addFromDHCP() <mask> if clients.dhcpServer != nil { </s> Pull request: 2956 fix clients disabling Merge in DNS/adguard-home from 2956-fix-flag to master Closes #2956. Updates #1947. Squashed commit of the following: commit ffb98f752f6d4c40ea166ff1e482edcd7f028513 Merge: 800d67db 7be2fc37 Author: Eugene Burkov <[email protected]> Date: Wed Apr 14 19:01:34 2021 +0300 Merge branch 'master' into 2956-fix-flag commit 800d67db84786c8fe93d38b6aa932aa4dd4dd345 Author: Eugene Burkov <[email protected]> Date: Wed Apr 14 18:54:26 2021 +0300 home: fix clients disabling </s> remove Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) </s> add
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69f526b13d1f553dfcd3e3bad363c2ac148bef54
internal/home/clients.go
<mask> <mask> if !args.noEtcHosts { <mask> Context.etcHosts = &aghnet.EtcHostsContainer{} <mask> Context.etcHosts.Init("") <mask> Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) <mask> } <mask> config.Clients = nil <mask> <mask> if (runtime.GOOS == "linux" || runtime.GOOS == "darwin") && <mask> config.RlimitNoFile != 0 { </s> Pull request: 2956 fix clients disabling Merge in DNS/adguard-home from 2956-fix-flag to master Closes #2956. Updates #1947. Squashed commit of the following: commit ffb98f752f6d4c40ea166ff1e482edcd7f028513 Merge: 800d67db 7be2fc37 Author: Eugene Burkov <[email protected]> Date: Wed Apr 14 19:01:34 2021 +0300 Merge branch 'master' into 2956-fix-flag commit 800d67db84786c8fe93d38b6aa932aa4dd4dd345 Author: Eugene Burkov <[email protected]> Date: Wed Apr 14 18:54:26 2021 +0300 home: fix clients disabling </s> remove if etcHosts != nil { clients.etcHosts = etcHosts } </s> add clients.etcHosts = etcHosts
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69f526b13d1f553dfcd3e3bad363c2ac148bef54
internal/home/home.go
Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts)
<mask> Context.etcHosts = &aghnet.EtcHostsContainer{} <mask> Context.etcHosts.Init("") <mask> } <mask> config.Clients = nil <mask> <mask> if (runtime.GOOS == "linux" || runtime.GOOS == "darwin") && <mask> config.RlimitNoFile != 0 { </s> Pull request: 2956 fix clients disabling Merge in DNS/adguard-home from 2956-fix-flag to master Closes #2956. Updates #1947. Squashed commit of the following: commit ffb98f752f6d4c40ea166ff1e482edcd7f028513 Merge: 800d67db 7be2fc37 Author: Eugene Burkov <[email protected]> Date: Wed Apr 14 19:01:34 2021 +0300 Merge branch 'master' into 2956-fix-flag commit 800d67db84786c8fe93d38b6aa932aa4dd4dd345 Author: Eugene Burkov <[email protected]> Date: Wed Apr 14 18:54:26 2021 +0300 home: fix clients disabling </s> remove if etcHosts != nil { clients.etcHosts = etcHosts } </s> add clients.etcHosts = etcHosts </s> remove Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) </s> add
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/69f526b13d1f553dfcd3e3bad363c2ac148bef54
internal/home/home.go
"github.com/AdguardTeam/golibs/mathutil"
<mask> "github.com/AdguardTeam/golibs/cache" <mask> "github.com/AdguardTeam/golibs/errors" <mask> "github.com/AdguardTeam/golibs/log" <mask> "github.com/AdguardTeam/golibs/stringutil" <mask> "github.com/AdguardTeam/urlfilter" <mask> "github.com/AdguardTeam/urlfilter/filterlist" <mask> "github.com/AdguardTeam/urlfilter/rules" <mask> "github.com/miekg/dns" <mask> "golang.org/x/exp/slices" </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove Enabled: d.Config.SafeSearchEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled), </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.SafeSearchEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, true) </s> remove Enabled: d.Config.ParentalEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled), </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/filtering.go
atomic.StoreUint32(&d.enabled, mathutil.BoolToNumber[uint32](enabled))
<mask> func (r Reason) In(reasons ...Reason) (ok bool) { return slices.Contains(reasons, r) } <mask> <mask> // SetEnabled sets the status of the *DNSFilter. <mask> func (d *DNSFilter) SetEnabled(enabled bool) { <mask> var i int32 <mask> if enabled { <mask> i = 1 <mask> } <mask> <mask> atomic.StoreUint32(&d.enabled, uint32(i)) <mask> } <mask> <mask> // GetConfig - get configuration <mask> func (d *DNSFilter) GetConfig() (s Settings) { <mask> d.confLock.RLock() </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.SafeBrowsingEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false) </s> remove d.Config.SafeSearchEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, true)
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/filtering.go
"sync"
<mask> "net/http" <mask> "sort" <mask> "strings" <mask> "time" <mask> <mask> "github.com/AdguardTeam/AdGuardHome/internal/aghhttp" <mask> "github.com/AdguardTeam/dnsproxy/upstream" </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove Enabled: d.Config.SafeSearchEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled), </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.SafeSearchEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, true) </s> remove Enabled: d.Config.ParentalEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled), </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false)
[ "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true)
<mask> return check(sctx, res, d.parentalUpstream) <mask> } <mask> <mask> func (d *DNSFilter) handleSafeBrowsingEnable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.SafeBrowsingEnabled = true <mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleSafeBrowsingDisable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.SafeBrowsingEnabled = false </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.SafeBrowsingEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false) </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.SafeSearchEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, true) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false)
<mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleSafeBrowsingDisable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.SafeBrowsingEnabled = false <mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleSafeBrowsingStatus(w http.ResponseWriter, r *http.Request) { <mask> resp := &struct { </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.SafeBrowsingEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false) </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove Enabled: d.Config.SafeBrowsingEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled),
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
Enabled: protectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled),
<mask> func (d *DNSFilter) handleSafeBrowsingStatus(w http.ResponseWriter, r *http.Request) { <mask> resp := &struct { <mask> Enabled bool `json:"enabled"` <mask> }{ <mask> Enabled: d.Config.SafeBrowsingEnabled, <mask> } <mask> <mask> _ = aghhttp.WriteJSONResponse(w, r, resp) <mask> } <mask> </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove Enabled: d.Config.SafeSearchEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled), </s> remove Enabled: d.Config.ParentalEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled), </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.SafeBrowsingEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true)
<mask> _ = aghhttp.WriteJSONResponse(w, r, resp) <mask> } <mask> <mask> func (d *DNSFilter) handleParentalEnable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.ParentalEnabled = true <mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleParentalDisable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.ParentalEnabled = false </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true) </s> remove Enabled: d.Config.SafeSearchEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled), </s> remove Enabled: d.Config.ParentalEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled), </s> remove Enabled: d.Config.SafeBrowsingEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled),
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false)
<mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleParentalDisable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.ParentalEnabled = false <mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleParentalStatus(w http.ResponseWriter, r *http.Request) { <mask> resp := &struct { </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true) </s> remove Enabled: d.Config.ParentalEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled),
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled),
<mask> func (d *DNSFilter) handleParentalStatus(w http.ResponseWriter, r *http.Request) { <mask> resp := &struct { <mask> Enabled bool `json:"enabled"` <mask> }{ <mask> Enabled: d.Config.ParentalEnabled, <mask> } <mask> <mask> _ = aghhttp.WriteJSONResponse(w, r, resp) <mask> } </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove Enabled: d.Config.SafeSearchEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled), </s> remove Enabled: d.Config.SafeBrowsingEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled), </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safebrowsing.go
setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, true)
<mask> return Result{}, fmt.Errorf("no ipv4 addresses in safe search response for %s", safeHost) <mask> } <mask> <mask> func (d *DNSFilter) handleSafeSearchEnable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.SafeSearchEnabled = true <mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleSafeSearchDisable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.SafeSearchEnabled = false </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true) </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safesearch.go
setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false)
<mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleSafeSearchDisable(w http.ResponseWriter, r *http.Request) { <mask> d.Config.SafeSearchEnabled = false <mask> d.Config.ConfigModified() <mask> } <mask> <mask> func (d *DNSFilter) handleSafeSearchStatus(w http.ResponseWriter, r *http.Request) { <mask> resp := &struct { </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove d.Config.SafeSearchEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, true) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false) </s> remove d.Config.SafeBrowsingEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, true) </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safesearch.go
Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled),
<mask> func (d *DNSFilter) handleSafeSearchStatus(w http.ResponseWriter, r *http.Request) { <mask> resp := &struct { <mask> Enabled bool `json:"enabled"` <mask> }{ <mask> Enabled: d.Config.SafeSearchEnabled, <mask> } <mask> <mask> _ = aghhttp.WriteJSONResponse(w, r, resp) <mask> } <mask> </s> Pull request: safebrowsing races Merge in DNS/adguard-home from safebrowsing-races to master Squashed commit of the following: commit c7f4932d1ed8ea4fea99e04487ac77c23fb5f386 Author: Eugene Burkov <[email protected]> Date: Thu Jan 26 16:36:32 2023 +0300 filtering: imp code, naming commit af83cf2e689d199c8280022c9ffb84775b74c4e4 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 19:47:30 2023 +0300 filtering: DRY commit 8bfe6b2bb397058af3b7de4d255ed13287e250c9 Author: Eugene Burkov <[email protected]> Date: Wed Jan 25 18:48:19 2023 +0300 filtering: fix possible races </s> remove Enabled: d.Config.ParentalEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.ParentalEnabled), </s> remove Enabled: d.Config.SafeBrowsingEnabled, </s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled), </s> remove d.Config.ParentalEnabled = true </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.SafeSearchEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.SafeSearchEnabled, false) </s> remove d.Config.ParentalEnabled = false </s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false)
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
internal/filtering/safesearch.go
"lint": "eslint client/"
<mask> "scripts": { <mask> "build-dev": "NODE_ENV=development ./node_modules/.bin/webpack --config webpack.dev.js", <mask> "watch": "NODE_ENV=development ./node_modules/.bin/webpack --config webpack.dev.js --watch", <mask> "build-prod": "NODE_ENV=production ./node_modules/.bin/webpack --config webpack.prod.js", <mask> "lint": "eslint frontend/" <mask> }, <mask> "dependencies": { <mask> "@nivo/line": "^0.49.1", <mask> "axios": "^0.19.0", <mask> "classnames": "^2.2.6", </s> + client: handle the new statistics format </s> remove Header: this.props.t('table_statistics'), </s> add Header: this.props.t('requests_count'), </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/package.json
"for_last_days": "for the last {{value}} days",
<mask> "stats_malware_phishing": "Blocked malware/phishing", <mask> "stats_adult": "Blocked adult websites", <mask> "stats_query_domain": "Top queried domains", <mask> "for_last_24_hours": "for the last 24 hours", <mask> "no_domains_found": "No domains found", <mask> "requests_count": "Requests count", <mask> "top_blocked_domains": "Top blocked domains", <mask> "top_clients": "Top clients", <mask> "no_clients_found": "No clients found", </s> + client: handle the new statistics format </s> remove "table_statistics": "Requests count (last 24 hours)", </s> add </s> remove "time_period": "Time period" </s> add "time_period": "Time period", "domain": "Domain" </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> remove return ( <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> ); </s> add return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />; },
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/__locales/en.json
"number_of_dns_query_days": "A number of DNS quieries processed for the last {{value}} days",
<mask> "top_clients": "Top clients", <mask> "no_clients_found": "No clients found", <mask> "general_statistics": "General statistics", <mask> "number_of_dns_query_24_hours": "A number of DNS quieries processed for the last 24 hours", <mask> "number_of_dns_query_blocked_24_hours": "A number of DNS requests blocked by adblock filters and hosts blocklists", <mask> "number_of_dns_query_blocked_24_hours_by_sec": "A number of DNS requests blocked by the AdGuard browsing security module", <mask> "number_of_dns_query_blocked_24_hours_adult": "A number of adult websites blocked", <mask> "enforced_save_search": "Enforced safe search", <mask> "number_of_dns_query_to_safe_search": "A number of DNS requests to search engines for which Safe Search was enforced", </s> + client: handle the new statistics format </s> remove "table_statistics": "Requests count (last 24 hours)", </s> add </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> remove return ( <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> ); </s> add return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />; },
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/__locales/en.json
<mask> "client_global_settings": "Use global settings", <mask> "client_deleted": "Client \"{{key}}\" successfully deleted", <mask> "client_added": "Client \"{{key}}\" successfully added", <mask> "client_updated": "Client \"{{key}}\" successfully updated", <mask> "table_statistics": "Requests count (last 24 hours)", <mask> "clients_not_found": "No clients found", <mask> "client_confirm_delete": "Are you sure you want to delete client \"{{key}}\"?", <mask> "filter_confirm_delete": "Are you sure you want to delete filter?", <mask> "auto_clients_title": "Clients (runtime)", <mask> "auto_clients_desc": "Data on the clients that use AdGuard Home, but not stored in the configuration", </s> + client: handle the new statistics format </s> remove "time_period": "Time period" </s> add "time_period": "Time period", "domain": "Domain" </s> remove const { dashboard, clients } = state; </s> add const { dashboard, clients, stats } = state; </s> remove if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } </s> add if (clientName) { client = ( <span> {clientName} <small>({value})</small> </span> ); } else { client = value; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/__locales/en.json
"time_period": "Time period", "domain": "Domain"
<mask> "stats_params": "Statistics configuration", <mask> "config_successfully_saved": "Configuration successfully saved", <mask> "interval_24_hour": "24 hours", <mask> "interval_days": "{{value}} days", <mask> "time_period": "Time period" <mask> } </s> + client: handle the new statistics format </s> remove "table_statistics": "Requests count (last 24 hours)", </s> add </s> remove } </s> add )} </s> remove getGlobalStatsTop() { const { path, method } = this.GLOBAL_STATS_TOP; return this.makeRequest(path, method); } </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/__locales/en.json
<mask> import { createAction } from 'redux-actions'; <mask> import round from 'lodash/round'; <mask> import { t } from 'i18next'; <mask> import { showLoading, hideLoading } from 'react-redux-loading-bar'; <mask> import axios from 'axios'; <mask> <mask> import versionCompare from '../helpers/versionCompare'; </s> + client: handle the new statistics format </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> remove STATS_NAMES, </s> add </s> remove import map from 'lodash/map'; </s> add
[ "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/actions/index.js
import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
<mask> import { showLoading, hideLoading } from 'react-redux-loading-bar'; <mask> import axios from 'axios'; <mask> <mask> import versionCompare from '../helpers/versionCompare'; <mask> import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; <mask> import { SETTINGS_NAMES, CHECK_TIMEOUT } from '../helpers/constants'; <mask> import { getTlsStatus } from './encryption'; <mask> import Api from '../api/Api'; <mask> <mask> const apiClient = new Api(); </s> + client: handle the new statistics format </s> remove import round from 'lodash/round'; </s> add </s> remove STATS_NAMES, </s> add </s> remove import { getClients, getTopStats } from '../actions'; </s> add import { getClients } from '../actions'; import { getStats } from '../actions/stats';
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/actions/index.js
<mask> dispatch(getClientsFailure()); <mask> } <mask> }; <mask> <mask> export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST'); <mask> export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE'); <mask> export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS'); <mask> <mask> export const getTopStats = () => async (dispatch, getState) => { <mask> dispatch(getTopStatsRequest()); <mask> const timer = setInterval(async () => { <mask> const state = getState(); <mask> if (state.dashboard.isCoreRunning) { <mask> clearInterval(timer); <mask> try { <mask> const stats = await apiClient.getGlobalStatsTop(); <mask> dispatch(getTopStatsSuccess(stats)); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(getTopStatsFailure(error)); <mask> } <mask> } <mask> }, 100); <mask> }; <mask> <mask> export const dnsStatusRequest = createAction('DNS_STATUS_REQUEST'); <mask> export const dnsStatusFailure = createAction('DNS_STATUS_FAILURE'); <mask> export const dnsStatusSuccess = createAction('DNS_STATUS_SUCCESS'); <mask> <mask> export const getDnsStatus = () => async (dispatch) => { </s> + client: handle the new statistics format </s> remove export const getStatsRequest = createAction('GET_STATS_REQUEST'); export const getStatsFailure = createAction('GET_STATS_FAILURE'); export const getStatsSuccess = createAction('GET_STATS_SUCCESS'); export const getStats = () => async (dispatch) => { dispatch(getStatsRequest()); try { const stats = await apiClient.getGlobalStats(); const processedStats = { ...stats, avg_processing_time: round(stats.avg_processing_time, 2), }; dispatch(getStatsSuccess(processedStats)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getStatsFailure()); } }; </s> add </s> remove export const getStatsHistoryRequest = createAction('GET_STATS_HISTORY_REQUEST'); export const getStatsHistoryFailure = createAction('GET_STATS_HISTORY_FAILURE'); export const getStatsHistorySuccess = createAction('GET_STATS_HISTORY_SUCCESS'); export const getStatsHistory = () => async (dispatch) => { dispatch(getStatsHistoryRequest()); try { const statsHistory = await apiClient.getGlobalStatsHistory(); const normalizedHistory = normalizeHistory(statsHistory); dispatch(getStatsHistorySuccess(normalizedHistory)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getStatsHistoryFailure()); } }; </s> add </s> remove return { id, data, }; }); </s> add export const normalizeTopStats = stats => ( stats.map(item => ({ name: Object.keys(item)[0], count: Object.values(item)[0], })) ); </s> remove const { dashboard } = state; const props = { dashboard }; </s> add const { dashboard, stats } = state; const props = { dashboard, stats }; </s> remove export const normalizeHistory = history => Object.keys(history).map((key) => { let id = STATS_NAMES[key]; if (!id) { id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); </s> add export const normalizeHistory = (history, interval) => { if (interval === 1 || interval === 7) { const hoursAgo = subHours(Date.now(), 24 * interval); return history.map((item, index) => ({ x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'), y: round(item, 2), }));
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/actions/index.js
<mask> dispatch(addErrorToast({ error })); <mask> } <mask> }; <mask> <mask> export const getStatsRequest = createAction('GET_STATS_REQUEST'); <mask> export const getStatsFailure = createAction('GET_STATS_FAILURE'); <mask> export const getStatsSuccess = createAction('GET_STATS_SUCCESS'); <mask> <mask> export const getStats = () => async (dispatch) => { <mask> dispatch(getStatsRequest()); <mask> try { <mask> const stats = await apiClient.getGlobalStats(); <mask> <mask> const processedStats = { <mask> ...stats, <mask> avg_processing_time: round(stats.avg_processing_time, 2), <mask> }; <mask> <mask> dispatch(getStatsSuccess(processedStats)); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(getStatsFailure()); <mask> } <mask> }; <mask> <mask> export const getLogsRequest = createAction('GET_LOGS_REQUEST'); <mask> export const getLogsFailure = createAction('GET_LOGS_FAILURE'); <mask> export const getLogsSuccess = createAction('GET_LOGS_SUCCESS'); <mask> <mask> export const getLogs = () => async (dispatch, getState) => { </s> + client: handle the new statistics format </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST'); export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE'); export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS'); export const getTopStats = () => async (dispatch, getState) => { dispatch(getTopStatsRequest()); const timer = setInterval(async () => { const state = getState(); if (state.dashboard.isCoreRunning) { clearInterval(timer); try { const stats = await apiClient.getGlobalStatsTop(); dispatch(getTopStatsSuccess(stats)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getTopStatsFailure(error)); } } }, 100); }; </s> add </s> remove export const getStatsHistoryRequest = createAction('GET_STATS_HISTORY_REQUEST'); export const getStatsHistoryFailure = createAction('GET_STATS_HISTORY_FAILURE'); export const getStatsHistorySuccess = createAction('GET_STATS_HISTORY_SUCCESS'); export const getStatsHistory = () => async (dispatch) => { dispatch(getStatsHistoryRequest()); try { const statsHistory = await apiClient.getGlobalStatsHistory(); const normalizedHistory = normalizeHistory(statsHistory); dispatch(getStatsHistorySuccess(normalizedHistory)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getStatsHistoryFailure()); } }; </s> add </s> remove return { id, data, }; }); </s> add export const normalizeTopStats = stats => ( stats.map(item => ({ name: Object.keys(item)[0], count: Object.values(item)[0], })) ); </s> remove const { dashboard } = state; const props = { dashboard }; </s> add const { dashboard, stats } = state; const props = { dashboard, stats }; </s> remove export const normalizeHistory = history => Object.keys(history).map((key) => { let id = STATS_NAMES[key]; if (!id) { id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); </s> add export const normalizeHistory = (history, interval) => { if (interval === 1 || interval === 7) { const hoursAgo = subHours(Date.now(), 24 * interval); return history.map((item, index) => ({ x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'), y: round(item, 2), }));
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/actions/index.js
<mask> }; <mask> <mask> export const handleRulesChange = createAction('HANDLE_RULES_CHANGE'); <mask> <mask> export const getStatsHistoryRequest = createAction('GET_STATS_HISTORY_REQUEST'); <mask> export const getStatsHistoryFailure = createAction('GET_STATS_HISTORY_FAILURE'); <mask> export const getStatsHistorySuccess = createAction('GET_STATS_HISTORY_SUCCESS'); <mask> <mask> export const getStatsHistory = () => async (dispatch) => { <mask> dispatch(getStatsHistoryRequest()); <mask> try { <mask> const statsHistory = await apiClient.getGlobalStatsHistory(); <mask> const normalizedHistory = normalizeHistory(statsHistory); <mask> dispatch(getStatsHistorySuccess(normalizedHistory)); <mask> } catch (error) { <mask> dispatch(addErrorToast({ error })); <mask> dispatch(getStatsHistoryFailure()); <mask> } <mask> }; <mask> <mask> export const addFilterRequest = createAction('ADD_FILTER_REQUEST'); <mask> export const addFilterFailure = createAction('ADD_FILTER_FAILURE'); <mask> export const addFilterSuccess = createAction('ADD_FILTER_SUCCESS'); <mask> <mask> export const addFilter = (url, name) => async (dispatch) => { </s> + client: handle the new statistics format </s> remove export const getStatsRequest = createAction('GET_STATS_REQUEST'); export const getStatsFailure = createAction('GET_STATS_FAILURE'); export const getStatsSuccess = createAction('GET_STATS_SUCCESS'); export const getStats = () => async (dispatch) => { dispatch(getStatsRequest()); try { const stats = await apiClient.getGlobalStats(); const processedStats = { ...stats, avg_processing_time: round(stats.avg_processing_time, 2), }; dispatch(getStatsSuccess(processedStats)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getStatsFailure()); } }; </s> add </s> remove export const getTopStatsRequest = createAction('GET_TOP_STATS_REQUEST'); export const getTopStatsFailure = createAction('GET_TOP_STATS_FAILURE'); export const getTopStatsSuccess = createAction('GET_TOP_STATS_SUCCESS'); export const getTopStats = () => async (dispatch, getState) => { dispatch(getTopStatsRequest()); const timer = setInterval(async () => { const state = getState(); if (state.dashboard.isCoreRunning) { clearInterval(timer); try { const stats = await apiClient.getGlobalStatsTop(); dispatch(getTopStatsSuccess(stats)); } catch (error) { dispatch(addErrorToast({ error })); dispatch(getTopStatsFailure(error)); } } }, 100); }; </s> add </s> remove return { id, data, }; }); </s> add export const normalizeTopStats = stats => ( stats.map(item => ({ name: Object.keys(item)[0], count: Object.values(item)[0], })) ); </s> remove export const normalizeHistory = history => Object.keys(history).map((key) => { let id = STATS_NAMES[key]; if (!id) { id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); </s> add export const normalizeHistory = (history, interval) => { if (interval === 1 || interval === 7) { const hoursAgo = subHours(Date.now(), 24 * interval); return history.map((item, index) => ({ x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'), y: round(item, 2), }));
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/actions/index.js
import { normalizeTopStats } from '../helpers/helpers';
<mask> import Api from '../api/Api'; <mask> import { addErrorToast, addSuccessToast } from './index'; <mask> <mask> const apiClient = new Api(); <mask> <mask> export const getStatsConfigRequest = createAction('GET_LOGS_CONFIG_REQUEST'); <mask> export const getStatsConfigFailure = createAction('GET_LOGS_CONFIG_FAILURE'); </s> + client: handle the new statistics format </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> remove import subHours from 'date-fns/sub_hours'; import dateFormat from 'date-fns/format'; </s> add </s> remove const { dashboard } = state; const props = { dashboard }; </s> add const { dashboard, stats } = state; const props = { dashboard, stats }; </s> remove import * as actionCreators from '../actions'; </s> add import { toggleProtection, getClients } from '../actions'; import { getStats, getStatsConfig, setStatsConfig } from '../actions/stats'; </s> remove import { getClients, getTopStats } from '../actions'; </s> add import { getClients } from '../actions'; import { getStats } from '../actions/stats';
[ "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/actions/stats.js
<mask> import axios from 'axios'; <mask> import subHours from 'date-fns/sub_hours'; <mask> import dateFormat from 'date-fns/format'; <mask> <mask> export default class Api { <mask> baseUrl = 'control'; <mask> <mask> async makeRequest(path, method = 'POST', config) { </s> + client: handle the new statistics format </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> remove import round from 'lodash/round'; </s> add </s> remove STATS_NAMES, </s> add
[ "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
<mask> <mask> // Global methods <mask> GLOBAL_RESTART = { path: 'restart', method: 'POST' }; <mask> GLOBAL_START = { path: 'start', method: 'POST' }; <mask> GLOBAL_STATS = { path: 'stats', method: 'GET' }; <mask> GLOBAL_STATS_HISTORY = { path: 'stats_history', method: 'GET' }; <mask> GLOBAL_STATUS = { path: 'status', method: 'GET' }; <mask> GLOBAL_STOP = { path: 'stop', method: 'POST' }; <mask> GLOBAL_STATS_TOP = { path: 'stats_top', method: 'GET' }; <mask> GLOBAL_QUERY_LOG = { path: 'querylog', method: 'GET' }; <mask> GLOBAL_QUERY_LOG_ENABLE = { path: 'querylog_enable', method: 'POST' }; </s> + client: handle the new statistics format </s> remove GLOBAL_STATS_TOP = { path: 'stats_top', method: 'GET' }; </s> add </s> remove const { dashboard } = state; const props = { dashboard }; </s> add const { dashboard, stats } = state; const props = { dashboard, stats }; </s> remove if (stats && stats.top_clients) { return stats.top_clients[ip]; </s> add if (stats) { const statsForCurrentIP = stats.find(item => item.name === ip); return statsForCurrentIP && statsForCurrentIP.count;
[ "keep", "keep", "keep", "keep", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
<mask> GLOBAL_STATS = { path: 'stats', method: 'GET' }; <mask> GLOBAL_STATS_HISTORY = { path: 'stats_history', method: 'GET' }; <mask> GLOBAL_STATUS = { path: 'status', method: 'GET' }; <mask> GLOBAL_STOP = { path: 'stop', method: 'POST' }; <mask> GLOBAL_STATS_TOP = { path: 'stats_top', method: 'GET' }; <mask> GLOBAL_QUERY_LOG = { path: 'querylog', method: 'GET' }; <mask> GLOBAL_QUERY_LOG_ENABLE = { path: 'querylog_enable', method: 'POST' }; <mask> GLOBAL_QUERY_LOG_DISABLE = { path: 'querylog_disable', method: 'POST' }; <mask> GLOBAL_SET_UPSTREAM_DNS = { path: 'set_upstreams_config', method: 'POST' }; <mask> GLOBAL_TEST_UPSTREAM_DNS = { path: 'test_upstream_dns', method: 'POST' }; </s> + client: handle the new statistics format </s> remove GLOBAL_STATS = { path: 'stats', method: 'GET' }; GLOBAL_STATS_HISTORY = { path: 'stats_history', method: 'GET' }; </s> add </s> remove const { dashboard } = state; const props = { dashboard }; </s> add const { dashboard, stats } = state; const props = { dashboard, stats }; </s> remove if (stats && stats.top_clients) { return stats.top_clients[ip]; </s> add if (stats) { const statsForCurrentIP = stats.find(item => item.name === ip); return statsForCurrentIP && statsForCurrentIP.count;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
<mask> const { path, method } = this.GLOBAL_STOP; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> getGlobalStats() { <mask> const { path, method } = this.GLOBAL_STATS; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> getGlobalStatsHistory() { <mask> const { path, method } = this.GLOBAL_STATS_HISTORY; <mask> const format = 'YYYY-MM-DDTHH:mm:ssZ'; <mask> const dateNow = Date.now(); <mask> <mask> const config = { <mask> params: { <mask> start_time: dateFormat(subHours(dateNow, 24), format), <mask> end_time: dateFormat(dateNow, format), <mask> time_unit: 'hours', <mask> }, <mask> }; <mask> return this.makeRequest(path, method, config); <mask> } <mask> <mask> getGlobalStatus() { <mask> const { path, method } = this.GLOBAL_STATUS; <mask> return this.makeRequest(path, method); <mask> } <mask> </s> + client: handle the new statistics format </s> remove getGlobalStatsTop() { const { path, method } = this.GLOBAL_STATS_TOP; return this.makeRequest(path, method); } </s> add </s> remove const { dashboard, clients } = state; </s> add const { dashboard, clients, stats } = state; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
<mask> const { path, method } = this.GLOBAL_STATUS; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> getGlobalStatsTop() { <mask> const { path, method } = this.GLOBAL_STATS_TOP; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> getQueryLog() { <mask> const { path, method } = this.GLOBAL_QUERY_LOG; <mask> return this.makeRequest(path, method); <mask> } <mask> </s> + client: handle the new statistics format </s> remove getGlobalStats() { const { path, method } = this.GLOBAL_STATS; return this.makeRequest(path, method); } getGlobalStatsHistory() { const { path, method } = this.GLOBAL_STATS_HISTORY; const format = 'YYYY-MM-DDTHH:mm:ssZ'; const dateNow = Date.now(); const config = { params: { start_time: dateFormat(subHours(dateNow, 24), format), end_time: dateFormat(dateNow, format), time_unit: 'hours', }, }; return this.makeRequest(path, method, config); } </s> add </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove const { dashboard, clients } = state; </s> add const { dashboard, clients, stats } = state;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
GET_STATS = { path: 'stats', method: 'GET' };
<mask> return this.makeRequest(path, method, parameters); <mask> } <mask> <mask> // Settings for statistics <mask> STATS_INFO = { path: 'stats_info', method: 'GET' }; <mask> STATS_CONFIG = { path: 'stats_config', method: 'POST' }; <mask> <mask> getStats() { <mask> const { path, method } = this.GET_STATS; </s> + client: handle the new statistics format </s> remove GLOBAL_STATS = { path: 'stats', method: 'GET' }; GLOBAL_STATS_HISTORY = { path: 'stats_history', method: 'GET' }; </s> add </s> remove GLOBAL_STATS_TOP = { path: 'stats_top', method: 'GET' }; </s> add </s> remove getGlobalStats() { const { path, method } = this.GLOBAL_STATS; return this.makeRequest(path, method); } getGlobalStatsHistory() { const { path, method } = this.GLOBAL_STATS_HISTORY; const format = 'YYYY-MM-DDTHH:mm:ssZ'; const dateNow = Date.now(); const config = { params: { start_time: dateFormat(subHours(dateNow, 24), format), end_time: dateFormat(dateNow, format), time_unit: 'hours', }, }; return this.makeRequest(path, method, config); } </s> add </s> remove getGlobalStatsTop() { const { path, method } = this.GLOBAL_STATS_TOP; return this.makeRequest(path, method); } </s> add
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
getStats() { const { path, method } = this.GET_STATS; return this.makeRequest(path, method); }
<mask> STATS_CONFIG = { path: 'stats_config', method: 'POST' }; <mask> <mask> getStatsInfo() { <mask> const { path, method } = this.STATS_INFO; <mask> return this.makeRequest(path, method); <mask> } <mask> <mask> setStatsConfig(data) { </s> + client: handle the new statistics format </s> remove getGlobalStatsTop() { const { path, method } = this.GLOBAL_STATS_TOP; return this.makeRequest(path, method); } </s> add </s> remove getGlobalStats() { const { path, method } = this.GLOBAL_STATS; return this.makeRequest(path, method); } getGlobalStatsHistory() { const { path, method } = this.GLOBAL_STATS_HISTORY; const format = 'YYYY-MM-DDTHH:mm:ssZ'; const dateNow = Date.now(); const config = { params: { start_time: dateFormat(subHours(dateNow, 24), format), end_time: dateFormat(dateNow, format), time_unit: 'hours', }, }; return this.makeRequest(path, method, config); } </s> add </s> remove GLOBAL_STATS_TOP = { path: 'stats_top', method: 'GET' }; </s> add </s> remove GLOBAL_STATS = { path: 'stats', method: 'GET' }; GLOBAL_STATS_HISTORY = { path: 'stats_history', method: 'GET' }; </s> add
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/api/Api.js
<mask> import React, { Component } from 'react'; <mask> import ReactTable from 'react-table'; <mask> import PropTypes from 'prop-types'; <mask> import map from 'lodash/map'; <mask> import { withNamespaces, Trans } from 'react-i18next'; <mask> <mask> import Card from '../ui/Card'; <mask> import Cell from '../ui/Cell'; <mask> import Popover from '../ui/Popover'; </s> + client: handle the new statistics format </s> remove import map from 'lodash/map'; </s> add </s> remove import map from 'lodash/map'; </s> add </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove import round from 'lodash/round'; </s> add
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value);
<mask> import { getPercent } from '../../helpers/helpers'; <mask> import { STATUS_COLORS } from '../../helpers/constants'; <mask> <mask> class BlockedDomains extends Component { <mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: (row) => { <mask> const { value } = row; <mask> const trackerData = getTrackerData(value); <mask> <mask> return ( <mask> <div className="logs__row"> <mask> <div className="logs__text" title={value}> <mask> {value} </s> + client: handle the new statistics format </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> add columns = [ { Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />}
<mask> Cell: (row) => { <mask> const { value } = row; <mask> const trackerData = getTrackerData(value); <mask> <mask> return ( <mask> <div className="logs__row"> <mask> <div className="logs__text" title={value}> <mask> {value} <mask> </div> <mask> {trackerData && <Popover data={trackerData} />} <mask> </div> <mask> ); <mask> }, </s> + client: handle the new statistics format </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); }, </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); }, </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
); },
<mask> <div className="logs__row"> <mask> <div className="logs__text" title={value}> <mask> {value} <mask> </div> <mask> {trackerData && <Popover data={trackerData} />} <mask> </div> <mask> ); <mask> }, <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'domain', <mask> maxWidth: 190, </s> + client: handle the new statistics format </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); }, </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
{ Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
<mask> {trackerData && <Popover data={trackerData} />} <mask> </div> <mask> ); <mask> }, <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'domain', <mask> maxWidth: 190, <mask> Cell: ({ value }) => { <mask> const { <mask> blockedFiltering, <mask> replacedSafebrowsing, <mask> replacedParental, <mask> } = this.props; <mask> const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; <mask> const percent = getPercent(blocked, value); <mask> <mask> return ( <mask> <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> <mask> ); <mask> }, </s> + client: handle the new statistics format </s> remove return ( <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> ); </s> add return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />; }, </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; },
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />; },
<mask> } = this.props; <mask> const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; <mask> const percent = getPercent(blocked, value); <mask> <mask> return ( <mask> <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> <mask> ); <mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; </s> + client: handle the new statistics format </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove }]; </s> add ]; </s> remove }]; </s> add ];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
];
<mask> return ( <mask> <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> <mask> ); <mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> + client: handle the new statistics format </s> remove }]; </s> add ]; </s> remove }]; </s> add ]; </s> remove return ( <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> ); </s> add return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />; }, </s> remove const { t } = this.props; </s> add const { t, refreshButton, topBlockedDomains, subtitle, } = this.props; </s> remove <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_blocked_domains')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} >
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
const { t, refreshButton, topBlockedDomains, subtitle, } = this.props;
<mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topBlockedDomains, (value, prop) => ( <mask> { ip: prop, domain: value } </s> + client: handle the new statistics format </s> remove <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_blocked_domains')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove const { t } = this.props; </s> add const { t, refreshButton, topClients, subtitle, } = this.props; </s> remove const { t } = this.props; </s> add const { t, refreshButton, topQueriedDomains, subtitle, } = this.props; </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} >
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
<Card title={t('top_blocked_domains')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} >
<mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topBlockedDomains, (value, prop) => ( <mask> { ip: prop, domain: value } <mask> ))} <mask> columns={this.columns} </s> + client: handle the new statistics format </s> remove const { t } = this.props; </s> add const { t, refreshButton, topBlockedDomains, subtitle, } = this.props; </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('stats_query_domain')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))}
<mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topBlockedDomains, (value, prop) => ( <mask> { ip: prop, domain: value } <mask> ))} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText={ t('no_domains_found') } <mask> minRows={6} <mask> className="-striped -highlight card-table-overflow stats__table" </s> + client: handle the new statistics format </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_blocked_domains')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))} </s> remove noDataText={ t('no_domains_found') } </s> add noDataText={t('no_domains_found')} </s> remove const { t } = this.props; </s> add const { t, refreshButton, topBlockedDomains, subtitle, } = this.props;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
noDataText={t('no_domains_found')}
<mask> { ip: prop, domain: value } <mask> ))} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText={ t('no_domains_found') } <mask> minRows={6} <mask> className="-striped -highlight card-table-overflow stats__table" <mask> /> <mask> </Card> <mask> ); </s> + client: handle the new statistics format </s> remove noDataText={ t('no_domains_found') } </s> add noDataText={t('no_domains_found')} </s> remove noDataText={ t('no_clients_found') } </s> add noDataText={t('no_clients_found')} </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
topBlockedDomains: PropTypes.array.isRequired,
<mask> } <mask> } <mask> <mask> BlockedDomains.propTypes = { <mask> topBlockedDomains: PropTypes.object.isRequired, <mask> blockedFiltering: PropTypes.number.isRequired, <mask> replacedSafebrowsing: PropTypes.number.isRequired, <mask> replacedParental: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> t: PropTypes.func, </s> + client: handle the new statistics format </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, </s> add interval: PropTypes.number.isRequired, dnsQueries: PropTypes.array.isRequired, blockedFiltering: PropTypes.array.isRequired, replacedSafebrowsing: PropTypes.array.isRequired, replacedParental: PropTypes.array.isRequired, numDnsQueries: PropTypes.number.isRequired, numBlockedFiltering: PropTypes.number.isRequired, numReplacedSafebrowsing: PropTypes.number.isRequired, numReplacedParental: PropTypes.number.isRequired, </s> remove topQueriedDomains: PropTypes.object.isRequired, </s> add topQueriedDomains: PropTypes.array.isRequired, </s> remove topClients: PropTypes.object.isRequired, </s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
<mask> blockedFiltering: PropTypes.number.isRequired, <mask> replacedSafebrowsing: PropTypes.number.isRequired, <mask> replacedParental: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> t: PropTypes.func, <mask> }; <mask> <mask> export default withNamespaces()(BlockedDomains); </s> + client: handle the new statistics format </s> remove topBlockedDomains: PropTypes.object.isRequired, </s> add topBlockedDomains: PropTypes.array.isRequired, </s> remove history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, </s> add interval: PropTypes.number.isRequired, dnsQueries: PropTypes.array.isRequired, blockedFiltering: PropTypes.array.isRequired, replacedSafebrowsing: PropTypes.array.isRequired, replacedParental: PropTypes.array.isRequired, numDnsQueries: PropTypes.number.isRequired, numBlockedFiltering: PropTypes.number.isRequired, numReplacedSafebrowsing: PropTypes.number.isRequired, numReplacedParental: PropTypes.number.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/BlockedDomains.js
<mask> import React, { Component } from 'react'; <mask> import ReactTable from 'react-table'; <mask> import PropTypes from 'prop-types'; <mask> import map from 'lodash/map'; <mask> import { Trans, withNamespaces } from 'react-i18next'; <mask> <mask> import Card from '../ui/Card'; <mask> import Cell from '../ui/Cell'; <mask> </s> + client: handle the new statistics format </s> remove import map from 'lodash/map'; </s> add </s> remove import map from 'lodash/map'; </s> add </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove import round from 'lodash/round'; </s> add
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
};
<mask> } else if (percent > 10) { <mask> return STATUS_COLORS.yellow; <mask> } <mask> return STATUS_COLORS.red; <mask> } <mask> <mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: ({ value }) => { </s> + client: handle the new statistics format </s> remove } </s> add }; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> add columns = [ { Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent);
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
columns = [ { Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client;
<mask> } <mask> return STATUS_COLORS.red; <mask> } <mask> <mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: ({ value }) => { <mask> const clientName = getClientName(this.props.clients, value) <mask> || getClientName(this.props.autoClients, value); <mask> let client; <mask> <mask> if (clientName) { <mask> client = <span>{clientName} <small>({value})</small></span>; <mask> } else { <mask> client = value; </s> + client: handle the new statistics format </s> remove if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } </s> add if (clientName) { client = ( <span> {clientName} <small>({value})</small> </span> ); } else { client = value; } </s> remove } </s> add }; </s> remove } </s> add }; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
if (clientName) { client = ( <span> {clientName} <small>({value})</small> </span> ); } else { client = value; }
<mask> const clientName = getClientName(this.props.clients, value) <mask> || getClientName(this.props.autoClients, value); <mask> let client; <mask> <mask> if (clientName) { <mask> client = <span>{clientName} <small>({value})</small></span>; <mask> } else { <mask> client = value; <mask> } <mask> <mask> return ( <mask> <div className="logs__row logs__row--overflow"> <mask> <span className="logs__text" title={value}> <mask> {client} </s> + client: handle the new statistics format </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> add columns = [ { Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> remove return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); </s> add return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />}
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10),
<mask> } else { <mask> client = value; <mask> } <mask> <mask> return ( <mask> <div className="logs__row logs__row--overflow"> <mask> <span className="logs__text" title={value}> <mask> {client} <mask> </span> <mask> </div> <mask> ); <mask> }, <mask> sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'count', </s> + client: handle the new statistics format </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } </s> add if (clientName) { client = ( <span> {clientName} <small>({value})</small> </span> ); } else { client = value; } </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); }, </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); }, </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
{ Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent);
<mask> </span> <mask> </div> <mask> ); <mask> }, <mask> sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'count', <mask> Cell: ({ value }) => { <mask> const percent = getPercent(this.props.dnsQueries, value); <mask> const percentColor = this.getPercentColor(percent); <mask> <mask> return ( <mask> <Cell value={value} percent={percent} color={percentColor} /> <mask> ); <mask> }, </s> + client: handle the new statistics format </s> remove return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); </s> add return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
return <Cell value={value} percent={percent} color={percentColor} />; },
<mask> Cell: ({ value }) => { <mask> const percent = getPercent(this.props.dnsQueries, value); <mask> const percentColor = this.getPercentColor(percent); <mask> <mask> return ( <mask> <Cell value={value} percent={percent} color={percentColor} /> <mask> ); <mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; </s> + client: handle the new statistics format </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove return ( <Cell value={value} percent={percent} color={STATUS_COLORS.red} /> ); </s> add return <Cell value={value} percent={percent} color={STATUS_COLORS.red} />; }, </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
];
<mask> return ( <mask> <Cell value={value} percent={percent} color={percentColor} /> <mask> ); <mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> + client: handle the new statistics format </s> remove }]; </s> add ]; </s> remove }]; </s> add ]; </s> remove const { t } = this.props; </s> add const { t, refreshButton, topClients, subtitle, } = this.props; </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; },
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
const { t, refreshButton, topClients, subtitle, } = this.props;
<mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topClients, (value, prop) => ( <mask> { ip: prop, count: value } </s> + client: handle the new statistics format </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove const { t } = this.props; </s> add const { t, refreshButton, topQueriedDomains, subtitle, } = this.props; </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))} </s> remove const { t } = this.props; </s> add const { t, refreshButton, topBlockedDomains, subtitle, } = this.props; </s> remove <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('stats_query_domain')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} >
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
<Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} >
<mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topClients, (value, prop) => ( <mask> { ip: prop, count: value } <mask> ))} <mask> columns={this.columns} </s> + client: handle the new statistics format </s> remove const { t } = this.props; </s> add const { t, refreshButton, topClients, subtitle, } = this.props; </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))} </s> remove <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('stats_query_domain')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_blocked_domains')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove const { t } = this.props; </s> add const { t, refreshButton, topQueriedDomains, subtitle, } = this.props;
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
data={topClients.map(item => ({ ip: item.name, count: item.count, }))}
<mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topClients, (value, prop) => ( <mask> { ip: prop, count: value } <mask> ))} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText={ t('no_clients_found') } <mask> minRows={6} <mask> className="-striped -highlight card-table-overflow" </s> + client: handle the new statistics format </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove const { t } = this.props; </s> add const { t, refreshButton, topClients, subtitle, } = this.props; </s> remove noDataText={ t('no_clients_found') } </s> add noDataText={t('no_clients_found')}
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
noDataText={t('no_clients_found')}
<mask> { ip: prop, count: value } <mask> ))} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText={ t('no_clients_found') } <mask> minRows={6} <mask> className="-striped -highlight card-table-overflow" <mask> /> <mask> </Card> <mask> ); </s> + client: handle the new statistics format </s> remove noDataText={ t('no_domains_found') } </s> add noDataText={t('no_domains_found')} </s> remove noDataText={ t('no_domains_found') } </s> add noDataText={t('no_domains_found')} </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))} </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
topClients: PropTypes.array.isRequired,
<mask> } <mask> } <mask> <mask> Clients.propTypes = { <mask> topClients: PropTypes.object.isRequired, <mask> dnsQueries: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> clients: PropTypes.array.isRequired, <mask> autoClients: PropTypes.array.isRequired, <mask> t: PropTypes.func, </s> + client: handle the new statistics format </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove topQueriedDomains: PropTypes.object.isRequired, </s> add topQueriedDomains: PropTypes.array.isRequired, </s> remove topBlockedDomains: PropTypes.object.isRequired, </s> add topBlockedDomains: PropTypes.array.isRequired, </s> remove history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, </s> add interval: PropTypes.number.isRequired, dnsQueries: PropTypes.array.isRequired, blockedFiltering: PropTypes.array.isRequired, replacedSafebrowsing: PropTypes.array.isRequired, replacedParental: PropTypes.array.isRequired, numDnsQueries: PropTypes.number.isRequired, numBlockedFiltering: PropTypes.number.isRequired, numReplacedSafebrowsing: PropTypes.number.isRequired, numReplacedParental: PropTypes.number.isRequired, </s> remove topStats: PropTypes.object.isRequired, </s> add topClients: PropTypes.array.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
<mask> dnsQueries: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> clients: PropTypes.array.isRequired, <mask> autoClients: PropTypes.array.isRequired, <mask> t: PropTypes.func, <mask> }; <mask> <mask> export default withNamespaces()(Clients); </s> + client: handle the new statistics format </s> remove topClients: PropTypes.object.isRequired, </s> add topClients: PropTypes.array.isRequired, </s> remove topQueriedDomains: PropTypes.object.isRequired, </s> add topQueriedDomains: PropTypes.array.isRequired, </s> remove history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, </s> add interval: PropTypes.number.isRequired, dnsQueries: PropTypes.array.isRequired, blockedFiltering: PropTypes.array.isRequired, replacedSafebrowsing: PropTypes.array.isRequired, replacedParental: PropTypes.array.isRequired, numDnsQueries: PropTypes.number.isRequired, numBlockedFiltering: PropTypes.number.isRequired, numReplacedSafebrowsing: PropTypes.number.isRequired, numReplacedParental: PropTypes.number.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Clients.js
import round from 'lodash/round';
<mask> import React from 'react'; <mask> import PropTypes from 'prop-types'; <mask> import { Trans, withNamespaces } from 'react-i18next'; <mask> <mask> import Card from '../ui/Card'; <mask> import Tooltip from '../ui/Tooltip'; <mask> <mask> const tooltipType = 'tooltip-custom--narrow'; <mask> </s> + client: handle the new statistics format </s> remove import map from 'lodash/map'; </s> add </s> remove import map from 'lodash/map'; </s> add </s> remove import map from 'lodash/map'; </s> add </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers'; </s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Counters.js
const Counters = (props) => { const { t, interval, refreshButton, subtitle, dnsQueries, blockedFiltering, replacedSafebrowsing, replacedParental, replacedSafesearch, avgProcessingTime, } = props; const tooltipTitle = interval === 1 ? t('number_of_dns_query_24_hours') : t('number_of_dns_query_days', { value: interval }); return ( <Card title={t('general_statistics')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > <table className="table card-table"> <tbody> <tr> <td> <Trans>dns_query</Trans> <Tooltip text={tooltipTitle} type={tooltipType} /> </td> <td className="text-right"> <span className="text-muted">{dnsQueries}</span> </td> </tr> <tr> <td> <a href="#filters"> <Trans>blocked_by</Trans> </a> <Tooltip text={t('number_of_dns_query_blocked_24_hours')} type={tooltipType} /> </td> <td className="text-right"> <span className="text-muted">{blockedFiltering}</span> </td> </tr> <tr> <td> <Trans>stats_malware_phishing</Trans> <Tooltip text={t('number_of_dns_query_blocked_24_hours_by_sec')} type={tooltipType} /> </td> <td className="text-right"> <span className="text-muted">{replacedSafebrowsing}</span> </td> </tr> <tr> <td> <Trans>stats_adult</Trans> <Tooltip text={t('number_of_dns_query_blocked_24_hours_adult')} type={tooltipType} /> </td> <td className="text-right"> <span className="text-muted">{replacedParental}</span> </td> </tr> <tr> <td> <Trans>enforced_save_search</Trans> <Tooltip text={t('number_of_dns_query_to_safe_search')} type={tooltipType} /> </td> <td className="text-right"> <span className="text-muted">{replacedSafesearch}</span> </td> </tr> <tr> <td> <Trans>average_processing_time</Trans> <Tooltip text={t('average_processing_time_hint')} type={tooltipType} /> </td> <td className="text-right"> <span className="text-muted"> {avgProcessingTime ? `${round(avgProcessingTime, 2)} ms` : 0} </span> </td> </tr> </tbody> </table> </Card> ); };
<mask> import Tooltip from '../ui/Tooltip'; <mask> <mask> const tooltipType = 'tooltip-custom--narrow'; <mask> <mask> const Counters = props => ( <mask> <Card title={ props.t('general_statistics') } subtitle={ props.t('for_last_24_hours') } bodyType="card-table" refresh={props.refreshButton}> <mask> <table className="table card-table"> <mask> <tbody> <mask> <tr> <mask> <td> <mask> <Trans>dns_query</Trans> <mask> <Tooltip text={ props.t('number_of_dns_query_24_hours') } type={tooltipType} /> <mask> </td> <mask> <td className="text-right"> <mask> <span className="text-muted"> <mask> {props.dnsQueries} <mask> </span> <mask> </td> <mask> </tr> <mask> <tr> <mask> <td> <mask> <a href="#filters"> <mask> <Trans>blocked_by</Trans> <mask> </a> <mask> <Tooltip text={ props.t('number_of_dns_query_blocked_24_hours') } type={tooltipType} /> <mask> </td> <mask> <td className="text-right"> <mask> <span className="text-muted"> <mask> {props.blockedFiltering} <mask> </span> <mask> </td> <mask> </tr> <mask> <tr> <mask> <td> <mask> <Trans>stats_malware_phishing</Trans> <mask> <Tooltip text={ props.t('number_of_dns_query_blocked_24_hours_by_sec') } type={tooltipType} /> <mask> </td> <mask> <td className="text-right"> <mask> <span className="text-muted"> <mask> {props.replacedSafebrowsing} <mask> </span> <mask> </td> <mask> </tr> <mask> <tr> <mask> <td> <mask> <Trans>stats_adult</Trans> <mask> <Tooltip text={ props.t('number_of_dns_query_blocked_24_hours_adult') } type={tooltipType} /> <mask> </td> <mask> <td className="text-right"> <mask> <span className="text-muted"> <mask> {props.replacedParental} <mask> </span> <mask> </td> <mask> </tr> <mask> <tr> <mask> <td> <mask> <Trans>enforced_save_search</Trans> <mask> <Tooltip text={ props.t('number_of_dns_query_to_safe_search') } type={tooltipType} /> <mask> </td> <mask> <td className="text-right"> <mask> <span className="text-muted"> <mask> {props.replacedSafesearch} <mask> </span> <mask> </td> <mask> </tr> <mask> <tr> <mask> <td> <mask> <Trans>average_processing_time</Trans> <mask> <Tooltip text={ props.t('average_processing_time_hint') } type={tooltipType} /> <mask> </td> <mask> <td className="text-right"> <mask> <span className="text-muted"> <mask> {props.avgProcessingTime} <mask> </span> <mask> </td> <mask> </tr> <mask> </tbody> <mask> </table> <mask> </Card> <mask> ); <mask> <mask> Counters.propTypes = { <mask> dnsQueries: PropTypes.number.isRequired, <mask> blockedFiltering: PropTypes.number.isRequired, <mask> replacedSafebrowsing: PropTypes.number.isRequired, </s> + client: handle the new statistics format </s> remove return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); </s> add return ( <div className="logs__row logs__row--overflow"> <span className="logs__text" title={value}> {client} </span> </div> ); }, sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), </s> remove if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } </s> add if (clientName) { client = ( <span> {clientName} <small>({value})</small> </span> ); } else { client = value; } </s> remove history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, </s> add interval: PropTypes.number.isRequired, dnsQueries: PropTypes.array.isRequired, blockedFiltering: PropTypes.array.isRequired, replacedSafebrowsing: PropTypes.array.isRequired, replacedParental: PropTypes.array.isRequired, numDnsQueries: PropTypes.number.isRequired, numBlockedFiltering: PropTypes.number.isRequired, numReplacedSafebrowsing: PropTypes.number.isRequired, numReplacedParental: PropTypes.number.isRequired, </s> remove }]; </s> add ]; </s> remove }]; </s> add ];
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Counters.js
subtitle: PropTypes.string.isRequired, interval: PropTypes.number.isRequired,
<mask> replacedParental: PropTypes.number.isRequired, <mask> replacedSafesearch: PropTypes.number.isRequired, <mask> avgProcessingTime: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> t: PropTypes.func.isRequired, <mask> }; <mask> <mask> export default withNamespaces()(Counters); </s> + client: handle the new statistics format </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove history: PropTypes.array.isRequired, dnsQueries: PropTypes.number.isRequired, blockedFiltering: PropTypes.number.isRequired, replacedSafebrowsing: PropTypes.number.isRequired, replacedParental: PropTypes.number.isRequired, </s> add interval: PropTypes.number.isRequired, dnsQueries: PropTypes.array.isRequired, blockedFiltering: PropTypes.array.isRequired, replacedSafebrowsing: PropTypes.array.isRequired, replacedParental: PropTypes.array.isRequired, numDnsQueries: PropTypes.number.isRequired, numBlockedFiltering: PropTypes.number.isRequired, numReplacedSafebrowsing: PropTypes.number.isRequired, numReplacedParental: PropTypes.number.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove topBlockedDomains: PropTypes.object.isRequired, </s> add topBlockedDomains: PropTypes.array.isRequired,
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Counters.js
.card-chart-bg { left: -20px; width: calc(100% + 20px); }
<mask> top: -11px; <mask> border-top: 6px solid transparent; <mask> border-bottom: 6px solid #585965; <mask> } </s> + client: handle the new statistics format </s> remove const Line = props => ( props.data && </s> add const Line = ({ data, color }) => ( data && </s> remove left: 0, </s> add left: 20, </s> remove data={props.data} </s> add data={data} </s> remove } </s> add )} </s> remove getGlobalStatsTop() { const { path, method } = this.GLOBAL_STATS_TOP; return this.makeRequest(path, method); } </s> add
[ "keep", "keep", "keep", "add" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Dashboard.css
<mask> import React, { Component } from 'react'; <mask> import ReactTable from 'react-table'; <mask> import PropTypes from 'prop-types'; <mask> import map from 'lodash/map'; <mask> import { withNamespaces, Trans } from 'react-i18next'; <mask> <mask> import Card from '../ui/Card'; <mask> import Cell from '../ui/Cell'; <mask> import Popover from '../ui/Popover'; </s> + client: handle the new statistics format
[ "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
};
<mask> } else if (percent > 5) { <mask> return STATUS_COLORS.yellow; <mask> } <mask> return STATUS_COLORS.green; <mask> } <mask> <mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: (row) => { </s> + client: handle the new statistics format </s> remove } </s> add }; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> add columns = [ { Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove if (clientName) { client = <span>{clientName} <small>({value})</small></span>; } else { client = value; } </s> add if (clientName) { client = ( <span> {clientName} <small>({value})</small> </span> ); } else { client = value; }
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value);
<mask> } <mask> return STATUS_COLORS.green; <mask> } <mask> <mask> columns = [{ <mask> Header: 'IP', <mask> accessor: 'ip', <mask> Cell: (row) => { <mask> const { value } = row; <mask> const trackerData = getTrackerData(value); <mask> <mask> return ( <mask> <div className="logs__row"> <mask> <div className="logs__text" title={value}> <mask> {value} </s> + client: handle the new statistics format </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove } </s> add }; </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client; </s> add columns = [ { Header: 'IP', accessor: 'ip', Cell: ({ value }) => { const clientName = getClientName(this.props.clients, value) || getClientName(this.props.autoClients, value); let client;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />}
<mask> Cell: (row) => { <mask> const { value } = row; <mask> const trackerData = getTrackerData(value); <mask> <mask> return ( <mask> <div className="logs__row"> <mask> <div className="logs__text" title={value}> <mask> {value} <mask> </div> <mask> {trackerData && <Popover data={trackerData} />} <mask> </div> <mask> ); <mask> }, </s> + client: handle the new statistics format
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
); },
<mask> <div className="logs__row"> <mask> <div className="logs__text" title={value}> <mask> {value} <mask> </div> <mask> {trackerData && <Popover data={trackerData} />} <mask> </div> <mask> ); <mask> }, <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'count', <mask> maxWidth: 190, </s> + client: handle the new statistics format </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); }, </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </s> add return ( <div className="logs__row"> <div className="logs__text" title={value}> {value} </div> {trackerData && <Popover data={trackerData} />} </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
{ Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent);
<mask> {trackerData && <Popover data={trackerData} />} <mask> </div> <mask> ); <mask> }, <mask> }, { <mask> Header: <Trans>requests_count</Trans>, <mask> accessor: 'count', <mask> maxWidth: 190, <mask> Cell: ({ value }) => { <mask> const percent = getPercent(this.props.dnsQueries, value); <mask> const percentColor = this.getPercentColor(percent); <mask> <mask> return ( <mask> <Cell value={value} percent={percent} color={percentColor} /> <mask> ); <mask> }, </s> + client: handle the new statistics format </s> remove sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10), }, { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', Cell: ({ value }) => { const percent = getPercent(this.props.dnsQueries, value); const percentColor = this.getPercentColor(percent); </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove {trackerData && <Popover data={trackerData} />} </div> ); </s> add ); },
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "replace", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
return <Cell value={value} percent={percent} color={percentColor} />; },
<mask> Cell: ({ value }) => { <mask> const percent = getPercent(this.props.dnsQueries, value); <mask> const percentColor = this.getPercentColor(percent); <mask> <mask> return ( <mask> <Cell value={value} percent={percent} color={percentColor} /> <mask> ); <mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; </s> + client: handle the new statistics format
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
];
<mask> return ( <mask> <Cell value={value} percent={percent} color={percentColor} /> <mask> ); <mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> + client: handle the new statistics format </s> remove }]; </s> add ]; </s> remove }]; </s> add ]; </s> remove const { t } = this.props; </s> add const { t, refreshButton, topQueriedDomains, subtitle, } = this.props; </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; }, </s> remove return ( <Cell value={value} percent={percent} color={percentColor} /> ); </s> add return <Cell value={value} percent={percent} color={percentColor} />; },
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
const { t, refreshButton, topQueriedDomains, subtitle, } = this.props;
<mask> }, <mask> }]; <mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topQueriedDomains, (value, prop) => ( <mask> { ip: prop, count: value } </s> + client: handle the new statistics format </s> remove <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('stats_query_domain')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove const { t } = this.props; </s> add const { t, refreshButton, topClients, subtitle, } = this.props; </s> remove const { t } = this.props; </s> add const { t, refreshButton, topBlockedDomains, subtitle, } = this.props; </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
<Card title={t('stats_query_domain')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} >
<mask> <mask> render() { <mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topQueriedDomains, (value, prop) => ( <mask> { ip: prop, count: value } <mask> ))} <mask> columns={this.columns} </s> + client: handle the new statistics format </s> remove const { t } = this.props; </s> add const { t, refreshButton, topQueriedDomains, subtitle, } = this.props; </s> remove <Card title={ t('top_clients') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_clients')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove <Card title={ t('top_blocked_domains') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('top_blocked_domains')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))}
<mask> const { t } = this.props; <mask> return ( <mask> <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> <mask> <ReactTable <mask> data={map(this.props.topQueriedDomains, (value, prop) => ( <mask> { ip: prop, count: value } <mask> ))} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText={ t('no_domains_found') } <mask> minRows={6} <mask> className="-striped -highlight card-table-overflow stats__table" </s> + client: handle the new statistics format </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))} </s> remove <Card title={ t('stats_query_domain') } subtitle={ t('for_last_24_hours') } bodyType="card-table" refresh={this.props.refreshButton}> </s> add <Card title={t('stats_query_domain')} subtitle={subtitle} bodyType="card-table" refresh={refreshButton} > </s> remove noDataText={ t('no_domains_found') } </s> add noDataText={t('no_domains_found')} </s> remove const { t } = this.props; </s> add const { t, refreshButton, topQueriedDomains, subtitle, } = this.props;
[ "keep", "keep", "keep", "keep", "replace", "replace", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
noDataText={t('no_domains_found')}
<mask> { ip: prop, count: value } <mask> ))} <mask> columns={this.columns} <mask> showPagination={false} <mask> noDataText={ t('no_domains_found') } <mask> minRows={6} <mask> className="-striped -highlight card-table-overflow stats__table" <mask> /> <mask> </Card> <mask> ); </s> + client: handle the new statistics format </s> remove noDataText={ t('no_domains_found') } </s> add noDataText={t('no_domains_found')} </s> remove noDataText={ t('no_clients_found') } </s> add noDataText={t('no_clients_found')} </s> remove data={map(this.props.topQueriedDomains, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topQueriedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topBlockedDomains, (value, prop) => ( { ip: prop, domain: value } ))} </s> add data={topBlockedDomains.map(item => ({ domain: item.name, count: item.count, }))} </s> remove data={map(this.props.topClients, (value, prop) => ( { ip: prop, count: value } ))} </s> add data={topClients.map(item => ({ ip: item.name, count: item.count, }))}
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
topQueriedDomains: PropTypes.array.isRequired,
<mask> } <mask> } <mask> <mask> QueriedDomains.propTypes = { <mask> topQueriedDomains: PropTypes.object.isRequired, <mask> dnsQueries: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> t: PropTypes.func, <mask> }; <mask> </s> + client: handle the new statistics format </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove topClients: PropTypes.object.isRequired, </s> add topClients: PropTypes.array.isRequired, </s> remove topBlockedDomains: PropTypes.object.isRequired, </s> add topBlockedDomains: PropTypes.array.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired,
<mask> QueriedDomains.propTypes = { <mask> topQueriedDomains: PropTypes.object.isRequired, <mask> dnsQueries: PropTypes.number.isRequired, <mask> refreshButton: PropTypes.node.isRequired, <mask> t: PropTypes.func, <mask> }; <mask> <mask> export default withNamespaces()(QueriedDomains); </s> + client: handle the new statistics format </s> remove topQueriedDomains: PropTypes.object.isRequired, </s> add topQueriedDomains: PropTypes.array.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove topClients: PropTypes.object.isRequired, </s> add topClients: PropTypes.array.isRequired, </s> remove t: PropTypes.func, </s> add subtitle: PropTypes.string.isRequired, t: PropTypes.func.isRequired, </s> remove topBlockedDomains: PropTypes.object.isRequired, </s> add topBlockedDomains: PropTypes.array.isRequired,
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/QueriedDomains.js
import { getPercent, normalizeHistory } from '../../helpers/helpers';
<mask> <mask> import Card from '../ui/Card'; <mask> import Line from '../ui/Line'; <mask> <mask> import { getPercent } from '../../helpers/helpers'; <mask> import { STATUS_COLORS } from '../../helpers/constants'; <mask> <mask> class Statistics extends Component { <mask> render() { <mask> const { </s> + client: handle the new statistics format </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove import map from 'lodash/map'; </s> add </s> remove import map from 'lodash/map'; </s> add </s> remove import map from 'lodash/map'; </s> add
[ "keep", "keep", "keep", "keep", "replace", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Statistics.js
getNormalizedHistory = (data, interval, id) => [{ data: normalizeHistory(data, interval), id }];
<mask> <mask> class Statistics extends Component { <mask> render() { <mask> const { <mask> interval, <mask> dnsQueries, <mask> blockedFiltering, <mask> replacedSafebrowsing, </s> + client: handle the new statistics format </s> remove import { getPercent } from '../../helpers/helpers'; </s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove this.props.getTopStats(); </s> add this.props.getStats(); </s> remove columns = [{ Header: 'IP', accessor: 'ip', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> add columns = [ { Header: <Trans>domain</Trans>, accessor: 'domain', Cell: (row) => { const { value } = row; const trackerData = getTrackerData(value); </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
[ "keep", "add", "keep", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Statistics.js
interval,
<mask> getNormalizedHistory = (data, interval, id) => [{ data: normalizeHistory(data, interval), id }]; <mask> <mask> render() { <mask> const { <mask> dnsQueries, <mask> blockedFiltering, <mask> replacedSafebrowsing, <mask> replacedParental, <mask> numDnsQueries, </s> + client: handle the new statistics format </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> remove [actions.setStatsConfigRequest]: state => ({ ...state, setConfigProcessing: true }), [actions.setStatsConfigFailure]: state => ({ ...state, setConfigProcessing: false }), [actions.setStatsConfigSuccess]: (state, { payload }) => ({ ...state, interval: payload.interval, setConfigProcessing: false, }), }, { getConfigProcessing: false, setConfigProcessing: false, interval: 1, }); </s> add [actions.setStatsConfigRequest]: state => ({ ...state, processingSetConfig: true }), [actions.setStatsConfigFailure]: state => ({ ...state, processingSetConfig: false }), [actions.setStatsConfigSuccess]: (state, { payload }) => ({ ...state, interval: payload.interval, processingSetConfig: false, }), [actions.getStatsRequest]: state => ({ ...state, processingStats: true }), [actions.getStatsFailure]: state => ({ ...state, processingStats: false }), [actions.getStatsSuccess]: (state, { payload }) => { const { dns_queries: dnsQueries, blocked_filtering: blockedFiltering, replaced_parental: replacedParental, replaced_safebrowsing: replacedSafebrowsing, top_blocked_domains: topBlockedDomains, top_clients: topClients, top_queried_domains: topQueriedDomains, num_blocked_filtering: numBlockedFiltering, num_dns_queries: numDnsQueries, num_replaced_parental: numReplacedParental, num_replaced_safebrowsing: numReplacedSafebrowsing, num_replaced_safesearch: numReplacedSafesearch, avg_processing_time: avgProcessingTime, } = payload; const newState = { ...state, processingStats: false, dnsQueries, blockedFiltering, replacedParental, replacedSafebrowsing, topBlockedDomains, topClients, topQueriedDomains, numBlockedFiltering, numDnsQueries, numReplacedParental, numReplacedSafebrowsing, numReplacedSafesearch, avgProcessingTime, }; return newState; }, }, { processingGetConfig: false, processingSetConfig: false, processingStats: true, interval: 1, dnsQueries: [], blockedFiltering: [], replacedParental: [], replacedSafebrowsing: [], topBlockedDomains: [], topClients: [], topQueriedDomains: [], numBlockedFiltering: 0, numDnsQueries: 0, numReplacedParental: 0, numReplacedSafebrowsing: 0, numReplacedSafesearch: 0, avgProcessingTime: 0, }, ); </s> remove export const normalizeHistory = history => Object.keys(history).map((key) => { let id = STATS_NAMES[key]; if (!id) { id = key.replace(/_/g, ' ').replace(/^\w/, c => c.toUpperCase()); </s> add export const normalizeHistory = (history, interval) => { if (interval === 1 || interval === 7) { const hoursAgo = subHours(Date.now(), 24 * interval); return history.map((item, index) => ({ x: dateFormat(addHours(hoursAgo, index), 'D MMM HH:00'), y: round(item, 2), }));
[ "keep", "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Statistics.js
numDnsQueries, numBlockedFiltering, numReplacedSafebrowsing, numReplacedParental,
<mask> blockedFiltering, <mask> replacedSafebrowsing, <mask> replacedParental, <mask> } = this.props; <mask> <mask> return ( <mask> <div className="row"> <mask> <div className="col-sm-6 col-lg-3"> </s> + client: handle the new statistics format </s> remove const filteringData = [this.props.history[1]]; const queriesData = [this.props.history[2]]; const parentalData = [this.props.history[3]]; const safebrowsingData = [this.props.history[4]]; </s> add </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/> </s> add <Line data={this.getNormalizedHistory( blockedFiltering, interval, 'blockedFiltering', )} color={STATUS_COLORS.red} /> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/> </s> add <Line data={this.getNormalizedHistory( replacedSafebrowsing, interval, 'replacedSafebrowsing', )} color={STATUS_COLORS.green} /> </s> remove }, { Header: <Trans>requests_count</Trans>, accessor: 'domain', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental, } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value); </s> add { Header: <Trans>requests_count</Trans>, accessor: 'count', maxWidth: 190, Cell: ({ value }) => { const { blockedFiltering, replacedSafebrowsing, replacedParental } = this.props; const blocked = blockedFiltering + replacedSafebrowsing + replacedParental; const percent = getPercent(blocked, value);
[ "keep", "keep", "add", "keep", "keep", "keep", "keep", "keep" ]
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
client/src/components/Dashboard/Statistics.js