docstring_tokens
stringlengths 18
16.9k
| code_tokens
stringlengths 75
1.81M
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|
keep keep keep keep replace keep keep keep keep keep
|
<mask> }
<mask>
<mask> // Initializes the DNS filter
<mask> func (s *Server) initDNSFilter() error {
<mask> log.Printf("Creating dnsfilter")
<mask> s.dnsFilter = dnsfilter.New(&s.Config)
<mask> // add rules only if they are enabled
<mask> if s.FilteringEnabled {
<mask> err := s.dnsFilter.AddRules(s.Filters)
<mask> if err != nil {
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1
|
dnsforward/dnsforward.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> return nil
<mask> }
<mask>
<mask> filterFilePath := filter.Path()
<mask> log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
<mask>
<mask> if _, err := os.Stat(filterFilePath); os.IsNotExist(err) {
<mask> // do nothing, file doesn't exist
<mask> return err
<mask> }
</s> Demote some log.printf into log.tracef </s> remove log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
</s> add log.Tracef("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents)) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Creating dnsfilter")
</s> add log.Tracef("Creating dnsfilter") </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1
|
filter.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> if err != nil {
<mask> return err
<mask> }
<mask>
<mask> log.Printf("File %s, id %d, length %d", filterFilePath, filter.ID, len(filterFileContents))
<mask> rulesCount, _, rules := parseFilterContents(filterFileContents)
<mask>
<mask> filter.RulesCount = rulesCount
<mask> filter.Rules = rules
<mask>
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("Creating dnsfilter")
</s> add log.Tracef("Creating dnsfilter") </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
</s> add log.Tracef("got schema version %v", schemaVersionInterface)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1
|
filter.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> return err
<mask> }
<mask>
<mask> schemaVersionInterface, ok := diskConfig["schema_version"]
<mask> log.Printf("%s(): got schema version %v", _Func(), schemaVersionInterface)
<mask> if !ok {
<mask> // no schema version, set it to 0
<mask> schemaVersionInterface = 0
<mask> }
<mask>
</s> Demote some log.printf into log.tracef </s> remove log.Printf("Got IP that is not IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is not IPv4: %v", ipnet.IP) </s> remove log.Printf("Loading stats from querylog")
</s> add log.Tracef("Loading stats from querylog") </s> remove log.Printf("Writing YAML file: %s", configFile)
</s> add log.Tracef("Writing YAML file: %s", configFile) </s> remove log.Printf("Loading filter %d contents to: %s", filter.ID, filterFilePath)
</s> add log.Tracef("Loading filter %d contents to: %s", filter.ID, filterFilePath) </s> remove log.Printf("Reading YAML file: %s", configFile)
</s> add log.Tracef("Reading YAML file: %s", configFile) </s> remove log.Printf("Got IP that is IPv4: %v", ipnet.IP)
</s> add log.Tracef("Got IP that is IPv4: %v", ipnet.IP)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68c8a4d484bead62b688eddca69152b8160fb2b1
|
upgrade.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "bufio"
<mask> "bytes"
<mask> "context"
<mask> "crypto/sha256"
<mask> "encoding/gob"
<mask> "encoding/json"
<mask> "fmt"
<mask> "io/ioutil"
<mask> "net"
<mask> "net/http"
</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) { </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> "strings"
<mask> "sync/atomic"
<mask> "time"
<mask>
<mask> "github.com/VictoriaMetrics/fastcache"
<mask> "github.com/joomcode/errorx"
<mask>
<mask> "github.com/AdguardTeam/dnsproxy/upstream"
<mask> "github.com/AdguardTeam/golibs/log"
<mask> "github.com/AdguardTeam/urlfilter"
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </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 gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </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) { </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<mask>
<mask> type dnsFilterContext struct {
<mask> stats Stats
<mask> dialCache gcache.Cache // "host" -> "IP" cache for safebrowsing and parental control servers
<mask> safebrowsingCache *fastcache.Cache
<mask> parentalCache *fastcache.Cache
<mask> safeSearchCache *fastcache.Cache
<mask> }
<mask>
<mask> var gctx dnsFilterContext // global dnsfilter context
<mask>
<mask> // Result holds state of hostname check
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </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 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) { </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build()
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep replace replace replace replace replace replace keep keep replace keep
|
<mask> }
<mask>
<mask> func setCacheResult(cache *fastcache.Cache, host string, res Result) {
<mask> var buf bytes.Buffer
<mask> enc := gob.NewEncoder(&buf)
<mask> _ = enc.Encode(res)
<mask> cache.Set([]byte(host), buf.Bytes())
<mask> log.Debug("Stored in cache %p: %s => [%d]", cache, host, buf.Len())
<mask> }
<mask>
<mask> func getCachedResult(cache *fastcache.Cache, host string) (result Result, isFound bool) {
<mask> isFound = false // not found yet
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </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
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</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 log.Debug("gob.Decode(): %s", err)
</s> add // real error
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep keep replace replace keep keep replace replace replace replace replace replace
|
<mask> isFound = false // not found yet
<mask>
<mask> // get raw value
<mask> rawValue := cache.Get(nil, []byte(host))
<mask> if len(rawValue) == 0 {
<mask> return Result{}, false
<mask> }
<mask>
<mask> var buf bytes.Buffer
<mask> buf.Write(rawValue)
<mask> dec := gob.NewDecoder(&buf)
<mask> cachedValue := Result{}
<mask> err := dec.Decode(&cachedValue)
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove log.Debug("gob.Decode(): %s", err)
</s> add // real error </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) { </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 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 gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
</s> add gctx.safeSearchCache = gcache.New(c.SafeSearchCacheSize).LRU().Expiration(defaultCacheTime).Build()
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep keep keep replace keep keep replace
|
<mask> dec := gob.NewDecoder(&buf)
<mask> cachedValue := Result{}
<mask> err := dec.Decode(&cachedValue)
<mask> if err != nil {
<mask> log.Debug("gob.Decode(): %s", err)
<mask> return Result{}, false
<mask> }
<mask> return cachedValue, true
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </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 rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </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) { </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build()
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep replace keep keep replace keep keep keep
|
<mask> // initialize objects only once
<mask> if gctx.safebrowsingCache == nil {
<mask> gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
<mask> }
<mask> if gctx.safeSearchCache == nil {
<mask> gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
<mask> }
<mask> if gctx.parentalCache == nil {
<mask> gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
</s> add gctx.parentalCache = gcache.New(c.ParentalCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </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) { </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)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> if gctx.safeSearchCache == nil {
<mask> gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
<mask> }
<mask> if gctx.parentalCache == nil {
<mask> gctx.parentalCache = fastcache.New(c.ParentalCacheSize)
<mask> }
<mask> if len(c.ResolverAddress) != 0 && gctx.dialCache == nil {
<mask> gctx.dialCache = gcache.New(maxDialCacheSize).LRU().Expiration(defaultCacheTime).Build()
<mask> }
<mask> }
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove gctx.safeSearchCache = fastcache.New(c.SafeSearchCacheSize)
</s> add gctx.safeSearchCache = gcache.New(c.SafeSearchCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove gctx.safebrowsingCache = fastcache.New(c.SafeBrowsingCacheSize)
</s> add gctx.safebrowsingCache = gcache.New(c.SafeBrowsingCacheSize).LRU().Expiration(defaultCacheTime).Build() </s> remove
var buf bytes.Buffer
buf.Write(rawValue)
dec := gob.NewDecoder(&buf)
cachedValue := Result{}
err := dec.Decode(&cachedValue)
</s> add </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found </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) { </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)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
dnsfilter/dnsfilter.go
|
keep keep replace keep keep keep replace replace keep keep keep keep
|
<mask>
<mask> require (
<mask> github.com/AdguardTeam/dnsproxy v0.18.1
<mask> github.com/AdguardTeam/golibs v0.1.4
<mask> github.com/AdguardTeam/urlfilter v0.5.0
<mask> github.com/NYTimes/gziphandler v1.1.1
<mask> github.com/VictoriaMetrics/fastcache v1.5.1
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0
<mask> github.com/go-test/deep v1.0.1
<mask> github.com/gobuffalo/packr v1.19.0
<mask> github.com/joomcode/errorx v0.8.0
<mask> github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1 // indirect
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/AdguardTeam/dnsproxy v0.18.1 h1:KS5FH+Q4i6K6e/QuW3WSsFFT732QZbhGZhEl6kx5YRo=
github.com/AdguardTeam/dnsproxy v0.18.1/go.mod h1:ZRbvuqDXag6IPsJWJp5UK+RGjHE/wUDBHYDNY8/EftI=
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 h1:0wgZ/OZ8slD8XXT5/rFjM1FK86Wek7KolQLmhgf2ayQ=
github.com/AdguardTeam/dnsproxy v0.18.2/go.mod h1:R0YfjEUyGf7rsQ31gbw0GahraUjxCmH4dUqPEYVy81k= </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </s> remove github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 h1:vUdUwmQLnT/yuk8PsDhhMVkrfr4aMdcv/0GWzIqOjEY=
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 h1:pl4eWIqvFe/Kg3zkn7NxevNzILnZYWDCG7qbA1CJik0=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM=
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 h1:yCfXxYaelOyqnia8F/Yng47qhmfC9nKTRIbYRrRueq4=
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk= </s> remove github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
</s> add </s> remove github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.mod
|
replace replace keep keep keep keep keep
|
<mask> github.com/AdguardTeam/dnsproxy v0.18.1 h1:KS5FH+Q4i6K6e/QuW3WSsFFT732QZbhGZhEl6kx5YRo=
<mask> github.com/AdguardTeam/dnsproxy v0.18.1/go.mod h1:ZRbvuqDXag6IPsJWJp5UK+RGjHE/wUDBHYDNY8/EftI=
<mask> github.com/AdguardTeam/golibs v0.1.3 h1:hmapdTtMtIk3T8eQDwTOLdqZLGDKNKk9325uC8z12xg=
<mask> github.com/AdguardTeam/golibs v0.1.3/go.mod h1:b0XkhgIcn2TxwX6C5AQMtpIFAgjPehNgxJErWkwA3ko=
<mask> github.com/AdguardTeam/golibs v0.1.4 h1:zZirpC23mZkf9Upasn9nbQ+lqqjcXJnkWdXO80vTu7s=
<mask> github.com/AdguardTeam/golibs v0.1.4/go.mod h1:b0XkhgIcn2TxwX6C5AQMtpIFAgjPehNgxJErWkwA3ko=
<mask> github.com/AdguardTeam/urlfilter v0.5.0 h1:ATzs2Er0BMt7NbZnFJ4UEzt3uIV+rydbQCYqBXNRbJc=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </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/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </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 log.Debug("gob.Decode(): %s", err)
</s> add // real error </s> remove "github.com/VictoriaMetrics/fastcache"
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.sum
|
keep replace replace replace keep keep replace replace
|
<mask> github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c=
<mask> github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
<mask> github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
<mask> github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705 h1:UUppSQnhf4Yc6xGxSkoQpPhb7RVzuv5Nb1mwJ5VId9s=
<mask> github.com/StackExchange/wmi v0.0.0-20181212234831-e0a55b97c705/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
<mask> github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
<mask> github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </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/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 h1:vUdUwmQLnT/yuk8PsDhhMVkrfr4aMdcv/0GWzIqOjEY=
github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 h1:pl4eWIqvFe/Kg3zkn7NxevNzILnZYWDCG7qbA1CJik0=
github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM=
</s> add github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833 h1:yCfXxYaelOyqnia8F/Yng47qhmfC9nKTRIbYRrRueq4=
github.com/bluele/gcache v0.0.0-20190518031135-bc40bd653833/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk= </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 log.Debug("gob.Decode(): %s", err)
</s> add // real error
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.sum
|
keep keep keep keep replace replace keep keep keep keep keep
|
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da h1:KjTM2ks9d14ZYCvmHS9iAKVt9AyzRSqNU1qabPih5BY=
<mask> github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da/go.mod h1:eHEWzANqSiWQsof+nXEI9bUVUyV6F53Fp89EuCh2EAA=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635 h1:52m0LGchQBBVqJRyYYufQuIbVqRawmubW3OFGqK1ekw=
<mask> github.com/aead/poly1305 v0.0.0-20180717145839-3fee0db0b635/go.mod h1:lmLxL+FV291OopO93Bwf9fQLQeLyt33VJRUg5VJ30us=
<mask> github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
<mask> github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
<mask> github.com/ameshkov/dnscrypt v1.0.7 h1:7LS9wiC/6c00H3ZdZOlwQSYGTJvs12g5ui9D1VSZ2aQ=
<mask> github.com/ameshkov/dnscrypt v1.0.7/go.mod h1:rA74ASZ0j4JqPWaiN64hN97QXJ/zu5Kb2xgn295VzWQ=
<mask> github.com/ameshkov/dnsstamps v1.0.1 h1:LhGvgWDzhNJh+kBQd/AfUlq1vfVe109huiXw4JhnPug=
<mask> github.com/ameshkov/dnsstamps v1.0.1/go.mod h1:Ii3eUu73dx4Vw5O4wjzmT5+lkCwovjzaEZZ4gKyIH5A=
<mask> github.com/ameshkov/goproxy v0.0.0-20190328085534-e9f6fabc24d4/go.mod h1:tKA6C/1BQYejT7L6ZX0klDrqloYenYETv3BCk8xCbrQ=
</s> Revert "* dnsfilter: use fastcache instead of gcache"
This reverts commit 6f51df7d2e3eb4672d4762e14e22e831fdadd256. </s> remove github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag=
github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE=
</s> add </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </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 log.Debug("gob.Decode(): %s", err)
</s> add // real error </s> remove "github.com/VictoriaMetrics/fastcache"
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.sum
|
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
|
<mask> github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf h1:eg0MeVzsP1G42dRafH3vf+al2vQIJU0YHX+1Tw87oco=
<mask> github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
<mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6 h1:KXlsf+qt/X5ttPGEjR0tPH1xaWWoKBEg9Q1THAj2h3I=
<mask> github.com/beefsack/go-rate v0.0.0-20180408011153-efa7637bb9b6/go.mod h1:6YNgTHLutezwnBvyneBbwvB8C82y3dcoOj5EQJIdGXA=
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0 h1:vUdUwmQLnT/yuk8PsDhhMVkrfr4aMdcv/0GWzIqOjEY=
<mask> github.com/bluele/gcache v0.0.0-20190203144525-2016d595ccb0/go.mod h1:8c4/i2VlovMO2gBnHGQPN5EJw+H0lx1u/5p+cgsXtCk=
<mask> github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
<mask> github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
<mask> github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 h1:pl4eWIqvFe/Kg3zkn7NxevNzILnZYWDCG7qbA1CJik0=
<mask> github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18/go.mod h1:HD5P3vAIAh+Y2GAxg0PrPN1P8WkepXGpjbUPDHJqqKM=
<mask> github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<mask> github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
<mask> github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
<mask> github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
<mask> github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
</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/AdguardTeam/dnsproxy v0.18.1
</s> add github.com/AdguardTeam/dnsproxy v0.18.2 </s> remove github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI=
github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
</s> add </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 log.Debug("gob.Decode(): %s", err)
</s> add // real error </s> remove "github.com/VictoriaMetrics/fastcache"
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.sum
|
keep keep keep keep replace replace keep keep keep keep keep
|
<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 </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)
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.sum
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<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) { </s> remove rawValue := cache.Get(nil, []byte(host))
if len(rawValue) == 0 {
</s> add rawValue, err := cache.Get(host)
if err == gcache.KeyNotFoundError {
// not a real error, just not found
|
https://github.com/AdguardTeam/AdGuardHome/commit/68d5d595b657ebd1f93e1bd012bc8fc0d5d9f7b0
|
go.sum
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add // 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)
}
</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"))) </s> remove // Default blocking - REFUSED
</s> add // Default blocking - NULL IP
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
client/src/__locales/en.json
|
keep keep keep keep replace keep keep keep keep keep
|
<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"))) </s> add // https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet </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)
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/dnsforward_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add // 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)
}
</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)
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/dnsforward_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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 </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)
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/dnsforward_test.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add // 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)
}
</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) </s> remove // Default blocking - REFUSED
</s> add // Default blocking - NULL IP
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/dnsforward_test.go
|
keep keep add keep keep keep keep keep
|
<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> add // 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)
}
</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 // If there is no IP, return REFUSED
</s> add // For host-type rules, return null IP
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/handle_dns.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add // https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet </s> remove return s.makeResponseREFUSED(m)
</s> add if s.conf.BlockingMode == "null_ip" {
return s.makeResponse(m)
}
return s.genNXDomain(m) </s> add // 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)
}
</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 // If there is no IP, return REFUSED
</s> add // For host-type rules, return null IP
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/handle_dns.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add // 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)
}
</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) </s> add // https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet </s> remove // If there is no IP, return REFUSED
</s> add // For host-type rules, return null IP
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/msg.go
|
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
|
<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> add // 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)
}
</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) </s> add // https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/msg.go
|
keep keep keep replace keep keep keep replace keep
|
<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 // 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> add // 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)
}
</s> remove return s.makeResponseREFUSED(m)
</s> add if s.conf.BlockingMode == "null_ip" {
return s.makeResponse(m)
}
return s.genNXDomain(m) </s> add // https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/msg.go
|
keep keep add keep keep keep keep keep keep
|
<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"))) </s> remove d.Res = s.makeResponseREFUSED(d.Req)
</s> add d.Res = s.genNXDomain(d.Req)
|
https://github.com/AdguardTeam/AdGuardHome/commit/69a740714fb7e049a92f7d49449b91a334479472
|
dnsforward/msg.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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",
|
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
|
client/src/__locales/en.json
|
keep keep keep keep replace keep keep keep keep keep
|
<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.",
|
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
|
client/src/__locales/ru.json
|
keep keep keep keep replace keep keep keep keep keep keep keep keep replace
|
<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>
<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') }
</s> Fix #453: Added upstream examples </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.",
|
https://github.com/AdguardTeam/AdGuardHome/commit/69cc597b87a23443d57cf35551f03a3846b64797
|
client/src/components/Settings/Upstream.js
|
keep keep keep keep replace replace replace keep keep keep keep keep
|
<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> add Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts) </s> remove Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts)
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/69f526b13d1f553dfcd3e3bad363c2ac148bef54
|
internal/home/clients.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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 </s> add Context.clients.Init(config.Clients, Context.dhcpServer, Context.etcHosts)
|
https://github.com/AdguardTeam/AdGuardHome/commit/69f526b13d1f553dfcd3e3bad363c2ac148bef54
|
internal/home/home.go
|
keep keep add keep keep keep keep
|
<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
|
https://github.com/AdguardTeam/AdGuardHome/commit/69f526b13d1f553dfcd3e3bad363c2ac148bef54
|
internal/home/home.go
|
keep keep add keep keep keep keep keep keep
|
<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) </s> remove d.Config.ParentalEnabled = true
</s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true)
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/filtering.go
|
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
|
<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) </s> remove d.Config.ParentalEnabled = true
</s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true)
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/filtering.go
|
keep keep add keep keep keep keep
|
<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) </s> remove d.Config.ParentalEnabled = true
</s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true)
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safebrowsing.go
|
keep keep keep keep replace keep keep keep keep replace keep keep keep keep
|
<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
<mask> d.Config.ConfigModified()
<mask> }
<mask>
<mask> func (d *DNSFilter) handleSafeBrowsingStatus(w http.ResponseWriter, r *http.Request) {
</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 = 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) </s> remove Enabled: d.Config.SafeBrowsingEnabled,
</s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled),
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safebrowsing.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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) </s> remove d.Config.ParentalEnabled = false
</s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, false)
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safebrowsing.go
|
keep replace keep keep keep keep replace keep
|
<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
<mask> d.Config.ConfigModified()
</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 = 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.SafeBrowsingEnabled = false
</s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false) </s> remove Enabled: d.Config.SafeSearchEnabled,
</s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled),
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safebrowsing.go
|
keep keep keep keep replace keep keep keep keep
|
<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) </s> remove d.Config.SafeBrowsingEnabled = false
</s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false)
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safebrowsing.go
|
keep keep keep replace keep keep keep keep replace keep keep
|
<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
<mask> d.Config.ConfigModified()
<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 d.Config.ParentalEnabled = true
</s> add setProtectedBool(&d.confLock, &d.Config.ParentalEnabled, true) </s> remove d.Config.SafeBrowsingEnabled = true
</s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, 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 Enabled: d.Config.SafeSearchEnabled,
</s> add Enabled: protectedBool(&d.confLock, &d.Config.SafeSearchEnabled),
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safesearch.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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) </s> remove d.Config.SafeBrowsingEnabled = false
</s> add setProtectedBool(&d.confLock, &d.Config.SafeBrowsingEnabled, false)
|
https://github.com/AdguardTeam/AdGuardHome/commit/6aa93f4ae7e92aa2db0b27d55cc7a91c4093385b
|
internal/filtering/safesearch.go
|
keep keep keep keep replace keep keep keep keep keep
|
<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); </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);
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/package.json
|
keep keep keep add keep keep keep keep keep
|
<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> add "number_of_dns_query_days": "A number of DNS quieries processed for the last {{value}} days", </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} />;
}, </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/__locales/en.json
|
keep keep add keep keep keep keep keep keep
|
<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> add "for_last_days": "for the last {{value}} days", </s> remove "table_statistics": "Requests count (last 24 hours)",
</s> add </s> add GET_STATS = { path: 'stats', method: 'GET' }; </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} />;
}, </s> remove "time_period": "Time period"
</s> add "time_period": "Time period",
"domain": "Domain"
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/__locales/en.json
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add "for_last_days": "for the last {{value}} days", </s> add "number_of_dns_query_days": "A number of DNS quieries processed for the last {{value}} days", </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;
} </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/__locales/en.json
|
keep keep keep keep replace keep
|
<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> add "for_last_days": "for the last {{value}} days", </s> add "number_of_dns_query_days": "A number of DNS quieries processed for the last {{value}} days", </s> remove }
</s> add )} </s> remove getGlobalStatsTop() {
const { path, method } = this.GLOBAL_STATS_TOP;
return this.makeRequest(path, method);
}
</s> add </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/__locales/en.json
|
keep replace keep keep keep keep keep
|
<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> add import addDays from 'date-fns/add_days';
import subDays from 'date-fns/sub_days'; </s> add import round from 'lodash/round'; </s> remove import map from 'lodash/map';
</s> add </s> remove import map from 'lodash/map';
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/actions/index.js
|
keep keep keep keep replace keep keep keep keep keep
|
<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> add import { normalizeTopStats } from '../helpers/helpers'; </s> remove STATS_NAMES,
</s> add </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats'; </s> add import addDays from 'date-fns/add_days';
import subDays from 'date-fns/sub_days'; </s> remove import subHours from 'date-fns/sub_hours';
import dateFormat from 'date-fns/format';
</s> add
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/actions/index.js
|
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
|
<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),
})); </s> add import { normalizeTopStats } from '../helpers/helpers';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/actions/index.js
|
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
|
<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),
})); </s> add import { normalizeTopStats } from '../helpers/helpers';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/actions/index.js
|
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
|
<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> add import { normalizeTopStats } from '../helpers/helpers'; </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),
})); </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats };
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/actions/index.js
|
keep add keep keep keep keep keep
|
<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'; </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/actions/stats.js
|
keep replace replace keep keep keep keep keep
|
<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> add import addDays from 'date-fns/add_days';
import subDays from 'date-fns/sub_days'; </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> add import { normalizeTopStats } from '../helpers/helpers'; </s> remove STATS_NAMES,
</s> add </s> remove import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/api/Api.js
|
keep replace replace keep keep replace
|
<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' };
</s> + client: handle the new statistics format </s> add GET_STATS = { path: 'stats', method: 'GET' }; </s> add getStats() {
const { path, method } = this.GET_STATS;
return this.makeRequest(path, method);
}
</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; </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;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/api/Api.js
|
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
|
<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> add getStats() {
const { path, method } = this.GET_STATS;
return this.makeRequest(path, method);
}
</s> add GET_STATS = { path: 'stats', method: 'GET' }; </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); </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats };
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/api/Api.js
|
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
|
<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> add getStats() {
const { path, method } = this.GET_STATS;
return this.makeRequest(path, method);
}
</s> add GET_STATS = { path: 'stats', method: 'GET' }; </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; </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);
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/api/Api.js
|
keep keep keep add keep keep keep keep keep
|
<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> add getStats() {
const { path, method } = this.GET_STATS;
return this.makeRequest(path, method);
}
</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 </s> remove const { dashboard } = state;
const props = { dashboard };
</s> add const { dashboard, stats } = state;
const props = { dashboard, stats };
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/api/Api.js
|
keep add keep keep keep keep keep keep
|
<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> add GET_STATS = { path: 'stats', method: 'GET' }; </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 </s> remove const { dashboard, clients } = state;
</s> add const { dashboard, clients, stats } = state;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/api/Api.js
|
keep keep keep replace keep keep keep keep keep
|
<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> add import round from 'lodash/round'; </s> remove import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove import round from 'lodash/round';
</s> add </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
</s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep keep keep keep replace replace replace replace replace replace keep replace replace replace replace keep keep
|
<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}
<mask> </div>
<mask> {trackerData && <Popover data={trackerData} />}
</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 import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove {trackerData && <Popover data={trackerData} />}
</div>
);
</s> add );
}, </s> remove {trackerData && <Popover data={trackerData} />}
</div>
);
</s> add );
},
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep replace replace replace keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep
|
<mask> </div>
<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} />
</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} />;
},
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep replace replace replace keep replace keep keep keep keep
|
<mask>
<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 (
</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 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 ]; </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);
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep keep keep replace keep replace keep keep keep keep
|
<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 }
<mask> ))}
</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 <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 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;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep replace replace replace keep keep replace
|
<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') }
</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;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep keep keep keep replace keep keep keep keep replace keep
|
<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,
<mask> };
</s> + client: handle the new statistics format </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, </s> add subtitle: PropTypes.string.isRequired,
interval: PropTypes.number.isRequired,
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/BlockedDomains.js
|
keep keep keep replace keep keep keep keep keep
|
<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> add import round from 'lodash/round'; </s> remove import { getPercent } from '../../helpers/helpers';
</s> add import { getPercent, normalizeHistory } from '../../helpers/helpers'; </s> remove import round from 'lodash/round';
</s> add </s> remove import { normalizeHistory, normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
</s> add import { normalizeFilteringStatus, normalizeLogs, normalizeTextarea, sortClients } from '../helpers/helpers';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep replace keep replace replace replace replace replace replace replace
|
<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;
</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 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 }
</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 }, {
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);
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep replace replace replace replace replace keep replace replace replace replace replace replace replace keep keep
|
<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}
<mask> </span>
<mask> </div>
<mask> );
<mask> },
<mask> sortMethod: (a, b) => parseInt(a.replace(/\./g, ''), 10) - parseInt(b.replace(/\./g, ''), 10),
</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 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">
<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 };
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep keep replace replace replace replace replace replace replace keep replace replace replace keep keep keep keep
|
<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> },
<mask> }];
<mask>
<mask> render() {
</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 }, {
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} />;
},
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep replace keep keep replace keep keep
|
<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 <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 const { t } = this.props;
</s> add const {
t, refreshButton, topBlockedDomains, subtitle,
} = this.props;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep keep keep keep replace keep replace replace replace
|
<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> ))}
</s> + client: handle the new statistics format </s> remove const { t } = this.props;
</s> add const {
t, refreshButton, topClients, 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}
> </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; </s> remove const { t } = this.props;
</s> add const {
t, refreshButton, topBlockedDomains, subtitle,
} = this.props;
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep keep keep keep replace keep keep keep keep keep
|
<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,
}))} </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}
>
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep keep keep replace keep keep keep keep replace
|
<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 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, </s> remove t: PropTypes.func,
</s> add subtitle: PropTypes.string.isRequired,
t: PropTypes.func.isRequired,
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Clients.js
|
keep keep add keep keep keep keep keep keep
|
<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'; </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Counters.js
|
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
|
<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 ]; </s> remove }];
</s> add ];
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Counters.js
|
keep keep keep add keep keep keep keep
|
<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, </s> remove topQueriedDomains: PropTypes.object.isRequired,
</s> add topQueriedDomains: PropTypes.array.isRequired,
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Counters.js
|
keep keep keep add
|
<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 </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Dashboard.css
|
keep keep keep replace keep keep keep keep keep
|
<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
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep keep keep replace keep replace replace replace replace replace replace keep keep keep
|
<mask> return STATUS_COLORS.yellow;
<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">
</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 }
</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 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} />}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep replace replace replace replace keep replace replace replace keep keep keep keep
|
<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> },
<mask> }, {
<mask> Header: <Trans>requests_count</Trans>,
<mask> accessor: 'count',
</s> + client: handle the new statistics format
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep keep keep keep replace replace replace replace replace replace replace keep replace replace replace
|
<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> );
</s> + client: handle the new statistics format
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep keep keep keep replace keep keep replace keep
|
<mask> return (
<mask> <Cell value={value} percent={percent} color={percentColor} />
<mask> );
<mask> },
<mask> }];
<mask>
<mask> render() {
<mask> const { t } = this.props;
<mask> return (
</s> + client: handle the new statistics format
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep replace keep replace replace replace keep keep
|
<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}
</s> + client: handle the new statistics format </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('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.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_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}
>
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep keep keep keep replace keep keep keep keep keep
|
<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,
}))} </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}
>
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep keep keep keep replace keep keep replace keep
|
<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> };
</s> + client: handle the new statistics format </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, </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,
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/QueriedDomains.js
|
keep keep keep keep replace keep keep keep keep keep
|
<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 </s> add import round from 'lodash/round'; </s> remove import { getClients, getTopStats } from '../actions';
</s> add import { getClients } from '../actions';
import { getStats } from '../actions/stats';
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep add keep keep keep keep keep keep
|
<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> add interval, </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); </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,
},
);
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep add keep keep keep keep keep
|
<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> add getNormalizedHistory = (data, interval, id) => [{ data: normalizeHistory(data, interval), id }];
</s> add numDnsQueries,
numBlockedFiltering,
numReplacedSafebrowsing,
numReplacedParental, </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),
})); </s> remove return (
<Cell value={value} percent={percent} color={percentColor} />
);
</s> add return <Cell value={value} percent={percent} color={percentColor} />;
},
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep add keep keep keep keep keep
|
<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); </s> add interval, </s> remove {dnsQueries}
</s> add {numDnsQueries}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
|
<mask> replacedSafebrowsing,
<mask> replacedParental,
<mask> } = this.props;
<mask>
<mask> const filteringData = [this.props.history[1]];
<mask> const queriesData = [this.props.history[2]];
<mask> const parentalData = [this.props.history[3]];
<mask> const safebrowsingData = [this.props.history[4]];
<mask>
<mask> return (
<mask> <div className="row">
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
</s> + client: handle the new statistics format </s> add numDnsQueries,
numBlockedFiltering,
numReplacedSafebrowsing,
numReplacedParental, </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </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);
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
<mask> <div className="card-value card-value-stats text-blue">
<mask> {dnsQueries}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <Trans>dns_query</Trans>
<mask> </div>
<mask> </div>
</s> + client: handle the new statistics format </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/>
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> <Trans>dns_query</Trans>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={queriesData} color={STATUS_COLORS.blue}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
</s> + client: handle the new statistics format </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep replace keep keep replace keep keep keep keep
|
<mask> <Card type="card--full" bodyType="card-wrap">
<mask> <div className="card-body-stats">
<mask> <div className="card-value card-value-stats text-red">
<mask> {blockedFiltering}
<mask> </div>
<mask> <div className="card-value card-value-percent text-red">
<mask> {getPercent(dnsQueries, blockedFiltering)}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <a href="#filters">
<mask> <Trans>blocked_by</Trans>
</s> + client: handle the new statistics format </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} </s> remove {getPercent(dnsQueries, replacedSafebrowsing)}
</s> add {getPercent(numDnsQueries, numReplacedSafebrowsing)}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> </a>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={filteringData} color={STATUS_COLORS.red}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
</s> + client: handle the new statistics format </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
</s> add <Line
data={this.getNormalizedHistory(
replacedSafebrowsing,
interval,
'replacedSafebrowsing',
)}
color={STATUS_COLORS.green}
/> </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep replace keep keep replace keep keep keep
|
<mask> <div className="card-value card-value-stats text-green">
<mask> {replacedSafebrowsing}
<mask> </div>
<mask> <div className="card-value card-value-percent text-green">
<mask> {getPercent(dnsQueries, replacedSafebrowsing)}
<mask> </div>
<mask> <div className="card-title-stats">
<mask> <Trans>stats_malware_phishing</Trans>
</s> + client: handle the new statistics format </s> remove {getPercent(dnsQueries, replacedParental)}
</s> add {getPercent(numDnsQueries, numReplacedParental)} </s> remove {getPercent(dnsQueries, blockedFiltering)}
</s> add {getPercent(numDnsQueries, numBlockedFiltering)} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {dnsQueries}
</s> add {numDnsQueries}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
keep keep keep keep replace keep keep keep keep keep
|
<mask> <Trans>stats_malware_phishing</Trans>
<mask> </div>
<mask> </div>
<mask> <div className="card-chart-bg">
<mask> <Line data={safebrowsingData} color={STATUS_COLORS.green}/>
<mask> </div>
<mask> </Card>
<mask> </div>
<mask> <div className="col-sm-6 col-lg-3">
<mask> <Card type="card--full" bodyType="card-wrap">
</s> + client: handle the new statistics format </s> remove <Line data={queriesData} color={STATUS_COLORS.blue}/>
</s> add <Line
data={this.getNormalizedHistory(dnsQueries, interval, 'dnsQueries')}
color={STATUS_COLORS.blue}
/> </s> remove <Line data={filteringData} color={STATUS_COLORS.red}/>
</s> add <Line
data={this.getNormalizedHistory(
blockedFiltering,
interval,
'blockedFiltering',
)}
color={STATUS_COLORS.red}
/> </s> remove {dnsQueries}
</s> add {numDnsQueries} </s> remove {replacedParental}
</s> add {numReplacedParental} </s> remove {replacedSafebrowsing}
</s> add {numReplacedSafebrowsing} </s> remove {blockedFiltering}
</s> add {numBlockedFiltering}
|
https://github.com/AdguardTeam/AdGuardHome/commit/6b2496d0501d531c764437154374ecbafc8a848f
|
client/src/components/Dashboard/Statistics.js
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.