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 replace replace replace keep keep keep keep keep | <mask> golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
<mask> golang.org/x/tools v0.0.0-20201007032633-0806396f153e/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
<mask> golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
<mask> golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E=
<mask> golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
<mask> golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
<mask> golang.org/x/vuln v0.0.0-20221103225512-4f561ca73b59 h1:eOOJSuIRc2QwKAgX5qOIhUZJAd2LLKSBfk839dv+Clo=
<mask> golang.org/x/vuln v0.0.0-20221103225512-4f561ca73b59/go.mod h1:F12iebNzxRMpJsm4W7ape+r/KdnXiSy3VC94WsyCG68=
<mask> golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
<mask> golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
<mask> golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
<mask> gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
</s> Pull request: upd-all
Merge in DNS/adguard-home from upd-all to master
Squashed commit of the following:
commit 1c71e4586daa7502f5dadd5ba4dc58a12a01f3b8
Author: Ainar Garipov <[email protected]>
Date: Wed Feb 1 13:37:50 2023 +0300
all: imp chlog; upd deps, i18n, services, trackers </s> remove golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
</s> add golang.org/x/tools v0.5.0 h1:+bSpV5HIeWkuvgaMfI3UmKRThoTA5ODJTUd8T17NO+4=
golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= </s> remove golang.org/x/tools v0.2.0
golang.org/x/vuln v0.0.0-20221103225512-4f561ca73b59
</s> add golang.org/x/tools v0.5.1-0.20230117180257-8aba49bb5ea2
golang.org/x/vuln v0.0.0-20230130175424-dd534eeddf33 </s> remove golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
</s> add golang.org/x/text v0.6.0 h1:3XmdazWV+ubf7QgHSTWeykHOci5oeekaGJBLkrkaw4k=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= </s> remove mvdan.cc/unparam v0.0.0-20220926085101-66de63301820
</s> add mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95 </s> remove github.com/gordonklaus/ineffassign v0.0.0-20220928193011-d2c82e48359b
github.com/kisielk/errcheck v1.6.2
github.com/kyoh86/looppointer v0.1.9
</s> add github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28
github.com/kisielk/errcheck v1.6.3
github.com/kyoh86/looppointer v0.2.1 </s> remove golang.org/x/text v0.5.0 // indirect
golang.org/x/tools v0.2.0 // indirect
</s> add golang.org/x/text v0.6.0 // indirect
golang.org/x/tools v0.5.0 // indirect | https://github.com/AdguardTeam/AdGuardHome/commit/04f49933854f315857abd572c0dc45473c2fae0d | internal/tools/go.sum |
keep keep keep keep replace replace | <mask> honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
<mask> honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw=
<mask> mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
<mask> mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ=
<mask> mvdan.cc/unparam v0.0.0-20220926085101-66de63301820 h1:fggBTMFbBz7CMny3mWZphe0B/6D8ILBunvvB1cNNHi8=
<mask> mvdan.cc/unparam v0.0.0-20220926085101-66de63301820/go.mod h1:7fKhD/gH+APJ9Y27S2PYO7+oVWtb3XPrw9W5ayxVq2A=
</s> Pull request: upd-all
Merge in DNS/adguard-home from upd-all to master
Squashed commit of the following:
commit 1c71e4586daa7502f5dadd5ba4dc58a12a01f3b8
Author: Ainar Garipov <[email protected]>
Date: Wed Feb 1 13:37:50 2023 +0300
all: imp chlog; upd deps, i18n, services, trackers </s> remove mvdan.cc/unparam v0.0.0-20220926085101-66de63301820
</s> add mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95 </s> remove golang.org/x/tools v0.2.0
golang.org/x/vuln v0.0.0-20221103225512-4f561ca73b59
</s> add golang.org/x/tools v0.5.1-0.20230117180257-8aba49bb5ea2
golang.org/x/vuln v0.0.0-20230130175424-dd534eeddf33 </s> remove github.com/gordonklaus/ineffassign v0.0.0-20220928193011-d2c82e48359b
github.com/kisielk/errcheck v1.6.2
github.com/kyoh86/looppointer v0.1.9
</s> add github.com/gordonklaus/ineffassign v0.0.0-20230107090616-13ace0543b28
github.com/kisielk/errcheck v1.6.3
github.com/kyoh86/looppointer v0.2.1 </s> remove golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
</s> add golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
</s> add golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= </s> remove github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/04f49933854f315857abd572c0dc45473c2fae0d | internal/tools/go.sum |
keep keep keep add keep keep keep keep keep | <mask> log.Debug("Querylog: msg.Unpack(entry.OrigAnswer): %s: %s", err, string(entry.OrigAnswer))
<mask> }
<mask> }
<mask>
<mask> return jsonEntry
<mask> }
<mask>
<mask> func answerToMap(a *dns.Msg) []map[string]interface{} {
<mask> if a == nil || len(a.Answer) == 0 {
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add </s> remove "filter_domain": ctDomain,
"filter_client": ctClient,
"filter_question_type": ctQuestionType,
"filter_response_status": ctFilteringStatus,
</s> add "search": ctDomainOrClient,
"response_status": ctFilteringStatus, </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> add case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
</s> remove return false
case ctClient:
</s> add </s> remove case ctDomain:
</s> add case ctDomainOrClient: | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/json.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> if getDoubleQuotesEnclosedValue(&c.value) {
<mask> c.strict = true
<mask> }
<mask>
<mask> if ct == ctClient && l.conf.AnonymizeClientIP {
<mask> c.value = l.getClientIP(c.value)
<mask> }
<mask>
<mask> if ct == ctFilteringStatus && !util.ContainsString(filteringStatusValues, c.value) {
<mask> return false, c, fmt.Errorf("invalid value %s", c.value)
<mask> }
<mask>
<mask> return true, c, nil
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove return false
case ctClient:
</s> add </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> remove case ctDomain:
</s> add case ctDomainOrClient: </s> add jsonEntry["upstream"] = entry.Upstream
</s> remove "filter_domain": ctDomain,
"filter_client": ctClient,
"filter_question_type": ctQuestionType,
"filter_response_status": ctFilteringStatus,
</s> add "search": ctDomainOrClient,
"response_status": ctFilteringStatus, </s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_http.go |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> p.maxFileScanEntries = 0
<mask> }
<mask>
<mask> paramNames := map[string]criteriaType{
<mask> "filter_domain": ctDomain,
<mask> "filter_client": ctClient,
<mask> "filter_question_type": ctQuestionType,
<mask> "filter_response_status": ctFilteringStatus,
<mask> }
<mask>
<mask> for k, v := range paramNames {
<mask> ok, c, err := l.parseSearchCriteria(q, k, v)
<mask> if err != nil {
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add </s> add jsonEntry["upstream"] = entry.Upstream
</s> remove return false
case ctClient:
</s> add </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> remove case ctDomain:
</s> add case ctDomainOrClient: | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_http.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // search by domain (strict)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctDomain,
<mask> strict: true,
<mask> value: "test.example.org",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Equal(t, 1, len(entries))
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address </s> add filteringStatusProcessed = "processed" // not blocked, not white-listed entries </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // search by domain (not strict)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctDomain,
<mask> strict: false,
<mask> value: "example.org",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Equal(t, 3, len(entries))
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address </s> add filteringStatusProcessed = "processed" // not blocked, not white-listed entries </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // search by client IP (strict)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctClient,
<mask> strict: true,
<mask> value: "2.2.2.2",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Equal(t, 1, len(entries))
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address </s> add filteringStatusProcessed = "processed" // not blocked, not white-listed entries </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> // search by client IP (part of)
<mask> params = newSearchParams()
<mask> params.searchCriteria = append(params.searchCriteria, searchCriteria{
<mask> criteriaType: ctClient,
<mask> strict: false,
<mask> value: "2.2.2",
<mask> })
<mask> entries, _ = l.search(params)
<mask> assert.Equal(t, 4, len(entries))
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address </s> add filteringStatusProcessed = "processed" // not blocked, not white-listed entries </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
keep keep keep keep replace replace replace keep keep keep keep keep | <mask>
<mask> type criteriaType int
<mask>
<mask> const (
<mask> ctDomain criteriaType = iota // domain name
<mask> ctClient // client IP address
<mask> ctQuestionType // question type
<mask> ctFilteringStatus // filtering status
<mask> )
<mask>
<mask> const (
<mask> filteringStatusAll = "all"
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> add filteringStatusProcessed = "processed" // not blocked, not white-listed entries </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep add keep keep keep keep keep | <mask> filteringStatusBlockedParental = "blocked_parental" // blocked by parental control
<mask> filteringStatusWhitelisted = "whitelisted" // whitelisted
<mask> filteringStatusRewritten = "rewritten" // all kinds of rewrites
<mask> filteringStatusSafeSearch = "safe_search" // enforced safe search
<mask> )
<mask>
<mask> // filteringStatusValues -- array with all possible filteringStatus values
<mask> var filteringStatusValues = []string{
<mask> filteringStatusAll, filteringStatusFiltered, filteringStatusBlocked,
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, </s> remove criteriaType: ctClient,
</s> add criteriaType: ctDomainOrClient, </s> add filteringStatusProcessed, | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep add keep keep keep keep | <mask> filteringStatusBlockedSafebrowsing, filteringStatusBlockedParental,
<mask> filteringStatusWhitelisted, filteringStatusRewritten, filteringStatusSafeSearch,
<mask> }
<mask>
<mask> // searchCriteria - every search request may contain a list of different search criteria
<mask> // we use each of them to match the query
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove case ctDomain:
</s> add case ctDomainOrClient: </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> add filteringStatusProcessed = "processed" // not blocked, not white-listed entries </s> add jsonEntry["upstream"] = entry.Upstream
</s> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address </s> remove criteriaType: ctDomain,
</s> add criteriaType: ctDomainOrClient, | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep | <mask> func (c *searchCriteria) quickMatch(line string) bool {
<mask> // note that we do this only for a limited set of criteria
<mask>
<mask> switch c.criteriaType {
<mask> case ctDomain:
<mask> return c.quickMatchJSONValue(line, "QH")
<mask> case ctClient:
<mask> return c.quickMatchJSONValue(line, "IP")
<mask> case ctQuestionType:
<mask> return c.quickMatchJSONValue(line, "QT")
<mask> default:
<mask> return true
<mask> }
<mask> }
<mask>
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove case ctDomain:
</s> add case ctDomainOrClient: </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> add filteringStatusProcessed, </s> remove return false
case ctClient:
</s> add </s> add case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
</s> add jsonEntry["upstream"] = entry.Upstream
| https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep keep replace keep keep keep keep keep | <mask> // match - checks if the log entry matches this search criteria
<mask> // nolint (gocyclo)
<mask> func (c *searchCriteria) match(entry *logEntry) bool {
<mask> switch c.criteriaType {
<mask> case ctDomain:
<mask> if c.strict && entry.QHost == c.value {
<mask> return true
<mask> }
<mask> if !c.strict && strings.Contains(entry.QHost, c.value) {
<mask> return true
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove return false
case ctClient:
</s> add </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add </s> add filteringStatusProcessed, </s> add jsonEntry["upstream"] = entry.Upstream
| https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> }
<mask> if !c.strict && strings.Contains(entry.QHost, c.value) {
<mask> return true
<mask> }
<mask> return false
<mask> case ctClient:
<mask> if c.strict && entry.IP == c.value {
<mask> return true
<mask> }
<mask> if !c.strict && strings.Contains(entry.IP, c.value) {
<mask> return true
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> remove case ctDomain:
</s> add case ctDomainOrClient: </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> remove
default:
return false
</s> add </s> add case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
| https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep | <mask> if !c.strict && strings.Contains(entry.IP, c.value) {
<mask> return true
<mask> }
<mask> return false
<mask> case ctQuestionType:
<mask> if c.strict && entry.QType == c.value {
<mask> return true
<mask> }
<mask> if !c.strict && strings.Contains(entry.QType, c.value) {
<mask> return true
<mask> }
<mask> case ctFilteringStatus:
<mask> res := entry.Result
<mask>
<mask> switch c.value {
<mask> case filteringStatusAll:
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove return false
case ctClient:
</s> add </s> remove case ctDomain:
</s> add case ctDomainOrClient: </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> add case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
</s> remove "filter_domain": ctDomain,
"filter_client": ctClient,
"filter_question_type": ctQuestionType,
"filter_response_status": ctFilteringStatus,
</s> add "search": ctDomainOrClient,
"response_status": ctFilteringStatus, | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep add keep keep keep keep keep keep | <mask> case filteringStatusSafeSearch:
<mask> return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
<mask> default:
<mask> return false
<mask> }
<mask> }
<mask>
<mask> return false
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> remove
default:
return false
</s> add </s> remove return false
case ctClient:
</s> add </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> remove case ctDomain:
</s> add case ctDomainOrClient: </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep keep replace replace replace keep keep keep keep | <mask> return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
<mask> default:
<mask> return false
<mask> }
<mask>
<mask> default:
<mask> return false
<mask> }
<mask>
<mask> return false
<mask> }
</s> + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient </s> add case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
</s> remove return false
case ctClient:
</s> add </s> remove case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
</s> add </s> remove case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
</s> add case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") </s> remove if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
</s> add </s> add jsonEntry["upstream"] = entry.Upstream
| https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
keep keep keep keep replace replace replace replace replace keep keep keep keep keep | <mask> setModalOpened(false);
<mask> }
<mask> };
<mask>
<mask> const blockButton = <button
<mask> className={classNames('title--border text-center button-action--arrow-option', { 'bg--danger': !isBlocked })}
<mask> onClick={onToggleBlock}>
<mask> {t(buttonType)}
<mask> </button>;
<mask>
<mask> const blockForClientButton = <button
<mask> className='text-center font-weight-bold py-2 button-action--arrow-option'
<mask> onClick={onBlockingForClientClick}>
<mask> {t(blockingForClientKey)}
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove export const MEDIUM_SCREEN_SIZE = 1023;
</s> add export const MEDIUM_SCREEN_SIZE = 1024; </s> remove const mediaQuery = window.matchMedia(`(max-width: ${SMALL_SCREEN_SIZE}px)`);
</s> add const mediaQuery = window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`); </s> remove const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth < SMALL_SCREEN_SIZE);
</s> add const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= MEDIUM_SCREEN_SIZE); </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove cursor: pointer;
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Cells/index.js |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> .custom-select--logs {
<mask> padding: 0.5rem 0.75rem 0.5rem 2rem !important;
<mask> }
<mask>
<mask> .bg--danger {
<mask> color: var(--danger) !important;
<mask> }
<mask>
<mask> .form-control--search {
<mask> box-shadow: 0 1px 0 #ddd;
<mask> padding: 0 2.5rem;
<mask> height: 2.25rem;
<mask> flex-grow: 1;
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> remove cursor: pointer;
</s> add </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep add keep keep keep keep keep keep | <mask> height: 1.6rem;
<mask> }
<mask>
<mask> .button-action__container--detailed {
<mask> bottom: 1.3rem;
<mask> }
<mask>
<mask> .button-action {
<mask> outline: 0 !important;
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add </s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove cursor: pointer;
</s> add </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> remove SMALL_SCREEN_SIZE,
</s> add MEDIUM_SCREEN_SIZE, | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep keep keep replace keep keep keep keep keep | <mask> background: transparent;
<mask> border: 0;
<mask> display: block;
<mask> width: 100%;
<mask> text-align: left;
<mask> color: inherit;
<mask> }
<mask>
<mask> .button-action--arrow-option:disabled {
<mask> display: none;
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> remove cursor: pointer;
</s> add </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep keep add keep keep keep keep | <mask> padding-bottom: 0.5rem;
<mask> text-align: center;
<mask> font-weight: 700;
<mask> color: inherit;
<mask> }
<mask>
<mask> .button-action--arrow-option:disabled {
<mask> display: none;
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> remove cursor: pointer;
</s> add </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep add keep keep keep keep keep | <mask> display: none;
<mask> }
<mask>
<mask> .tooltip-custom__container .button-action--arrow-option:not(:disabled):hover {
<mask> background: var(--gray-f3);
<mask> overflow: hidden;
<mask> }
<mask>
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove cursor: pointer;
</s> add </s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep keep keep replace keep keep keep keep keep | <mask> display: none;
<mask> }
<mask>
<mask> .tooltip-custom__container .button-action--arrow-option:not(:disabled):hover {
<mask> cursor: pointer;
<mask> background: var(--gray-f3);
<mask> overflow: hidden;
<mask> }
<mask>
<mask> .button-action--arrow-option-container {
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; </s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep keep add | <mask> font-style: italic;
<mask> font-weight: normal;
<mask> margin-bottom: 1rem;
<mask> }
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> remove cursor: pointer;
</s> add </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
keep keep keep keep replace keep keep keep keep keep | <mask> import queryString from 'query-string';
<mask> import classNames from 'classnames';
<mask> import {
<mask> BLOCK_ACTIONS,
<mask> SMALL_SCREEN_SIZE,
<mask> } from '../../helpers/constants';
<mask> import Loading from '../ui/Loading';
<mask> import Filters from './Filters';
<mask> import Disabled from './Disabled';
<mask> import { getFilteringStatus } from '../../actions/filtering';
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove cursor: pointer;
</s> add </s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; </s> add .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
</s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> const search = search_url_param || filter?.search || '';
<mask> const response_status = response_status_url_param || filter?.response_status || '';
<mask>
<mask> const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth < SMALL_SCREEN_SIZE);
<mask> const [detailedDataCurrent, setDetailedDataCurrent] = useState({});
<mask> const [buttonType, setButtonType] = useState(BLOCK_ACTIONS.BLOCK);
<mask> const [isModalOpened, setModalOpened] = useState(false);
<mask> const [isLoading, setIsLoading] = useState(false);
<mask>
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove export const MEDIUM_SCREEN_SIZE = 1023;
</s> add export const MEDIUM_SCREEN_SIZE = 1024; </s> remove const mediaQuery = window.matchMedia(`(max-width: ${SMALL_SCREEN_SIZE}px)`);
</s> add const mediaQuery = window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`); </s> remove const blockButton = <button
className={classNames('title--border text-center button-action--arrow-option', { 'bg--danger': !isBlocked })}
onClick={onToggleBlock}>
{t(buttonType)}
</button>;
</s> add const blockButton = (
<>
<div className="title--border" />
<button
type="button"
className={
classNames(
'button-action--arrow-option',
{ 'bg--danger': !isBlocked },
{ 'bg--green': isFiltered },
)}
onClick={onToggleBlock}
>
{t(buttonType)}
</button>
</>
); </s> remove SMALL_SCREEN_SIZE,
</s> add MEDIUM_SCREEN_SIZE, </s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove cursor: pointer;
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask> setIsLoading(false);
<mask> })();
<mask> }, [response_status, search]);
<mask>
<mask> const mediaQuery = window.matchMedia(`(max-width: ${SMALL_SCREEN_SIZE}px)`);
<mask> const mediaQueryHandler = (e) => {
<mask> setIsSmallScreen(e.matches);
<mask> if (e.matches) {
<mask> dispatch(toggleDetailedLogs(false));
<mask> }
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove const blockButton = <button
className={classNames('title--border text-center button-action--arrow-option', { 'bg--danger': !isBlocked })}
onClick={onToggleBlock}>
{t(buttonType)}
</button>;
</s> add const blockButton = (
<>
<div className="title--border" />
<button
type="button"
className={
classNames(
'button-action--arrow-option',
{ 'bg--danger': !isBlocked },
{ 'bg--green': isFiltered },
)}
onClick={onToggleBlock}
>
{t(buttonType)}
</button>
</>
); </s> remove export const MEDIUM_SCREEN_SIZE = 1023;
</s> add export const MEDIUM_SCREEN_SIZE = 1024; </s> remove const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth < SMALL_SCREEN_SIZE);
</s> add const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= MEDIUM_SCREEN_SIZE); </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> add .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} </s> remove cursor: pointer;
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask> ...DHCP_FORM_NAMES,
<mask> };
<mask>
<mask> export const SMALL_SCREEN_SIZE = 767;
<mask> export const MEDIUM_SCREEN_SIZE = 1023;
<mask>
<mask> export const SECONDS_IN_DAY = 60 * 60 * 24;
<mask>
<mask> export const UINT32_RANGE = {
<mask> MIN: 0,
</s> Pull request: 4775 fix query log issue on tablet devices
Updates #4775
Squashed commit of the following:
commit 9ad85d2306b68227e11c7b1dd792e3fe6389939d
Merge: 95aa29d6 41f081d8
Author: Ildar Kamalov <[email protected]>
Date: Tue Aug 2 11:44:04 2022 +0300
Merge branch 'master' into 4775-popup
commit 95aa29d68bdf5e9c4e7aa59f42d04328b1872115
Author: Ildar Kamalov <[email protected]>
Date: Mon Aug 1 16:21:23 2022 +0300
client: fix query log issue on tablet devices </s> remove const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth < SMALL_SCREEN_SIZE);
</s> add const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= MEDIUM_SCREEN_SIZE); </s> remove const mediaQuery = window.matchMedia(`(max-width: ${SMALL_SCREEN_SIZE}px)`);
</s> add const mediaQuery = window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`); </s> remove const blockButton = <button
className={classNames('title--border text-center button-action--arrow-option', { 'bg--danger': !isBlocked })}
onClick={onToggleBlock}>
{t(buttonType)}
</button>;
</s> add const blockButton = (
<>
<div className="title--border" />
<button
type="button"
className={
classNames(
'button-action--arrow-option',
{ 'bg--danger': !isBlocked },
{ 'bg--green': isFiltered },
)}
onClick={onToggleBlock}
>
{t(buttonType)}
</button>
</>
); </s> add @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
</s> remove cursor: pointer;
</s> add </s> add cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f; | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/helpers/constants.js |
keep keep keep keep replace keep keep keep keep keep | <mask> className="btn btn-icon btn-outline-primary btn-sm"
<mask> title={t('refresh_btn')}
<mask> onClick={() => getAllStats()}
<mask> >
<mask> <svg className="icons">
<mask> <use xlinkHref="#refresh" />
<mask> </svg>
<mask> </button>;
<mask>
<mask> const statsProcessing = stats.processingStats
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Dashboard/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask> url,
<mask> })
<mask> }
<mask> >
<mask> <svg className="icons">
<mask> <use xlinkHref="#edit" />
<mask> </svg>
<mask> </button>
<mask> <button
<mask> type="button"
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove className="h-100"
</s> add className="icon24" | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Filters/Table.js |
keep keep keep keep replace keep keep keep keep keep | <mask> className="btn btn-icon btn-outline-secondary btn-sm"
<mask> onClick={() => handleDelete(url)}
<mask> title={t('delete_table_action')}
<mask> >
<mask> <svg className="icons">
<mask> <use xlinkHref="#delete" />
<mask> </svg>
<mask> </button>
<mask> </div>
<mask> );
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Filters/Table.js |
keep keep keep keep replace keep keep keep keep keep | <mask> </button>
<mask> {content && (
<mask> <button className={buttonArrowClass} disabled={processingRules}>
<mask> <IconTooltip
<mask> className="h-100"
<mask> tooltipClass="button-action--arrow-option-container"
<mask> xlinkHref="chevron-down"
<mask> triggerClass="button-action--icon"
<mask> content={content}
<mask> placement="bottom-end"
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Logs/Cells/ClientCell.js |
keep keep add keep keep keep keep keep | <mask> max-height: 100% !important;
<mask> }
<mask>
<mask> .cursor--pointer {
<mask> cursor: pointer;
<mask> }
<mask>
<mask> .custom-select__arrow--left {
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove align-items: center;
</s> add </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> </s> remove <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none"
strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<path d="M23 4v6h-6M1 20v-6h6" />
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
</s> add <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<polyline points="23 4 23 10 17 10"></polyline>
<polyline points="1 20 1 14 7 14"></polyline>
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Logs/Logs.css |
keep keep keep keep replace keep keep keep keep keep | <mask> width: 100%;
<mask> height: 100%;
<mask> display: flex;
<mask> justify-content: center;
<mask> align-items: center;
<mask> }
<mask>
<mask> .button-action:active {
<mask> background: var(--btn-block-active);
<mask> }
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> add .icon24 {
width: 24px;
height: 24px;
}
.icon12 {
width: 12px;
height: 12px;
}
</s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> </s> remove <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none"
strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<path d="M23 4v6h-6M1 20v-6h6" />
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
</s> add <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<polyline points="23 4 23 10 17 10"></polyline>
<polyline points="1 20 1 14 7 14"></polyline>
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Logs/Logs.css |
keep keep keep keep replace keep keep keep keep keep | <mask> }
<mask> disabled={processingUpdating}
<mask> title={t('edit_table_action')}
<mask> >
<mask> <svg className="icons">
<mask> <use xlinkHref="#edit" />
<mask> </svg>
<mask> </button>
<mask> <button
<mask> type="button"
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove className="h-100"
</s> add className="icon24" | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Settings/Clients/ClientsTable/ClientsTable.js |
keep keep keep keep replace keep keep keep keep keep | <mask> onClick={() => handleDelete({ name: clientName })}
<mask> disabled={processingDeleting}
<mask> title={t('delete_table_action')}
<mask> >
<mask> <svg className="icons">
<mask> <use xlinkHref="#delete" />
<mask> </svg>
<mask> </button>
<mask> </div>
<mask> );
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Settings/Clients/ClientsTable/ClientsTable.js |
keep keep keep keep replace replace replace replace keep keep keep keep keep | <mask> <path
<mask> d="m19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1 -2.83 0l-.06-.06a1.65 1.65 0 0 0 -1.82-.33 1.65 1.65 0 0 0 -1 1.51v.17a2 2 0 0 1 -2 2 2 2 0 0 1 -2-2v-.09a1.65 1.65 0 0 0 -1.08-1.51 1.65 1.65 0 0 0 -1.82.33l-.06.06a2 2 0 0 1 -2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0 -1.51-1h-.17a2 2 0 0 1 -2-2 2 2 0 0 1 2-2h.09a1.65 1.65 0 0 0 1.51-1.08 1.65 1.65 0 0 0 -.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33h.08a1.65 1.65 0 0 0 1-1.51v-.17a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0 -.33 1.82v.08a1.65 1.65 0 0 0 1.51 1h.17a2 2 0 0 1 2 2 2 2 0 0 1 -2 2h-.09a1.65 1.65 0 0 0 -1.51 1z" />
<mask> </symbol>
<mask>
<mask> <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none"
<mask> strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<mask> <path d="M23 4v6h-6M1 20v-6h6" />
<mask> <path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
<mask> </symbol>
<mask>
<mask> <symbol id="dns_privacy" viewBox="0 0 30 30" stroke="none" fill="currentColor"
<mask> strokeLinecap="round" strokeLinejoin="round">
<mask> <path
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/ui/Icons.js |
keep keep keep keep replace keep keep keep keep keep | <mask> <path d="M60 54.5h8v40h-8zM60 35.5h8v8h-8z" />
<mask> </svg>
<mask> </symbol>
<mask>
<mask> <symbol id="chevron-down" viewBox="0 0 24 24">
<mask> <g fill="none" fillRule="evenodd">
<mask> <path d="M0 0h24v24H0z" fill="#878787" fillOpacity=".01" />
<mask> <path stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"
<mask> d="M8.036 10.93l3.93 4.07 4.068-3.93" />
<mask> </g>
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none"
strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<path d="M23 4v6h-6M1 20v-6h6" />
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15" />
</s> add <symbol id="refresh" viewBox="0 0 24 24" stroke="currentColor" fill="none" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2">
<polyline points="23 4 23 10 17 10"></polyline>
<polyline points="1 20 1 14 7 14"></polyline>
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"></path> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/ui/Icons.js |
keep keep keep keep replace keep keep keep keep keep | <mask> onClick={onClick}
<mask> disabled={processingVersion}
<mask> title={t('check_updates_now')}
<mask> >
<mask> <svg className="icons">
<mask> <use xlinkHref="#refresh" />
<mask> </svg>
<mask> </button>}
<mask> </div>
<mask> </div>
</s> 5505 fix icons
Updates #5505
Squashed commit of the following:
commit 3d66b82808b9c3904bad8bb32f3927172bfdcda6
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:45:42 2023 +0300
fix icons
commit 5030b45751e1717e5030eed0b46634f800d357d2
Author: Ildar Kamalov <[email protected]>
Date: Mon Mar 6 12:24:32 2023 +0300
client: fix chevron icon </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <svg className="icons">
</s> add <svg className="icons icon12"> </s> remove <symbol id="chevron-down" viewBox="0 0 24 24">
</s> add <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/ui/Version.js |
keep keep keep keep replace keep keep keep keep keep | <mask> "encryption_server_desc": "In order to use HTTPS, you need yo enter the server name that matches your SSL certificate.",
<mask> "encryption_redirect": "Redirect to HTTPS automatically",
<mask> "encryption_redirect_desc": "If checked, AdGuard Home will automatically redirect you from HTTP to HTTPS addresses.",
<mask> "encryption_https": "HTTPS port",
<mask> "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\\dns-query' location.",
<mask> "encryption_dot": "DNS-over-TLS port",
<mask> "encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.",
<mask> "encryption_certificates": "Certificates",
<mask> "encryption_certificates_desc": "In order to use encryption, you need to provide a valid SSL certificates chain for your domain. You can get a free certificate on <0>{{link}}</0> or you can buy it from one of the trusted Certificate Authorities.",
<mask> "encryption_certificates_input": "Copy/paste your PEM-encoded cerificates here.",
</s> Added validation on change and enable encryption checkbox </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", </s> add "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
"encryption_enable_desc": "If encryption is enabled, AdGuard Home admin interface will work over HTTPS, and the DNS server will listen for requests over DNS-over-HTTPS and DNS-over-TLS.",
"encryption_chain_valid": "Certificate chain is valid",
"encryption_chain_invalid": "Certificate chain is invalid",
"encryption_key_valid": "This is a valid {{type}} private key",
"encryption_key_invalid": "This is an invalid {{type}} private key",
"encryption_subject": "Subject",
"encryption_issuer": "Issuer",
"encryption_hostnames": "Hostnames", </s> add "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.", </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove {statusKey &&
</s> add {privateKey && </s> add import { EMPTY_DATE } from '../../../helpers/constants'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
keep keep keep keep replace replace keep keep keep keep keep | <mask> "encryption_certificates": "Certificates",
<mask> "encryption_certificates_desc": "In order to use encryption, you need to provide a valid SSL certificates chain for your domain. You can get a free certificate on <0>{{link}}</0> or you can buy it from one of the trusted Certificate Authorities.",
<mask> "encryption_certificates_input": "Copy/paste your PEM-encoded cerificates here.",
<mask> "encryption_status": "Status",
<mask> "encryption_certificates_for": "Certificates for {{domains}}",
<mask> "encryption_expire": "Expire on {{date}}",
<mask> "encryption_key": "Private key",
<mask> "encryption_key_input": "Copy/paste your PEM-encoded private key for your cerficate here.",
<mask> "topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
<mask> "form_error_port_range": "Enter port value in the range of 80-65535",
<mask> "form_error_equal": "Shouldn't be equal",
</s> Added validation on change and enable encryption checkbox </s> remove "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\\dns-query' location.",
</s> add "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\/dns-query' location.", </s> add "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
"encryption_enable_desc": "If encryption is enabled, AdGuard Home admin interface will work over HTTPS, and the DNS server will listen for requests over DNS-over-HTTPS and DNS-over-TLS.",
"encryption_chain_valid": "Certificate chain is valid",
"encryption_chain_invalid": "Certificate chain is invalid",
"encryption_key_valid": "This is a valid {{type}} private key",
"encryption_key_invalid": "This is an invalid {{type}} private key",
"encryption_subject": "Subject",
"encryption_issuer": "Issuer",
"encryption_hostnames": "Hostnames", </s> add "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.", </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove {statusKey &&
</s> add {privateKey && </s> remove {isExpiringCertificate &&
<Topline type="warning">
<Trans components={[<a href="#settings" key="0">link</a>]}>
topline_expiring_certificate
</Trans>
</Topline>
</s> add {!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} /> | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
keep keep keep add keep keep keep keep keep keep | <mask> "encryption_status": "Status",
<mask> "encryption_expire": "Expires",
<mask> "encryption_key": "Private key",
<mask> "encryption_key_input": "Copy/paste your PEM-encoded private key for your cerficate here.",
<mask> "topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
<mask> "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.",
<mask> "form_error_port_range": "Enter port value in the range of 80-65535",
<mask> "form_error_equal": "Shouldn't be equal",
<mask> "form_error_password": "Password mismatched",
<mask> "reset_settings": "Reset settings"
</s> Added validation on change and enable encryption checkbox </s> add "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.", </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", </s> remove "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\\dns-query' location.",
</s> add "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\/dns-query' location.", </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove {statusKey &&
</s> add {privateKey && </s> add import { EMPTY_DATE } from '../../../helpers/constants'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
keep keep keep add keep keep keep keep | <mask> "encryption_subject": "Subject",
<mask> "encryption_issuer": "Issuer",
<mask> "encryption_hostnames": "Hostnames",
<mask> "topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
<mask> "form_error_port_range": "Enter port value in the range of 80-65535",
<mask> "form_error_equal": "Shouldn't be equal",
<mask> "form_error_password": "Password mismatched",
<mask> "reset_settings": "Reset settings"
</s> Added validation on change and enable encryption checkbox </s> add "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
"encryption_enable_desc": "If encryption is enabled, AdGuard Home admin interface will work over HTTPS, and the DNS server will listen for requests over DNS-over-HTTPS and DNS-over-TLS.",
"encryption_chain_valid": "Certificate chain is valid",
"encryption_chain_invalid": "Certificate chain is invalid",
"encryption_key_valid": "This is a valid {{type}} private key",
"encryption_key_invalid": "This is an invalid {{type}} private key",
"encryption_subject": "Subject",
"encryption_issuer": "Issuer",
"encryption_hostnames": "Hostnames", </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", </s> remove "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\\dns-query' location.",
</s> add "encryption_https_desc": "If HTTPS port is configured, AdGuard Home admin interface will be accessible via HTTPS, and it will also provide DNS-over-HTTPS on '\/dns-query' location.", </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> add import format from 'date-fns/format'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
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 | <mask> dispatch(findActiveDhcpFailure());
<mask> }
<mask> }
<mask> };
<mask>
<mask> export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
<mask> export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
<mask> export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
<mask>
<mask> export const getTlsStatus = () => async (dispatch) => {
<mask> dispatch(getTlsStatusRequest());
<mask> try {
<mask> const status = await apiClient.getTlsStatus();
<mask> status.certificate_chain = atob(status.certificate_chain);
<mask> status.private_key = atob(status.private_key);
<mask>
<mask> dispatch(getTlsStatusSuccess(status));
<mask> } catch (error) {
<mask> dispatch(addErrorToast({ error }));
<mask> dispatch(getTlsStatusFailure());
<mask> }
<mask> };
<mask>
<mask> export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
<mask> export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
<mask> export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
<mask>
<mask> export const setTlsConfig = config => async (dispatch) => {
<mask> dispatch(setTlsConfigRequest());
<mask> try {
<mask> const values = { ...config };
<mask> values.certificate_chain = btoa(values.certificate_chain);
<mask> values.private_key = btoa(values.private_key);
<mask> values.port_https = values.port_https || 0;
<mask> values.port_dns_over_tls = values.port_dns_over_tls || 0;
<mask>
<mask> await apiClient.setTlsConfig(values);
<mask> dispatch(setTlsConfigSuccess(config));
<mask> dispatch(addSuccessToast('encryption_config_saved'));
<mask> dispatch(getTlsStatus());
<mask> } catch (error) {
<mask> dispatch(addErrorToast({ error }));
<mask> dispatch(setTlsConfigFailure());
<mask> }
<mask> };
</s> Added validation on change and enable encryption checkbox </s> add export const EMPTY_DATE = '0001-01-01T00:00:00Z'; </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> remove isDropdownOpen: false,
</s> add </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/actions/index.js |
keep keep add keep keep keep keep keep | <mask> // DNS-over-HTTPS and DNS-over-TLS
<mask> TLS_STATUS = { path: 'tls/status', method: 'GET' };
<mask> TLS_CONFIG = { path: 'tls/configure', method: 'POST' };
<mask>
<mask> getTlsStatus() {
<mask> const { path, method } = this.TLS_STATUS;
<mask> return this.makeRequest(path, method);
<mask> }
</s> Added validation on change and enable encryption checkbox </s> add validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} </s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove isDropdownOpen: false,
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/api/Api.js |
keep keep keep add keep | <mask> headers: { 'Content-Type': 'application/json' },
<mask> };
<mask> return this.makeRequest(path, method, parameters);
<mask> }
<mask> }
</s> Added validation on change and enable encryption checkbox </s> add TLS_VALIDATE = { path: 'tls/validate', method: 'POST' }; </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/api/Api.js |
keep keep keep replace keep keep keep keep keep | <mask> import React, { Component, Fragment } from 'react';
<mask> import { HashRouter, Route } from 'react-router-dom';
<mask> import PropTypes from 'prop-types';
<mask> import { Trans, withNamespaces } from 'react-i18next';
<mask> import LoadingBar from 'react-redux-loading-bar';
<mask>
<mask> import 'react-table/react-table.css';
<mask> import '../ui/Tabler.css';
<mask> import '../ui/ReactTable.css';
</s> Added validation on change and enable encryption checkbox </s> add import { connect } from 'react-redux'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import debounce from 'lodash/debounce'; </s> add import format from 'date-fns/format'; </s> add import EncryptionTopline from '../ui/EncryptionTopline'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
keep add keep keep keep keep keep | <mask> import Status from '../ui/Status';
<mask> import Topline from '../ui/Topline';
<mask> import i18n from '../../i18n';
<mask>
<mask> class App extends Component {
<mask> componentDidMount() {
<mask> this.props.getDnsStatus();
</s> Added validation on change and enable encryption checkbox </s> add import debounce from 'lodash/debounce'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import format from 'date-fns/format'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; </s> add import { connect } from 'react-redux'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask> const updateAvailable =
<mask> !dashboard.processingVersions &&
<mask> dashboard.isCoreRunning &&
<mask> dashboard.isUpdateAvailable;
<mask> const isExpiringCertificate = !encryption.processing && encryption.warning;
<mask>
<mask> return (
<mask> <HashRouter hashType='noslash'>
<mask> <Fragment>
<mask> {updateAvailable &&
</s> Added validation on change and enable encryption checkbox </s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> remove {statusCert &&
</s> add {certificateChain && </s> remove {statusKey &&
</s> add {privateKey && </s> remove <div>
{statusCert}
</div>
</s> add <ul>
<li className={valid_chain ? 'text-success' : 'text-danger'}>
{valid_chain ?
<Trans>encryption_chain_valid</Trans>
: <Trans>encryption_chain_invalid</Trans>
}
</li>
{subject &&
<li><Trans>encryption_subject</Trans>: {subject}</li>
}
{issuer &&
<li><Trans>encryption_issuer</Trans>: {issuer}</li>
}
{not_after && not_after !== EMPTY_DATE &&
<li>
<Trans>encryption_expire</Trans>:
{format(not_after, 'YYYY-MM-DD HH:mm:ss')}
</li>
}
{dns_names &&
<li>
<Trans>encryption_hostnames</Trans>: {dns_names}
</li>
}
</ul> </s> remove {isExpiringCertificate &&
<Topline type="warning">
<Trans components={[<a href="#settings" key="0">link</a>]}>
topline_expiring_certificate
</Trans>
</Topline>
</s> add {!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} /> </s> add onChange={handleChange}
disabled={!isEnabled} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep | <mask> <Topline type="info">
<mask> {dashboard.announcement} <a href={dashboard.announcementUrl} target="_blank" rel="noopener noreferrer">Click here</a> for more info.
<mask> </Topline>
<mask> }
<mask> {isExpiringCertificate &&
<mask> <Topline type="warning">
<mask> <Trans components={[<a href="#settings" key="0">link</a>]}>
<mask> topline_expiring_certificate
<mask> </Trans>
<mask> </Topline>
<mask> }
<mask> <LoadingBar className="loading-bar" updateTime={1000} />
<mask> <Route component={Header} />
<mask> <div className="container container--wrap">
<mask> {!dashboard.processing && !dashboard.isCoreRunning &&
</s> Added validation on change and enable encryption checkbox </s> remove {statusKey &&
</s> add {privateKey && </s> remove {statusCert &&
</s> add {certificateChain && </s> remove <div>
{statusCert}
</div>
</s> add <ul>
<li className={valid_chain ? 'text-success' : 'text-danger'}>
{valid_chain ?
<Trans>encryption_chain_valid</Trans>
: <Trans>encryption_chain_invalid</Trans>
}
</li>
{subject &&
<li><Trans>encryption_subject</Trans>: {subject}</li>
}
{issuer &&
<li><Trans>encryption_issuer</Trans>: {issuer}</li>
}
{not_after && not_after !== EMPTY_DATE &&
<li>
<Trans>encryption_expire</Trans>:
{format(not_after, 'YYYY-MM-DD HH:mm:ss')}
</li>
}
{dns_names &&
<li>
<Trans>encryption_hostnames</Trans>: {dns_names}
</li>
}
</ul> </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> class Header extends Component {
<mask> state = {
<mask> isMenuOpen: false,
<mask> isDropdownOpen: false,
<mask> };
<mask>
<mask> toggleMenuOpen = () => {
<mask> this.setState(prevState => ({ isMenuOpen: !prevState.isMenuOpen }));
<mask> };
</s> Added validation on change and enable encryption checkbox </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> add import encryption from './encryption'; </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add import EncryptionTopline from '../ui/EncryptionTopline'; </s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
| https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Header/index.js |
keep add keep keep keep keep keep | <mask> render() {
<mask> const { dashboard } = this.props;
<mask> const badgeClass = classnames({
<mask> 'badge dns-status': true,
<mask> 'badge-success': dashboard.protectionEnabled,
<mask> 'badge-danger': !dashboard.protectionEnabled,
<mask> });
</s> Added validation on change and enable encryption checkbox </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> add validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Header/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask> </div>
<mask> </div>
<mask> <Menu
<mask> location={this.props.location}
<mask> isMenuOpen={this.state.isMenuOpen}
<mask> toggleMenuOpen={this.toggleMenuOpen}
<mask> closeMenu={this.closeMenu}
<mask> />
<mask> <div className="col col-sm-6 col-lg-3">
<mask> <Version
</s> Added validation on change and enable encryption checkbox </s> add onChange={handleChange}
disabled={!isEnabled} </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> </s> add onChange={handleChange}
disabled={!isEnabled} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Header/index.js |
add keep keep keep keep keep | <mask> import React, { Fragment } from 'react';
<mask> import PropTypes from 'prop-types';
<mask> import { Field, reduxForm, formValueSelector } from 'redux-form';
<mask> import { Trans, withNamespaces } from 'react-i18next';
<mask> import flow from 'lodash/flow';
<mask> import format from 'date-fns/format';
</s> Added validation on change and enable encryption checkbox </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import format from 'date-fns/format'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; </s> add import debounce from 'lodash/debounce'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> add import EncryptionTopline from '../ui/EncryptionTopline'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep replace keep keep keep keep keep | <mask> import React, { Fragment } from 'react';
<mask> import PropTypes from 'prop-types';
<mask> import { Field, reduxForm } from 'redux-form';
<mask> import { Trans, withNamespaces } from 'react-i18next';
<mask> import flow from 'lodash/flow';
<mask>
<mask> import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
<mask> import i18n from '../../../i18n';
</s> Added validation on change and enable encryption checkbox </s> add import format from 'date-fns/format'; </s> add import { connect } from 'react-redux'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; </s> add import debounce from 'lodash/debounce'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> add import EncryptionTopline from '../ui/EncryptionTopline'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep keep keep | <mask> import { Field, reduxForm, formValueSelector } from 'redux-form';
<mask> import { Trans, withNamespaces } from 'react-i18next';
<mask> import flow from 'lodash/flow';
<mask>
<mask> import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
<mask> import { EMPTY_DATE } from '../../../helpers/constants';
<mask> import i18n from '../../../i18n';
<mask>
<mask> const validate = (values) => {
</s> Added validation on change and enable encryption checkbox </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> add import { connect } from 'react-redux'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; </s> add import debounce from 'lodash/debounce'; </s> add import EncryptionTopline from '../ui/EncryptionTopline'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep | <mask> import format from 'date-fns/format';
<mask>
<mask> import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
<mask> import i18n from '../../../i18n';
<mask>
<mask> const validate = (values) => {
<mask> const errors = {};
</s> Added validation on change and enable encryption checkbox </s> add import format from 'date-fns/format'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import { connect } from 'react-redux'; </s> add import EncryptionTopline from '../ui/EncryptionTopline'; </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; </s> add import encryption from './encryption'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> return errors;
<mask> };
<mask>
<mask> const Form = (props) => {
<mask> const {
<mask> t,
<mask> handleSubmit,
<mask> reset,
<mask> invalid,
</s> Added validation on change and enable encryption checkbox </s> add handleChange,
isEnabled,
certificateChain,
privateKey, </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </s> add validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep add keep keep keep keep | <mask> let Form = (props) => {
<mask> const {
<mask> t,
<mask> handleSubmit,
<mask> reset,
<mask> invalid,
<mask> submitting,
<mask> processing,
</s> Added validation on change and enable encryption checkbox </s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
| https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> reset,
<mask> invalid,
<mask> submitting,
<mask> processing,
<mask> statusCert,
<mask> statusKey,
<mask> } = props;
<mask>
<mask> return (
<mask> <form onSubmit={handleSubmit}>
<mask> <div className="row">
</s> Added validation on change and enable encryption checkbox </s> add handleChange,
isEnabled,
certificateChain,
privateKey, </s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add </s> remove {/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for
</Trans>
</div>
<div>
<Trans values={{ date: '2022-01-01' }}>
encryption_expire
</Trans>
</div> */}
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep keep | <mask> return (
<mask> <form onSubmit={handleSubmit}>
<mask> <div className="row">
<mask> <div className="col-12">
<mask> <label className="form__label" htmlFor="server_name">
<mask> <Trans>encryption_server</Trans>
<mask> </label>
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </s> add <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> </s> remove {/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for
</Trans>
</div>
<div>
<Trans values={{ date: '2022-01-01' }}>
encryption_expire
</Trans>
</div> */}
</s> add </s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add </s> remove <div className="btn-list">
</s> add <div className="btn-list mt-2"> | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep add keep keep keep keep | <mask> className="form-control"
<mask> placeholder={t('encryption_server_enter')}
<mask> />
<mask> <div className="form__desc">
<mask> <Trans>encryption_server_desc</Trans>
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} </s> remove {statusCert &&
</s> add {certificateChain && | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep add keep keep keep keep keep | <mask> component={renderSelectField}
<mask> placeholder={t('encryption_redirect')}
<mask> />
<mask> <div className="form__desc">
<mask> <Trans>encryption_redirect_desc</Trans>
<mask> </div>
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} </s> add <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep add keep keep keep keep | <mask> className="form-control"
<mask> placeholder={t('encryption_https')}
<mask> validate={[port]}
<mask> normalize={toNumber}
<mask> />
<mask> <div className="form__desc">
<mask> <Trans>encryption_https_desc</Trans>
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} </s> remove {statusCert &&
</s> add {certificateChain && | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep add keep keep keep keep | <mask> validate={[port]}
<mask> normalize={toNumber}
<mask> />
<mask> <div className="form__desc">
<mask> <Trans>encryption_dot_desc</Trans>
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} </s> remove {statusCert &&
</s> add {certificateChain && | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep keep keep | <mask> type="text"
<mask> className="form-control form-control--textarea"
<mask> placeholder={t('encryption_certificates_input')}
<mask> />
<mask> <div className="form__status">
<mask> {certificateChain &&
<mask> <Fragment>
<mask> <div className="form__label form__label--bold">
<mask> <Trans>encryption_status</Trans>:
</s> Added validation on change and enable encryption checkbox </s> remove {statusCert &&
</s> add {certificateChain && </s> remove {statusKey &&
</s> add {privateKey && </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove <div>
{statusCert}
</div>
</s> add <ul>
<li className={valid_chain ? 'text-success' : 'text-danger'}>
{valid_chain ?
<Trans>encryption_chain_valid</Trans>
: <Trans>encryption_chain_invalid</Trans>
}
</li>
{subject &&
<li><Trans>encryption_subject</Trans>: {subject}</li>
}
{issuer &&
<li><Trans>encryption_issuer</Trans>: {issuer}</li>
}
{not_after && not_after !== EMPTY_DATE &&
<li>
<Trans>encryption_expire</Trans>:
{format(not_after, 'YYYY-MM-DD HH:mm:ss')}
</li>
}
{dns_names &&
<li>
<Trans>encryption_hostnames</Trans>: {dns_names}
</li>
}
</ul> </s> remove <div>
{statusKey}
</div>
</s> add <p className={valid_key ? 'text-success' : 'text-danger'}>
{valid_key ?
<Trans values={{ type: key_type }}>
encryption_key_valid
</Trans>
: <Trans values={{ type: key_type }}>
encryption_key_invalid
</Trans>
}
</p> </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep replace keep keep keep keep replace replace replace | <mask> placeholder={t('encryption_certificates_input')}
<mask> />
<mask> <div className="form__status">
<mask> {statusCert &&
<mask> <Fragment>
<mask> <div className="form__label form__label--bold">
<mask> <Trans>encryption_status</Trans>:
<mask> </div>
<mask> <div>
<mask> {statusCert}
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove {statusKey &&
</s> add {privateKey && </s> remove <div>
{statusKey}
</div>
</s> add <p className={valid_key ? 'text-success' : 'text-danger'}>
{valid_key ?
<Trans values={{ type: key_type }}>
encryption_key_valid
</Trans>
: <Trans values={{ type: key_type }}>
encryption_key_invalid
</Trans>
}
</p> </s> remove {/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for
</Trans>
</div>
<div>
<Trans values={{ date: '2022-01-01' }}>
encryption_expire
</Trans>
</div> */}
</s> add </s> add onChange={handleChange}
disabled={!isEnabled} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep | <mask> {statusCert}
<mask> </div>
<mask> </Fragment>
<mask> }
<mask> {/* <div>
<mask> <Trans values={{ domains: '*.example.org, example.org' }}>
<mask> encryption_certificates_for
<mask> </Trans>
<mask> </div>
<mask> <div>
<mask> <Trans values={{ date: '2022-01-01' }}>
<mask> encryption_expire
<mask> </Trans>
<mask> </div> */}
<mask> </div>
<mask> </div>
<mask> </div>
<mask> </div>
<mask> <div className="row">
</s> Added validation on change and enable encryption checkbox </s> remove <div>
{statusKey}
</div>
</s> add <p className={valid_key ? 'text-success' : 'text-danger'}>
{valid_key ?
<Trans values={{ type: key_type }}>
encryption_key_valid
</Trans>
: <Trans values={{ type: key_type }}>
encryption_key_invalid
</Trans>
}
</p> </s> remove <div>
{statusCert}
</div>
</s> add <ul>
<li className={valid_chain ? 'text-success' : 'text-danger'}>
{valid_chain ?
<Trans>encryption_chain_valid</Trans>
: <Trans>encryption_chain_invalid</Trans>
}
</li>
{subject &&
<li><Trans>encryption_subject</Trans>: {subject}</li>
}
{issuer &&
<li><Trans>encryption_issuer</Trans>: {issuer}</li>
}
{not_after && not_after !== EMPTY_DATE &&
<li>
<Trans>encryption_expire</Trans>:
{format(not_after, 'YYYY-MM-DD HH:mm:ss')}
</li>
}
{dns_names &&
<li>
<Trans>encryption_hostnames</Trans>: {dns_names}
</li>
}
</ul> </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> remove {statusCert &&
</s> add {certificateChain && </s> add <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> </s> remove {statusKey &&
</s> add {privateKey && | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep | <mask> type="text"
<mask> className="form-control form-control--textarea"
<mask> placeholder="Copy/paste your PEM-encoded private key for your cerficate here."
<mask> />
<mask> <div className="form__status">
<mask> {privateKey &&
<mask> <Fragment>
</s> Added validation on change and enable encryption checkbox </s> remove {statusKey &&
</s> add {privateKey && </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove {statusCert &&
</s> add {certificateChain && </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", </s> add "encryption_enable": "Enable Encryption (HTTPS, DNS-over-HTTPS, and DNS-over-TLS)",
"encryption_enable_desc": "If encryption is enabled, AdGuard Home admin interface will work over HTTPS, and the DNS server will listen for requests over DNS-over-HTTPS and DNS-over-TLS.",
"encryption_chain_valid": "Certificate chain is valid",
"encryption_chain_invalid": "Certificate chain is invalid",
"encryption_key_valid": "This is a valid {{type}} private key",
"encryption_key_invalid": "This is an invalid {{type}} private key",
"encryption_subject": "Subject",
"encryption_issuer": "Issuer",
"encryption_hostnames": "Hostnames", </s> remove {isExpiringCertificate &&
<Topline type="warning">
<Trans components={[<a href="#settings" key="0">link</a>]}>
topline_expiring_certificate
</Trans>
</Topline>
</s> add {!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} /> | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep keep replace keep keep keep keep replace replace replace keep | <mask> className="form-control form-control--textarea"
<mask> placeholder="Copy/paste your PEM-encoded private key for your cerficate here."
<mask> />
<mask> <div className="form__status">
<mask> {statusKey &&
<mask> <Fragment>
<mask> <div className="form__label form__label--bold">
<mask> <Trans>encryption_status</Trans>:
<mask> </div>
<mask> <div>
<mask> {statusKey}
<mask> </div>
<mask> </Fragment>
</s> Added validation on change and enable encryption checkbox </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove {statusCert &&
</s> add {certificateChain && </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove <div>
{statusCert}
</div>
</s> add <ul>
<li className={valid_chain ? 'text-success' : 'text-danger'}>
{valid_chain ?
<Trans>encryption_chain_valid</Trans>
: <Trans>encryption_chain_invalid</Trans>
}
</li>
{subject &&
<li><Trans>encryption_subject</Trans>: {subject}</li>
}
{issuer &&
<li><Trans>encryption_issuer</Trans>: {issuer}</li>
}
{not_after && not_after !== EMPTY_DATE &&
<li>
<Trans>encryption_expire</Trans>:
{format(not_after, 'YYYY-MM-DD HH:mm:ss')}
</li>
}
{dns_names &&
<li>
<Trans>encryption_hostnames</Trans>: {dns_names}
</li>
}
</ul> </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep | <mask> </div>
<mask> </div>
<mask> </div>
<mask> </div>
<mask>
<mask> <div className="btn-list mt-2">
<mask> <button
</s> Added validation on change and enable encryption checkbox </s> remove <div className="btn-list">
</s> add <div className="btn-list mt-2"> </s> remove {/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for
</Trans>
</div>
<div>
<Trans values={{ date: '2022-01-01' }}>
encryption_expire
</Trans>
</div> */}
</s> add </s> add <div className="col-12">
<div className="form__group form__group--settings">
<Field
name="enabled"
type="checkbox"
component={renderSelectField}
placeholder={t('encryption_enable')}
onChange={handleChange}
/>
</div>
<div className="form__desc">
<Trans>encryption_enable_desc</Trans>
</div>
<hr/>
</div> </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove <div>
{statusKey}
</div>
</s> add <p className={valid_key ? 'text-success' : 'text-danger'}>
{valid_key ?
<Trans values={{ type: key_type }}>
encryption_key_valid
</Trans>
: <Trans values={{ type: key_type }}>
encryption_key_invalid
</Trans>
}
</p> </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep replace keep keep keep replace keep | <mask>
<mask> <div className="btn-list">
<mask> <button
<mask> type="submit"
<mask> className="btn btn-success btn-standart"
<mask> disabled={invalid || submitting || processing}
<mask> >
</s> Added validation on change and enable encryption checkbox </s> remove type="submit"
</s> add type="button" </s> add <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> remove statusCert={statusCert}
statusKey={statusKey}
</s> add </s> remove initialValues={{ ...values }}
</s> add initialValues={{
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
}} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep keep replace keep keep keep keep keep | <mask> >
<mask> <Trans>save_config</Trans>
<mask> </button>
<mask> <button
<mask> type="submit"
<mask> className="btn btn-secondary btn-standart"
<mask> disabled={submitting || processing}
<mask> onClick={reset}
<mask> >
<mask> <Trans>reset_settings</Trans>
</s> Added validation on change and enable encryption checkbox </s> remove disabled={invalid || submitting || processing}
</s> add disabled={
invalid
|| submitting
|| processing
|| !valid_chain
|| !valid_key
|| warning_validation
} </s> remove <div className="btn-list">
</s> add <div className="btn-list mt-2"> </s> remove statusCert={statusCert}
statusKey={statusKey}
</s> add </s> remove initialValues={{ ...values }}
</s> add initialValues={{
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
}} </s> add <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep add keep keep keep keep keep | <mask> Form.propTypes = {
<mask> handleSubmit: PropTypes.func.isRequired,
<mask> reset: PropTypes.func.isRequired,
<mask> submitting: PropTypes.bool.isRequired,
<mask> invalid: PropTypes.bool.isRequired,
<mask> initialValues: PropTypes.object.isRequired,
<mask> processing: PropTypes.bool.isRequired,
</s> Added validation on change and enable encryption checkbox </s> remove statusCert: PropTypes.string,
statusKey: PropTypes.string,
</s> add status_key: PropTypes.string,
not_after: PropTypes.string,
warning_validation: PropTypes.string,
valid_chain: PropTypes.bool,
valid_key: PropTypes.bool,
dns_names: PropTypes.string,
key_type: PropTypes.string,
issuer: PropTypes.string,
subject: PropTypes.string, </s> add validateTlsConfig: PropTypes.func.isRequired, </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> add import encryption from './encryption'; </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep keep replace replace keep keep keep keep keep | <mask> submitting: PropTypes.bool.isRequired,
<mask> invalid: PropTypes.bool.isRequired,
<mask> initialValues: PropTypes.object.isRequired,
<mask> processing: PropTypes.bool.isRequired,
<mask> statusCert: PropTypes.string,
<mask> statusKey: PropTypes.string,
<mask> t: PropTypes.func.isRequired,
<mask> };
<mask>
<mask> export default flow([
<mask> withNamespaces(),
</s> Added validation on change and enable encryption checkbox </s> add handleChange: PropTypes.func,
isEnabled: PropTypes.bool.isRequired,
certificateChain: PropTypes.string.isRequired,
privateKey: PropTypes.string.isRequired, </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> add validateTlsConfig: PropTypes.func.isRequired, </s> add validateTlsConfig, </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> add export const EMPTY_DATE = '0001-01-01T00:00:00Z'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep keep add keep keep keep keep | <mask> subject: PropTypes.string,
<mask> t: PropTypes.func.isRequired,
<mask> };
<mask>
<mask> export default flow([
<mask> withNamespaces(),
<mask> reduxForm({
<mask> form: 'encryptionForm',
</s> Added validation on change and enable encryption checkbox </s> remove statusCert: PropTypes.string,
statusKey: PropTypes.string,
</s> add status_key: PropTypes.string,
not_after: PropTypes.string,
warning_validation: PropTypes.string,
valid_chain: PropTypes.bool,
valid_key: PropTypes.bool,
dns_names: PropTypes.string,
key_type: PropTypes.string,
issuer: PropTypes.string,
subject: PropTypes.string, </s> add validateTlsConfig: PropTypes.func.isRequired, </s> add validateTlsConfig, </s> add export const EMPTY_DATE = '0001-01-01T00:00:00Z'; </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add handleChange: PropTypes.func,
isEnabled: PropTypes.bool.isRequired,
certificateChain: PropTypes.string.isRequired,
privateKey: PropTypes.string.isRequired, | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
keep keep add keep keep keep keep | <mask> import React, { Component } from 'react';
<mask> import PropTypes from 'prop-types';
<mask> import { withNamespaces } from 'react-i18next';
<mask>
<mask> import Form from './Form';
<mask> import Card from '../../ui/Card';
<mask>
</s> Added validation on change and enable encryption checkbox </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; </s> add import { connect } from 'react-redux'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import format from 'date-fns/format'; </s> add import EncryptionTopline from '../ui/EncryptionTopline'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
keep add keep keep keep keep | <mask> };
<mask>
<mask> render() {
<mask> const { encryption, t } = this.props;
<mask> const {
<mask> enabled,
</s> Added validation on change and enable encryption checkbox </s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> add const { isMenuOpen } = this.state; </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> remove const Form = (props) => {
</s> add let Form = (props) => { | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
keep keep keep keep replace replace replace replace replace keep keep keep keep keep | <mask>
<mask> render() {
<mask> const { encryption, t } = this.props;
<mask> const {
<mask> processing,
<mask> processingConfig,
<mask> status_cert: statusCert,
<mask> status_key: statusKey,
<mask> ...values
<mask> } = encryption;
<mask>
<mask> return (
<mask> <div className="encryption">
<mask> {encryption &&
</s> Added validation on change and enable encryption checkbox </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </s> add const { isMenuOpen } = this.state; </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add </s> add validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
keep keep replace keep replace replace keep keep keep | <mask> >
<mask> <Form
<mask> initialValues={{ ...values }}
<mask> processing={encryption.processingConfig}
<mask> statusCert={statusCert}
<mask> statusKey={statusKey}
<mask> onSubmit={this.handleFormSubmit}
<mask> />
<mask> </Card>
</s> Added validation on change and enable encryption checkbox </s> add onChange={this.handleFormChange}
{...this.props.encryption} </s> remove type="submit"
</s> add type="button" </s> remove <div className="btn-list">
</s> add <div className="btn-list mt-2"> </s> remove processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
</s> add enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, </s> remove disabled={invalid || submitting || processing}
</s> add disabled={
invalid
|| submitting
|| processing
|| !valid_chain
|| !valid_key
|| warning_validation
} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
keep add keep keep keep keep | <mask> processing={encryption.processingConfig}
<mask> onSubmit={this.handleFormSubmit}
<mask> />
<mask> </Card>
<mask> }
<mask> </div>
</s> Added validation on change and enable encryption checkbox </s> remove statusCert={statusCert}
statusKey={statusKey}
</s> add </s> remove initialValues={{ ...values }}
</s> add initialValues={{
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
}} </s> add onChange={handleChange}
disabled={!isEnabled} </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
keep add keep keep keep keep keep | <mask> Encryption.propTypes = {
<mask> setTlsConfig: PropTypes.func.isRequired,
<mask> encryption: PropTypes.object.isRequired,
<mask> t: PropTypes.func.isRequired,
<mask> };
<mask>
<mask> export default withNamespaces()(Encryption);
</s> Added validation on change and enable encryption checkbox </s> remove statusCert: PropTypes.string,
statusKey: PropTypes.string,
</s> add status_key: PropTypes.string,
not_after: PropTypes.string,
warning_validation: PropTypes.string,
valid_chain: PropTypes.bool,
valid_key: PropTypes.bool,
dns_names: PropTypes.string,
key_type: PropTypes.string,
issuer: PropTypes.string,
subject: PropTypes.string, </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> add handleChange: PropTypes.func,
isEnabled: PropTypes.bool.isRequired,
certificateChain: PropTypes.string.isRequired,
privateKey: PropTypes.string.isRequired, </s> add validateTlsConfig, </s> add export const EMPTY_DATE = '0001-01-01T00:00:00Z'; </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
keep add keep keep keep keep keep keep | <mask> encryption={this.props.encryption}
<mask> setTlsConfig={this.props.setTlsConfig}
<mask> />
<mask> <Dhcp
<mask> dhcp={this.props.dhcp}
<mask> toggleDhcp={this.props.toggleDhcp}
<mask> getDhcpStatus={this.props.getDhcpStatus}
<mask> findActiveDhcp={this.props.findActiveDhcp}
</s> Added validation on change and enable encryption checkbox </s> remove {isExpiringCertificate &&
<Topline type="warning">
<Trans components={[<a href="#settings" key="0">link</a>]}>
topline_expiring_certificate
</Trans>
</Topline>
</s> add {!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} /> </s> add onChange={this.handleFormChange}
{...this.props.encryption} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} </s> add onChange={handleChange}
disabled={!isEnabled} | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/index.js |
keep keep add keep keep keep keep | <mask> getDhcpInterfaces,
<mask> setDhcpConfig,
<mask> findActiveDhcp,
<mask> getTlsStatus,
<mask> setTlsConfig,
<mask> validateTlsConfig,
<mask> } from '../actions/encryption';
</s> Added validation on change and enable encryption checkbox </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; </s> add validateTlsConfig, </s> add import { connect } from 'react-redux'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> add import debounce from 'lodash/debounce'; </s> add import format from 'date-fns/format'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/containers/Settings.js |
keep keep keep keep replace keep keep keep keep keep | <mask> setDhcpConfig,
<mask> findActiveDhcp,
<mask> getTlsStatus,
<mask> setTlsConfig,
<mask> } from '../actions';
<mask> import Settings from '../components/Settings';
<mask>
<mask> const mapStateToProps = (state) => {
<mask> const {
<mask> settings,
</s> Added validation on change and enable encryption checkbox </s> add } from '../actions';
import { </s> add validateTlsConfig, </s> add import encryption from './encryption'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> add import format from 'date-fns/format'; </s> add import { connect } from 'react-redux'; | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/containers/Settings.js |
keep keep keep add keep keep keep keep keep | <mask> setDhcpConfig,
<mask> findActiveDhcp,
<mask> getTlsStatus,
<mask> setTlsConfig,
<mask> };
<mask>
<mask> export default connect(
<mask> mapStateToProps,
<mask> mapDispatchToProps,
</s> Added validation on change and enable encryption checkbox </s> add } from '../actions';
import { </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; </s> add validateTlsConfig: PropTypes.func.isRequired, </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> add export const EMPTY_DATE = '0001-01-01T00:00:00Z'; </s> remove statusCert: PropTypes.string,
statusKey: PropTypes.string,
</s> add status_key: PropTypes.string,
not_after: PropTypes.string,
warning_validation: PropTypes.string,
valid_chain: PropTypes.bool,
valid_key: PropTypes.bool,
dns_names: PropTypes.string,
key_type: PropTypes.string,
issuer: PropTypes.string,
subject: PropTypes.string, | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/containers/Settings.js |
keep keep keep add | <mask> };
<mask>
<mask> export const STANDARD_DNS_PORT = 53;
<mask> export const STANDARD_WEB_PORT = 80;
</s> Added validation on change and enable encryption checkbox </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
</s> add validateTlsConfig: PropTypes.func.isRequired, </s> add validateTlsConfig, </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> remove const Form = (props) => {
</s> add let Form = (props) => { | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/helpers/constants.js |
keep add keep keep keep keep keep | <mask> import * as actions from '../actions';
<mask> import toasts from './toasts';
<mask>
<mask> const settings = handleActions({
<mask> [actions.initSettingsRequest]: state => ({ ...state, processing: true }),
<mask> [actions.initSettingsFailure]: state => ({ ...state, processing: false }),
<mask> [actions.initSettingsSuccess]: (state, { payload }) => {
</s> Added validation on change and enable encryption checkbox </s> remove const encryption = handleActions({
[actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
[actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
[actions.getTlsStatusSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processing: false,
};
return newState;
},
[actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
[actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
[actions.setTlsConfigSuccess]: (state, { payload }) => {
const newState = {
...state,
...payload,
processingConfig: false,
};
return newState;
},
}, {
processing: true,
processingConfig: false,
status_cert: '',
status_key: '',
certificate_chain: '',
private_key: '',
server_name: '',
});
</s> add </s> remove isDropdownOpen: false,
</s> add </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; </s> add import { EMPTY_DATE } from '../../../helpers/constants'; </s> add import format from 'date-fns/format'; </s> add } from '../actions';
import { | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/reducers/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 replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep | <mask> active: null,
<mask> leases: [],
<mask> });
<mask>
<mask> const encryption = handleActions({
<mask> [actions.getTlsStatusRequest]: state => ({ ...state, processing: true }),
<mask> [actions.getTlsStatusFailure]: state => ({ ...state, processing: false }),
<mask> [actions.getTlsStatusSuccess]: (state, { payload }) => {
<mask> const newState = {
<mask> ...state,
<mask> ...payload,
<mask> processing: false,
<mask> };
<mask> return newState;
<mask> },
<mask>
<mask> [actions.setTlsConfigRequest]: state => ({ ...state, processingConfig: true }),
<mask> [actions.setTlsConfigFailure]: state => ({ ...state, processingConfig: false }),
<mask> [actions.setTlsConfigSuccess]: (state, { payload }) => {
<mask> const newState = {
<mask> ...state,
<mask> ...payload,
<mask> processingConfig: false,
<mask> };
<mask> return newState;
<mask> },
<mask> }, {
<mask> processing: true,
<mask> processingConfig: false,
<mask> status_cert: '',
<mask> status_key: '',
<mask> certificate_chain: '',
<mask> private_key: '',
<mask> server_name: '',
<mask> });
<mask>
<mask> export default combineReducers({
<mask> settings,
<mask> dashboard,
<mask> queryLogs,
<mask> filtering,
</s> Added validation on change and enable encryption checkbox </s> add import encryption from './encryption'; </s> remove isDropdownOpen: false,
</s> add </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> add validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
| https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/reducers/index.js |
keep keep keep keep replace keep keep keep keep keep | <mask>
<mask> var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"}
<mask>
<mask> type tlsConfigSettings struct {
<mask> Enabled bool `yaml:"enaled" json:"enabled"`
<mask> ServerName string `yaml:"server_name" json:"server_name,omitempty"`
<mask> ForceHTTPS bool `yaml:"force_https" json:"force_https,omitempty"`
<mask> PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"`
<mask> PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"`
<mask>
</s> Added validation on change and enable encryption checkbox </s> remove
export const getTlsStatusRequest = createAction('GET_TLS_STATUS_REQUEST');
export const getTlsStatusFailure = createAction('GET_TLS_STATUS_FAILURE');
export const getTlsStatusSuccess = createAction('GET_TLS_STATUS_SUCCESS');
export const getTlsStatus = () => async (dispatch) => {
dispatch(getTlsStatusRequest());
try {
const status = await apiClient.getTlsStatus();
status.certificate_chain = atob(status.certificate_chain);
status.private_key = atob(status.private_key);
dispatch(getTlsStatusSuccess(status));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(getTlsStatusFailure());
}
};
export const setTlsConfigRequest = createAction('SET_TLS_CONFIG_REQUEST');
export const setTlsConfigFailure = createAction('SET_TLS_CONFIG_FAILURE');
export const setTlsConfigSuccess = createAction('SET_TLS_CONFIG_SUCCESS');
export const setTlsConfig = config => async (dispatch) => {
dispatch(setTlsConfigRequest());
try {
const values = { ...config };
values.certificate_chain = btoa(values.certificate_chain);
values.private_key = btoa(values.private_key);
values.port_https = values.port_https || 0;
values.port_dns_over_tls = values.port_dns_over_tls || 0;
await apiClient.setTlsConfig(values);
dispatch(setTlsConfigSuccess(config));
dispatch(addSuccessToast('encryption_config_saved'));
dispatch(getTlsStatus());
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(setTlsConfigFailure());
}
};
</s> add </s> add TLS_VALIDATE = { path: 'tls/validate', method: 'POST' }; </s> add const { isMenuOpen } = this.state; </s> add handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
</s> remove const Form = (props) => {
</s> add let Form = (props) => { </s> add const selector = formValueSelector('encryptionForm');
Form = connect((state) => {
const isEnabled = selector(state, 'enabled');
const certificateChain = selector(state, 'certificate_chain');
const privateKey = selector(state, 'private_key');
return {
isEnabled,
certificateChain,
privateKey,
};
})(Form);
| https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | config.go |
keep add keep keep keep keep keep keep | <mask> // Checks filters updates if necessary
<mask> // If force is true, it ignores the filter.LastUpdated field value
<mask> func refreshFiltersIfNecessary(force bool) int {
<mask> var updateFilters []filter
<mask>
<mask> config.RLock()
<mask> for i := range config.Filters {
<mask> f := &config.Filters[i] // otherwise we will be operating on a copy
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove config.Lock()
</s> add var updateFilters []filter </s> remove // fetch URLs
updateCount := 0
</s> add config.RLock() </s> remove filter := &config.Filters[i] // otherwise we will be operating on a copy
</s> add f := &config.Filters[i] // otherwise we will be operating on a copy </s> remove if !filter.Enabled {
</s> add if !f.Enabled { </s> remove updated, err := filter.update()
</s> add var uf filter
uf.ID = f.ID
uf.URL = f.URL
uf.checksum = f.checksum
updateFilters = append(updateFilters, uf)
}
config.RUnlock()
updateCount := 0
for i := range updateFilters {
uf := &updateFilters[i]
updated, err := uf.update() </s> remove log.Printf("Failed to update filter %s: %s\n", filter.URL, err)
</s> add log.Printf("Failed to update filter %s: %s\n", uf.URL, err) | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep keep replace keep replace replace keep | <mask> // Checks filters updates if necessary
<mask> // If force is true, it ignores the filter.LastUpdated field value
<mask> func refreshFiltersIfNecessary(force bool) int {
<mask> config.Lock()
<mask>
<mask> // fetch URLs
<mask> updateCount := 0
<mask> for i := range config.Filters {
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> add //
// Algorithm:
// . Get the list of filters to be updated
// . For each filter run the download and checksum check operation
// . If filter data hasn't changed, set new update time
// . If filter data has changed, parse it, save it on disk, set new update time
// . Apply changes to the current configuration
// . Restart server </s> remove filter := &config.Filters[i] // otherwise we will be operating on a copy
</s> add f := &config.Filters[i] // otherwise we will be operating on a copy </s> remove if !filter.Enabled {
</s> add if !f.Enabled { </s> remove log.Printf("Failed to update filter %s: %s\n", filter.URL, err)
</s> add log.Printf("Failed to update filter %s: %s\n", uf.URL, err) </s> remove os.Chtimes(filter.Path(), mtime, mtime)
filter.LastUpdated = mtime
</s> add e := os.Chtimes(uf.Path(), mtime, mtime)
if e != nil {
log.Error("os.Chtimes(): %v", e)
}
uf.LastUpdated = mtime
}
config.Lock()
for k := range config.Filters {
f := &config.Filters[k]
if f.ID != uf.ID || f.URL != uf.URL {
continue
}
f.LastUpdated = uf.LastUpdated
if !updated {
continue
}
log.Info("Updated filter #%d. Rules: %d -> %d",
f.ID, f.RulesCount, uf.RulesCount)
f.Name = uf.Name
f.Rules = uf.Rules
f.RulesCount = uf.RulesCount
f.checksum = uf.checksum
updateCount++ | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep replace keep replace keep keep | <mask> updateCount := 0
<mask> for i := range config.Filters {
<mask> filter := &config.Filters[i] // otherwise we will be operating on a copy
<mask>
<mask> if !filter.Enabled {
<mask> continue
<mask> }
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove // fetch URLs
updateCount := 0
</s> add config.RLock() </s> remove config.Lock()
</s> add var updateFilters []filter </s> add //
// Algorithm:
// . Get the list of filters to be updated
// . For each filter run the download and checksum check operation
// . If filter data hasn't changed, set new update time
// . If filter data has changed, parse it, save it on disk, set new update time
// . Apply changes to the current configuration
// . Restart server </s> remove updated, err := filter.update()
</s> add var uf filter
uf.ID = f.ID
uf.URL = f.URL
uf.checksum = f.checksum
updateFilters = append(updateFilters, uf)
}
config.RUnlock()
updateCount := 0
for i := range updateFilters {
uf := &updateFilters[i]
updated, err := uf.update() </s> remove if !force && time.Since(filter.LastUpdated) <= updatePeriod {
</s> add if !force && time.Since(f.LastUpdated) <= updatePeriod { | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep keep replace keep keep keep replace keep | <mask> continue
<mask> }
<mask>
<mask> if !force && time.Since(filter.LastUpdated) <= updatePeriod {
<mask> continue
<mask> }
<mask>
<mask> updated, err := filter.update()
<mask> if err != nil {
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove if !filter.Enabled {
</s> add if !f.Enabled { </s> remove log.Printf("Failed to update filter %s: %s\n", filter.URL, err)
</s> add log.Printf("Failed to update filter %s: %s\n", uf.URL, err) </s> remove os.Chtimes(filter.Path(), mtime, mtime)
filter.LastUpdated = mtime
</s> add e := os.Chtimes(uf.Path(), mtime, mtime)
if e != nil {
log.Error("os.Chtimes(): %v", e)
}
uf.LastUpdated = mtime
}
config.Lock()
for k := range config.Filters {
f := &config.Filters[k]
if f.ID != uf.ID || f.URL != uf.URL {
continue
}
f.LastUpdated = uf.LastUpdated
if !updated {
continue
}
log.Info("Updated filter #%d. Rules: %d -> %d",
f.ID, f.RulesCount, uf.RulesCount)
f.Name = uf.Name
f.Rules = uf.Rules
f.RulesCount = uf.RulesCount
f.checksum = uf.checksum
updateCount++ </s> remove err = filter.save()
</s> add err = uf.save() </s> add config.Unlock() | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep keep replace keep keep keep keep replace keep keep keep keep | <mask>
<mask> updated, err := filter.update()
<mask> if err != nil {
<mask> log.Printf("Failed to update filter %s: %s\n", filter.URL, err)
<mask> continue
<mask> }
<mask> if updated {
<mask> // Saving it to the filters dir now
<mask> err = filter.save()
<mask> if err != nil {
<mask> log.Printf("Failed to save the updated filter %d: %s", filter.ID, err)
<mask> continue
<mask> }
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove log.Printf("Failed to save the updated filter %d: %s", filter.ID, err)
</s> add log.Printf("Failed to save the updated filter %d: %s", uf.ID, err) </s> remove updated, err := filter.update()
</s> add var uf filter
uf.ID = f.ID
uf.URL = f.URL
uf.checksum = f.checksum
updateFilters = append(updateFilters, uf)
}
config.RUnlock()
updateCount := 0
for i := range updateFilters {
uf := &updateFilters[i]
updated, err := uf.update() </s> remove updateCount++
</s> add </s> remove if !force && time.Since(filter.LastUpdated) <= updatePeriod {
</s> add if !force && time.Since(f.LastUpdated) <= updatePeriod { </s> remove os.Chtimes(filter.Path(), mtime, mtime)
filter.LastUpdated = mtime
</s> add e := os.Chtimes(uf.Path(), mtime, mtime)
if e != nil {
log.Error("os.Chtimes(): %v", e)
}
uf.LastUpdated = mtime
}
config.Lock()
for k := range config.Filters {
f := &config.Filters[k]
if f.ID != uf.ID || f.URL != uf.URL {
continue
}
f.LastUpdated = uf.LastUpdated
if !updated {
continue
}
log.Info("Updated filter #%d. Rules: %d -> %d",
f.ID, f.RulesCount, uf.RulesCount)
f.Name = uf.Name
f.Rules = uf.Rules
f.RulesCount = uf.RulesCount
f.checksum = uf.checksum
updateCount++ | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep keep keep replace keep keep keep replace replace keep keep | <mask> if updated {
<mask> // Saving it to the filters dir now
<mask> err = filter.save()
<mask> if err != nil {
<mask> log.Printf("Failed to save the updated filter %d: %s", filter.ID, err)
<mask> continue
<mask> }
<mask>
<mask> updateCount++
<mask>
<mask> } else {
<mask> mtime := time.Now()
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove err = filter.save()
</s> add err = uf.save() </s> remove log.Printf("Failed to update filter %s: %s\n", filter.URL, err)
</s> add log.Printf("Failed to update filter %s: %s\n", uf.URL, err) </s> remove os.Chtimes(filter.Path(), mtime, mtime)
filter.LastUpdated = mtime
</s> add e := os.Chtimes(uf.Path(), mtime, mtime)
if e != nil {
log.Error("os.Chtimes(): %v", e)
}
uf.LastUpdated = mtime
}
config.Lock()
for k := range config.Filters {
f := &config.Filters[k]
if f.ID != uf.ID || f.URL != uf.URL {
continue
}
f.LastUpdated = uf.LastUpdated
if !updated {
continue
}
log.Info("Updated filter #%d. Rules: %d -> %d",
f.ID, f.RulesCount, uf.RulesCount)
f.Name = uf.Name
f.Rules = uf.Rules
f.RulesCount = uf.RulesCount
f.checksum = uf.checksum
updateCount++ </s> remove config.Unlock()
</s> add </s> remove updated, err := filter.update()
</s> add var uf filter
uf.ID = f.ID
uf.URL = f.URL
uf.checksum = f.checksum
updateFilters = append(updateFilters, uf)
}
config.RUnlock()
updateCount := 0
for i := range updateFilters {
uf := &updateFilters[i]
updated, err := uf.update() | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep keep keep replace replace keep keep keep keep keep | <mask> updateCount++
<mask>
<mask> } else {
<mask> mtime := time.Now()
<mask> os.Chtimes(filter.Path(), mtime, mtime)
<mask> filter.LastUpdated = mtime
<mask> }
<mask> }
<mask> config.Unlock()
<mask>
<mask> if updateCount > 0 && isRunning() {
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove updateCount++
</s> add </s> remove config.Unlock()
</s> add </s> add config.Unlock() </s> remove updated, err := filter.update()
</s> add var uf filter
uf.ID = f.ID
uf.URL = f.URL
uf.checksum = f.checksum
updateFilters = append(updateFilters, uf)
}
config.RUnlock()
updateCount := 0
for i := range updateFilters {
uf := &updateFilters[i]
updated, err := uf.update() </s> remove if !filter.Enabled {
</s> add if !f.Enabled { </s> remove if !force && time.Since(filter.LastUpdated) <= updatePeriod {
</s> add if !force && time.Since(f.LastUpdated) <= updatePeriod { | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
keep keep add keep keep keep keep keep keep | <mask> f.checksum = uf.checksum
<mask> updateCount++
<mask> }
<mask> }
<mask>
<mask> if updateCount > 0 && isRunning() {
<mask> err := reconfigureDNSServer()
<mask> if err != nil {
<mask> msg := fmt.Sprintf("SHOULD NOT HAPPEN: cannot reconfigure DNS server with the new filters: %s", err)
</s> * filters: rework update mechanism so that UI doesn't get locked while update is in progress </s> remove config.Unlock()
</s> add </s> remove os.Chtimes(filter.Path(), mtime, mtime)
filter.LastUpdated = mtime
</s> add e := os.Chtimes(uf.Path(), mtime, mtime)
if e != nil {
log.Error("os.Chtimes(): %v", e)
}
uf.LastUpdated = mtime
}
config.Lock()
for k := range config.Filters {
f := &config.Filters[k]
if f.ID != uf.ID || f.URL != uf.URL {
continue
}
f.LastUpdated = uf.LastUpdated
if !updated {
continue
}
log.Info("Updated filter #%d. Rules: %d -> %d",
f.ID, f.RulesCount, uf.RulesCount)
f.Name = uf.Name
f.Rules = uf.Rules
f.RulesCount = uf.RulesCount
f.checksum = uf.checksum
updateCount++ </s> remove updated, err := filter.update()
</s> add var uf filter
uf.ID = f.ID
uf.URL = f.URL
uf.checksum = f.checksum
updateFilters = append(updateFilters, uf)
}
config.RUnlock()
updateCount := 0
for i := range updateFilters {
uf := &updateFilters[i]
updated, err := uf.update() </s> remove log.Printf("Failed to save the updated filter %d: %s", filter.ID, err)
</s> add log.Printf("Failed to save the updated filter %d: %s", uf.ID, err) </s> remove if !force && time.Since(filter.LastUpdated) <= updatePeriod {
</s> add if !force && time.Since(f.LastUpdated) <= updatePeriod { </s> remove updateCount++
</s> add | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
Subsets and Splits