code_before
stringlengths 16
1.81M
| edits
stringlengths 4
328k
| next_edit
stringlengths 0
76.5k
| code_after
stringlengths 3
49.9M
| label_window
sequencelengths 4
1.81k
| instruction
stringlengths 20
51.9k
| html_url
stringlengths 74
116
| file_name
stringlengths 3
311
|
---|---|---|---|---|---|---|---|
honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw=
mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ=
mvdan.cc/unparam v0.0.0-20220926085101-66de63301820 h1:fggBTMFbBz7CMny3mWZphe0B/6D8ILBunvvB1cNNHi8=
mvdan.cc/unparam v0.0.0-20220926085101-66de63301820/go.mod h1:7fKhD/gH+APJ9Y27S2PYO7+oVWtb3XPrw9W5ayxVq2A=
| </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= | mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95 h1:n/xhncJPSt0YzfOhnyn41XxUdrWQNgmLBG72FE27Fqw=
mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95/go.mod h1:2vU506e8nGWodqcci641NLi4im2twWSq4Lod756epHQ= | honnef.co/go/tools v0.3.3 h1:oDx7VAwstgpYpb3wv0oxiZlxY+foCpRAwY7Vk6XpAgA=
honnef.co/go/tools v0.3.3/go.mod h1:jzwdWgg7Jdq75wlfblQxO4neNaFFSvgc1tD5Wv8U0Yw=
mvdan.cc/gofumpt v0.4.0 h1:JVf4NN1mIpHogBj7ABpgOyZc65/UUOkKQFkoURsz4MM=
mvdan.cc/gofumpt v0.4.0/go.mod h1:PljLOHDeZqgS8opHRKLzp2It2VBuSdteAgqUfzMTxlQ=
mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95 h1:n/xhncJPSt0YzfOhnyn41XxUdrWQNgmLBG72FE27Fqw=
mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95/go.mod h1:2vU506e8nGWodqcci641NLi4im2twWSq4Lod756epHQ=
mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95 h1:n/xhncJPSt0YzfOhnyn41XxUdrWQNgmLBG72FE27Fqw=
mvdan.cc/unparam v0.0.0-20230125043941-70a0ce6e7b95/go.mod h1:2vU506e8nGWodqcci641NLi4im2twWSq4Lod756epHQ= | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/04f49933854f315857abd572c0dc45473c2fae0d | internal/tools/go.sum |
log.Debug("Querylog: msg.Unpack(entry.OrigAnswer): %s: %s", err, string(entry.OrigAnswer))
}
}
return jsonEntry
}
func answerToMap(a *dns.Msg) []map[string]interface{} {
if a == nil || len(a.Answer) == 0 {
| </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> remove return false
case ctClient:
</s> add | jsonEntry["upstream"] = entry.Upstream
| log.Debug("Querylog: msg.Unpack(entry.OrigAnswer): %s: %s", err, string(entry.OrigAnswer))
}
}
jsonEntry["upstream"] = entry.Upstream
return jsonEntry
}
func answerToMap(a *dns.Msg) []map[string]interface{} {
if a == nil || len(a.Answer) == 0 { | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/json.go |
if getDoubleQuotesEnclosedValue(&c.value) {
c.strict = true
}
if ct == ctClient && l.conf.AnonymizeClientIP {
c.value = l.getClientIP(c.value)
}
if ct == ctFilteringStatus && !util.ContainsString(filteringStatusValues, c.value) {
return false, c, fmt.Errorf("invalid value %s", c.value)
}
return true, c, nil
| </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> remove "filter_domain": ctDomain,
"filter_client": ctClient,
"filter_question_type": ctQuestionType,
"filter_response_status": ctFilteringStatus,
</s> add "search": ctDomainOrClient,
"response_status": ctFilteringStatus, | if getDoubleQuotesEnclosedValue(&c.value) {
c.strict = true
}
if ct == ctFilteringStatus && !util.ContainsString(filteringStatusValues, c.value) {
return false, c, fmt.Errorf("invalid value %s", c.value)
}
return true, c, nil | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_http.go |
|
p.maxFileScanEntries = 0
}
paramNames := map[string]criteriaType{
"filter_domain": ctDomain,
"filter_client": ctClient,
"filter_question_type": ctQuestionType,
"filter_response_status": ctFilteringStatus,
}
for k, v := range paramNames {
ok, c, err := l.parseSearchCriteria(q, k, v)
if err != nil {
| </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> 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") | "search": ctDomainOrClient,
"response_status": ctFilteringStatus, | p.maxFileScanEntries = 0
}
paramNames := map[string]criteriaType{
"search": ctDomainOrClient,
"response_status": ctFilteringStatus,
"search": ctDomainOrClient,
"response_status": ctFilteringStatus,
"search": ctDomainOrClient,
"response_status": ctFilteringStatus,
"search": ctDomainOrClient,
"response_status": ctFilteringStatus,
}
for k, v := range paramNames {
ok, c, err := l.parseSearchCriteria(q, k, v)
if err != nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_http.go |
// search by domain (strict)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctDomain,
strict: true,
value: "test.example.org",
})
entries, _ = l.search(params)
assert.Equal(t, 1, len(entries))
| </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 | criteriaType: ctDomainOrClient, |
// search by domain (strict)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctDomainOrClient,
strict: true,
value: "test.example.org",
})
entries, _ = l.search(params)
assert.Equal(t, 1, len(entries)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
// search by domain (not strict)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctDomain,
strict: false,
value: "example.org",
})
entries, _ = l.search(params)
assert.Equal(t, 3, len(entries))
| </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 | criteriaType: ctDomainOrClient, |
// search by domain (not strict)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctDomainOrClient,
strict: false,
value: "example.org",
})
entries, _ = l.search(params)
assert.Equal(t, 3, len(entries)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
// search by client IP (strict)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctClient,
strict: true,
value: "2.2.2.2",
})
entries, _ = l.search(params)
assert.Equal(t, 1, len(entries))
| </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 | criteriaType: ctDomainOrClient, |
// search by client IP (strict)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctDomainOrClient,
strict: true,
value: "2.2.2.2",
})
entries, _ = l.search(params)
assert.Equal(t, 1, len(entries)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
// search by client IP (part of)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctClient,
strict: false,
value: "2.2.2",
})
entries, _ = l.search(params)
assert.Equal(t, 4, len(entries))
| </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 | criteriaType: ctDomainOrClient, |
// search by client IP (part of)
params = newSearchParams()
params.searchCriteria = append(params.searchCriteria, searchCriteria{
criteriaType: ctDomainOrClient,
strict: false,
value: "2.2.2",
})
entries, _ = l.search(params)
assert.Equal(t, 4, len(entries)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/qlog_test.go |
type criteriaType int
const (
ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
ctFilteringStatus // filtering status
)
const (
filteringStatusAll = "all"
| </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, | ctDomainOrClient criteriaType = iota // domain name or client IP address |
type criteriaType int
const (
ctDomainOrClient criteriaType = iota // domain name or client IP address
ctDomainOrClient criteriaType = iota // domain name or client IP address
ctDomainOrClient criteriaType = iota // domain name or client IP address
ctFilteringStatus // filtering status
)
const (
filteringStatusAll = "all" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
filteringStatusBlockedParental = "blocked_parental" // blocked by parental control
filteringStatusWhitelisted = "whitelisted" // whitelisted
filteringStatusRewritten = "rewritten" // all kinds of rewrites
filteringStatusSafeSearch = "safe_search" // enforced safe search
)
// filteringStatusValues -- array with all possible filteringStatus values
var filteringStatusValues = []string{
filteringStatusAll, filteringStatusFiltered, filteringStatusBlocked,
| </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, | filteringStatusProcessed = "processed" // not blocked, not white-listed entries | filteringStatusBlockedParental = "blocked_parental" // blocked by parental control
filteringStatusWhitelisted = "whitelisted" // whitelisted
filteringStatusRewritten = "rewritten" // all kinds of rewrites
filteringStatusSafeSearch = "safe_search" // enforced safe search
filteringStatusProcessed = "processed" // not blocked, not white-listed entries
)
// filteringStatusValues -- array with all possible filteringStatus values
var filteringStatusValues = []string{
filteringStatusAll, filteringStatusFiltered, filteringStatusBlocked, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
filteringStatusBlockedSafebrowsing, filteringStatusBlockedParental,
filteringStatusWhitelisted, filteringStatusRewritten, filteringStatusSafeSearch,
}
// searchCriteria - every search request may contain a list of different search criteria
// we use each of them to match the query
| </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> remove ctDomain criteriaType = iota // domain name
ctClient // client IP address
ctQuestionType // question type
</s> add ctDomainOrClient criteriaType = iota // domain name or client IP address | filteringStatusProcessed, | filteringStatusBlockedSafebrowsing, filteringStatusBlockedParental,
filteringStatusWhitelisted, filteringStatusRewritten, filteringStatusSafeSearch,
filteringStatusProcessed,
}
// searchCriteria - every search request may contain a list of different search criteria
// we use each of them to match the query | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
func (c *searchCriteria) quickMatch(line string) bool {
// note that we do this only for a limited set of criteria
switch c.criteriaType {
case ctDomain:
return c.quickMatchJSONValue(line, "QH")
case ctClient:
return c.quickMatchJSONValue(line, "IP")
case ctQuestionType:
return c.quickMatchJSONValue(line, "QT")
default:
return true
}
}
| </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> remove return false
case ctClient:
</s> add | case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP") | func (c *searchCriteria) quickMatch(line string) bool {
// note that we do this only for a limited set of criteria
switch c.criteriaType {
case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP")
case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP")
case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP")
case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP")
case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP")
case ctDomainOrClient:
return c.quickMatchJSONValue(line, "QH") ||
c.quickMatchJSONValue(line, "IP")
default:
return true
}
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
// match - checks if the log entry matches this search criteria
// nolint (gocyclo)
func (c *searchCriteria) match(entry *logEntry) bool {
switch c.criteriaType {
case ctDomain:
if c.strict && entry.QHost == c.value {
return true
}
if !c.strict && strings.Contains(entry.QHost, c.value) {
return true
| </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 | case ctDomainOrClient: | // match - checks if the log entry matches this search criteria
// nolint (gocyclo)
func (c *searchCriteria) match(entry *logEntry) bool {
switch c.criteriaType {
case ctDomainOrClient:
if c.strict && entry.QHost == c.value {
return true
}
if !c.strict && strings.Contains(entry.QHost, c.value) {
return true | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
}
if !c.strict && strings.Contains(entry.QHost, c.value) {
return true
}
return false
case ctClient:
if c.strict && entry.IP == c.value {
return true
}
if !c.strict && strings.Contains(entry.IP, c.value) {
return true
| </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 | }
if !c.strict && strings.Contains(entry.QHost, c.value) {
return true
}
if c.strict && entry.IP == c.value {
return true
}
if !c.strict && strings.Contains(entry.IP, c.value) {
return true | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
|
if !c.strict && strings.Contains(entry.IP, c.value) {
return true
}
return false
case ctQuestionType:
if c.strict && entry.QType == c.value {
return true
}
if !c.strict && strings.Contains(entry.QType, c.value) {
return true
}
case ctFilteringStatus:
res := entry.Result
switch c.value {
case filteringStatusAll:
| </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") | if !c.strict && strings.Contains(entry.IP, c.value) {
return true
}
return false
case ctFilteringStatus:
res := entry.Result
switch c.value {
case filteringStatusAll: | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
|
case filteringStatusSafeSearch:
return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
default:
return false
}
}
return false
| </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: | case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
| case filteringStatusSafeSearch:
return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
case filteringStatusProcessed:
return !(res.Reason == dnsfilter.FilteredBlackList ||
res.Reason == dnsfilter.FilteredBlockedService ||
res.Reason == dnsfilter.NotFilteredWhiteList)
default:
return false
}
}
return false | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
default:
return false
}
default:
return false
}
return false
}
| </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 | return res.IsFiltered && res.Reason == dnsfilter.FilteredSafeSearch
default:
return false
}
}
return false
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep"
] | + new query logs API
+ "upstream"
+ filteringStatusProcessed
+ ctDomainOrClient
remove ctQuestionType, ctDomain, ctClient | https://github.com/AdguardTeam/AdGuardHome/commit/0500aa9591d1fb52f24182734859c398203d6962 | querylog/search_criteria.go |
|
setModalOpened(false);
}
};
const blockButton = <button
className={classNames('title--border text-center button-action--arrow-option', { 'bg--danger': !isBlocked })}
onClick={onToggleBlock}>
{t(buttonType)}
</button>;
const blockForClientButton = <button
className='text-center font-weight-bold py-2 button-action--arrow-option'
onClick={onBlockingForClientClick}>
{t(blockingForClientKey)}
| </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); | 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>
</>
); | setModalOpened(false);
}
};
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>
</>
);
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>
</>
);
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>
</>
);
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>
</>
);
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>
</>
);
const blockForClientButton = <button
className='text-center font-weight-bold py-2 button-action--arrow-option'
onClick={onBlockingForClientClick}>
{t(blockingForClientKey)} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Cells/index.js |
.custom-select--logs {
padding: 0.5rem 0.75rem 0.5rem 2rem !important;
}
.bg--danger {
color: var(--danger) !important;
}
.form-control--search {
box-shadow: 0 1px 0 #ddd;
padding: 0 2.5rem;
height: 2.25rem;
flex-grow: 1;
| </s> remove cursor: pointer;
</s> add | .custom-select--logs {
padding: 0.5rem 0.75rem 0.5rem 2rem !important;
}
.form-control--search {
box-shadow: 0 1px 0 #ddd;
padding: 0 2.5rem;
height: 2.25rem;
flex-grow: 1; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
|
height: 1.6rem;
}
.button-action__container--detailed {
bottom: 1.3rem;
}
.button-action {
outline: 0 !important;
| </s> remove .bg--danger {
color: var(--danger) !important;
}
</s> add </s> remove cursor: pointer;
</s> add | @media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
| height: 1.6rem;
}
@media screen and (max-width: 1024px) {
.button-action__container {
display: none;
}
}
.button-action__container--detailed {
bottom: 1.3rem;
}
.button-action {
outline: 0 !important; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
background: transparent;
border: 0;
display: block;
width: 100%;
text-align: left;
color: inherit;
}
.button-action--arrow-option:disabled {
display: none;
| </s> remove cursor: pointer;
</s> add | padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; | background: transparent;
border: 0;
display: block;
width: 100%;
padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700;
color: inherit;
}
.button-action--arrow-option:disabled {
display: none; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700;
color: inherit;
}
.button-action--arrow-option:disabled {
display: none;
| </s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; </s> remove cursor: pointer;
</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; | padding-bottom: 0.5rem;
text-align: center;
font-weight: 700;
color: inherit;
cursor: pointer;
}
.button-action--arrow-option:hover,
.button-action--arrow-option:focus {
outline: none;
}
.button-action--arrow-option:focus-visible {
outline: 2px solid #295a9f;
}
.button-action--arrow-option:disabled {
display: none; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
display: none;
}
.tooltip-custom__container .button-action--arrow-option:not(:disabled):hover {
background: var(--gray-f3);
overflow: hidden;
}
| </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; | .tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
| display: none;
}
.tooltip-custom__container .button-action--arrow-option {
padding-bottom: 0;
text-align: left;
font-weight: 400;
}
.tooltip-custom__container .button-action--arrow-option:not(:disabled):hover {
background: var(--gray-f3);
overflow: hidden;
}
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
display: none;
}
.tooltip-custom__container .button-action--arrow-option:not(:disabled):hover {
cursor: pointer;
background: var(--gray-f3);
overflow: hidden;
}
.button-action--arrow-option-container {
| </s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; | display: none;
}
.tooltip-custom__container .button-action--arrow-option:not(:disabled):hover {
background: var(--gray-f3);
overflow: hidden;
}
.button-action--arrow-option-container { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
|
font-style: italic;
font-weight: normal;
margin-bottom: 1rem;
}
| </s> remove text-align: left;
</s> add padding-top: 0.5rem;
padding-bottom: 0.5rem;
text-align: center;
font-weight: 700; </s> remove cursor: pointer;
</s> add | .bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} | font-style: italic;
font-weight: normal;
margin-bottom: 1rem;
}
.bg--danger {
color: var(--danger);
}
.bg--green {
color: var(--green79);
} | [
"keep",
"keep",
"keep",
"add"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/Logs.css |
import queryString from 'query-string';
import classNames from 'classnames';
import {
BLOCK_ACTIONS,
SMALL_SCREEN_SIZE,
} from '../../helpers/constants';
import Loading from '../ui/Loading';
import Filters from './Filters';
import Disabled from './Disabled';
import { getFilteringStatus } from '../../actions/filtering';
| </s> remove cursor: pointer;
</s> add | MEDIUM_SCREEN_SIZE, | import queryString from 'query-string';
import classNames from 'classnames';
import {
BLOCK_ACTIONS,
MEDIUM_SCREEN_SIZE,
} from '../../helpers/constants';
import Loading from '../ui/Loading';
import Filters from './Filters';
import Disabled from './Disabled';
import { getFilteringStatus } from '../../actions/filtering'; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/index.js |
const search = search_url_param || filter?.search || '';
const response_status = response_status_url_param || filter?.response_status || '';
const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth < SMALL_SCREEN_SIZE);
const [detailedDataCurrent, setDetailedDataCurrent] = useState({});
const [buttonType, setButtonType] = useState(BLOCK_ACTIONS.BLOCK);
const [isModalOpened, setModalOpened] = useState(false);
const [isLoading, setIsLoading] = useState(false);
| </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, | const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= MEDIUM_SCREEN_SIZE); |
const search = search_url_param || filter?.search || '';
const response_status = response_status_url_param || filter?.response_status || '';
const [isSmallScreen, setIsSmallScreen] = useState(window.innerWidth <= MEDIUM_SCREEN_SIZE);
const [detailedDataCurrent, setDetailedDataCurrent] = useState({});
const [buttonType, setButtonType] = useState(BLOCK_ACTIONS.BLOCK);
const [isModalOpened, setModalOpened] = useState(false);
const [isLoading, setIsLoading] = useState(false);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/index.js |
setIsLoading(false);
})();
}, [response_status, search]);
const mediaQuery = window.matchMedia(`(max-width: ${SMALL_SCREEN_SIZE}px)`);
const mediaQueryHandler = (e) => {
setIsSmallScreen(e.matches);
if (e.matches) {
dispatch(toggleDetailedLogs(false));
}
| </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); | const mediaQuery = window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`); | setIsLoading(false);
})();
}, [response_status, search]);
const mediaQuery = window.matchMedia(`(max-width: ${MEDIUM_SCREEN_SIZE}px)`);
const mediaQueryHandler = (e) => {
setIsSmallScreen(e.matches);
if (e.matches) {
dispatch(toggleDetailedLogs(false));
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/components/Logs/index.js |
...DHCP_FORM_NAMES,
};
export const SMALL_SCREEN_SIZE = 767;
export const MEDIUM_SCREEN_SIZE = 1023;
export const SECONDS_IN_DAY = 60 * 60 * 24;
export const UINT32_RANGE = {
MIN: 0,
| </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> remove cursor: pointer;
</s> add | export const MEDIUM_SCREEN_SIZE = 1024; | ...DHCP_FORM_NAMES,
};
export const SMALL_SCREEN_SIZE = 767;
export const MEDIUM_SCREEN_SIZE = 1024;
export const SECONDS_IN_DAY = 60 * 60 * 24;
export const UINT32_RANGE = {
MIN: 0, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/053bb72a004df5f0eaaef827ee08c78af312fbf8 | client/src/helpers/constants.js |
className="btn btn-icon btn-outline-primary btn-sm"
title={t('refresh_btn')}
onClick={() => getAllStats()}
>
<svg className="icons">
<use xlinkHref="#refresh" />
</svg>
</button>;
const statsProcessing = stats.processingStats
| </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"> | <svg className="icons icon12"> | className="btn btn-icon btn-outline-primary btn-sm"
title={t('refresh_btn')}
onClick={() => getAllStats()}
>
<svg className="icons icon12">
<use xlinkHref="#refresh" />
</svg>
</button>;
const statsProcessing = stats.processingStats | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Dashboard/index.js |
url,
})
}
>
<svg className="icons">
<use xlinkHref="#edit" />
</svg>
</button>
<button
type="button"
| </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"> | <svg className="icons icon12"> | url,
})
}
>
<svg className="icons icon12">
<use xlinkHref="#edit" />
</svg>
</button>
<button
type="button" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Filters/Table.js |
className="btn btn-icon btn-outline-secondary btn-sm"
onClick={() => handleDelete(url)}
title={t('delete_table_action')}
>
<svg className="icons">
<use xlinkHref="#delete" />
</svg>
</button>
</div>
);
| </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"> | <svg className="icons icon12"> | className="btn btn-icon btn-outline-secondary btn-sm"
onClick={() => handleDelete(url)}
title={t('delete_table_action')}
>
<svg className="icons icon12">
<use xlinkHref="#delete" />
</svg>
</button>
</div>
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Filters/Table.js |
</button>
{content && (
<button className={buttonArrowClass} disabled={processingRules}>
<IconTooltip
className="h-100"
tooltipClass="button-action--arrow-option-container"
xlinkHref="chevron-down"
triggerClass="button-action--icon"
content={content}
placement="bottom-end"
| </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"> | className="icon24" | </button>
{content && (
<button className={buttonArrowClass} disabled={processingRules}>
<IconTooltip
className="icon24"
tooltipClass="button-action--arrow-option-container"
xlinkHref="chevron-down"
triggerClass="button-action--icon"
content={content}
placement="bottom-end" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Logs/Cells/ClientCell.js |
max-height: 100% !important;
}
.cursor--pointer {
cursor: pointer;
}
.custom-select__arrow--left {
| </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"> | .icon24 {
width: 24px;
height: 24px;
}
.icon12 {
width: 12px;
height: 12px;
}
| max-height: 100% !important;
}
.icon24 {
width: 24px;
height: 24px;
}
.icon12 {
width: 12px;
height: 12px;
}
.cursor--pointer {
cursor: pointer;
}
.custom-select__arrow--left { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Logs/Logs.css |
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
}
.button-action:active {
background: var(--btn-block-active);
}
| </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"> | width: 100%;
height: 100%;
display: flex;
justify-content: center;
}
.button-action:active {
background: var(--btn-block-active);
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Logs/Logs.css |
|
}
disabled={processingUpdating}
title={t('edit_table_action')}
>
<svg className="icons">
<use xlinkHref="#edit" />
</svg>
</button>
<button
type="button"
| </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"> | <svg className="icons icon12"> | }
disabled={processingUpdating}
title={t('edit_table_action')}
>
<svg className="icons icon12">
<use xlinkHref="#edit" />
</svg>
</button>
<button
type="button" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Settings/Clients/ClientsTable/ClientsTable.js |
onClick={() => handleDelete({ name: clientName })}
disabled={processingDeleting}
title={t('delete_table_action')}
>
<svg className="icons">
<use xlinkHref="#delete" />
</svg>
</button>
</div>
);
| </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"> | <svg className="icons icon12"> | onClick={() => handleDelete({ name: clientName })}
disabled={processingDeleting}
title={t('delete_table_action')}
>
<svg className="icons icon12">
<use xlinkHref="#delete" />
</svg>
</button>
</div>
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/Settings/Clients/ClientsTable/ClientsTable.js |
<path
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" />
</symbol>
<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" />
</symbol>
<symbol id="dns_privacy" viewBox="0 0 30 30" stroke="none" fill="currentColor"
strokeLinecap="round" strokeLinejoin="round">
<path
| </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"> | <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> | <path
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" />
</symbol>
<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>
<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>
<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>
<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>
</symbol>
<symbol id="dns_privacy" viewBox="0 0 30 30" stroke="none" fill="currentColor"
strokeLinecap="round" strokeLinejoin="round">
<path | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/ui/Icons.js |
<path d="M60 54.5h8v40h-8zM60 35.5h8v8h-8z" />
</svg>
</symbol>
<symbol id="chevron-down" viewBox="0 0 24 24">
<g fill="none" fillRule="evenodd">
<path d="M0 0h24v24H0z" fill="#878787" fillOpacity=".01" />
<path stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"
d="M8.036 10.93l3.93 4.07 4.068-3.93" />
</g>
| </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"> | <symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24"> | <path d="M60 54.5h8v40h-8zM60 35.5h8v8h-8z" />
</svg>
</symbol>
<symbol id="chevron-down" width="24" height="24" viewBox="0 0 24 24">
<g fill="none" fillRule="evenodd">
<path d="M0 0h24v24H0z" fill="#878787" fillOpacity=".01" />
<path stroke="currentColor" strokeWidth="1.5" strokeLinecap="round"
d="M8.036 10.93l3.93 4.07 4.068-3.93" />
</g> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/ui/Icons.js |
onClick={onClick}
disabled={processingVersion}
title={t('check_updates_now')}
>
<svg className="icons">
<use xlinkHref="#refresh" />
</svg>
</button>}
</div>
</div>
| </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"> | <svg className="icons icon12"> | onClick={onClick}
disabled={processingVersion}
title={t('check_updates_now')}
>
<svg className="icons icon12">
<use xlinkHref="#refresh" />
</svg>
</button>}
</div>
</div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | 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 | https://github.com/AdguardTeam/AdGuardHome/commit/057804a459c2631494a87133f08e4f8da7d73798 | client/src/components/ui/Version.js |
"encryption_server_desc": "In order to use HTTPS, you need yo enter the server name that matches your SSL certificate.",
"encryption_redirect": "Redirect to HTTPS automatically",
"encryption_redirect_desc": "If checked, AdGuard Home will automatically redirect you from HTTP to HTTPS addresses.",
"encryption_https": "HTTPS port",
"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.",
"encryption_dot": "DNS-over-TLS port",
"encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.",
"encryption_certificates": "Certificates",
"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.",
"encryption_certificates_input": "Copy/paste your PEM-encoded cerificates here.",
| </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", </s> remove {statusKey &&
</s> add {privateKey && | "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.", | "encryption_server_desc": "In order to use HTTPS, you need yo enter the server name that matches your SSL certificate.",
"encryption_redirect": "Redirect to HTTPS automatically",
"encryption_redirect_desc": "If checked, AdGuard Home will automatically redirect you from HTTP to HTTPS addresses.",
"encryption_https": "HTTPS port",
"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.",
"encryption_dot": "DNS-over-TLS port",
"encryption_dot_desc": "If this port is configured, AdGuard Home will run a DNS-over-TLS server on this port.",
"encryption_certificates": "Certificates",
"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.",
"encryption_certificates_input": "Copy/paste your PEM-encoded cerificates here.", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
"encryption_certificates": "Certificates",
"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.",
"encryption_certificates_input": "Copy/paste your PEM-encoded cerificates here.",
"encryption_status": "Status",
"encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
"encryption_key": "Private key",
"encryption_key_input": "Copy/paste your PEM-encoded private key for your cerficate here.",
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
"form_error_port_range": "Enter port value in the range of 80-65535",
"form_error_equal": "Shouldn't be equal",
| </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> remove {statusKey &&
</s> add {privateKey && | "encryption_expire": "Expires", | "encryption_certificates": "Certificates",
"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.",
"encryption_certificates_input": "Copy/paste your PEM-encoded cerificates here.",
"encryption_status": "Status",
"encryption_expire": "Expires",
"encryption_expire": "Expires",
"encryption_key": "Private key",
"encryption_key_input": "Copy/paste your PEM-encoded private key for your cerficate here.",
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
"form_error_port_range": "Enter port value in the range of 80-65535",
"form_error_equal": "Shouldn't be equal", | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
"encryption_status": "Status",
"encryption_expire": "Expires",
"encryption_key": "Private key",
"encryption_key_input": "Copy/paste your PEM-encoded private key for your cerficate here.",
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
"topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.",
"form_error_port_range": "Enter port value in the range of 80-65535",
"form_error_equal": "Shouldn't be equal",
"form_error_password": "Password mismatched",
"reset_settings": "Reset settings"
| </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> remove {statusKey &&
</s> add {privateKey && | "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", | "encryption_status": "Status",
"encryption_expire": "Expires",
"encryption_key": "Private key",
"encryption_key_input": "Copy/paste your PEM-encoded private key for your cerficate here.",
"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",
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
"topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.",
"form_error_port_range": "Enter port value in the range of 80-65535",
"form_error_equal": "Shouldn't be equal",
"form_error_password": "Password mismatched",
"reset_settings": "Reset settings" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
"encryption_subject": "Subject",
"encryption_issuer": "Issuer",
"encryption_hostnames": "Hostnames",
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
"form_error_port_range": "Enter port value in the range of 80-65535",
"form_error_equal": "Shouldn't be equal",
"form_error_password": "Password mismatched",
"reset_settings": "Reset settings"
| </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.", | "topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.", | "encryption_subject": "Subject",
"encryption_issuer": "Issuer",
"encryption_hostnames": "Hostnames",
"topline_expiring_certificate": "Your SSL certificate is about to expire. Update <0>Encryption settings</0>.",
"topline_expired_certificate": "Your SSL certificate is expired. Update <0>Encryption settings</0>.",
"form_error_port_range": "Enter port value in the range of 80-65535",
"form_error_equal": "Shouldn't be equal",
"form_error_password": "Password mismatched",
"reset_settings": "Reset settings" | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/__locales/en.json |
dispatch(findActiveDhcpFailure());
}
}
};
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> remove const Form = (props) => {
</s> add let Form = (props) => { </s> remove isDropdownOpen: false,
</s> add | dispatch(findActiveDhcpFailure());
}
}
};
| [
"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"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/actions/index.js |
|
// DNS-over-HTTPS and DNS-over-TLS
TLS_STATUS = { path: 'tls/status', method: 'GET' };
TLS_CONFIG = { path: 'tls/configure', method: 'POST' };
getTlsStatus() {
const { path, method } = this.TLS_STATUS;
return this.makeRequest(path, method);
}
| </s> remove const Form = (props) => {
</s> add let Form = (props) => { </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 | TLS_VALIDATE = { path: 'tls/validate', method: 'POST' }; | // DNS-over-HTTPS and DNS-over-TLS
TLS_STATUS = { path: 'tls/status', method: 'GET' };
TLS_CONFIG = { path: 'tls/configure', method: 'POST' };
TLS_VALIDATE = { path: 'tls/validate', method: 'POST' };
getTlsStatus() {
const { path, method } = this.TLS_STATUS;
return this.makeRequest(path, method);
} | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/api/Api.js |
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 </s> remove const Form = (props) => {
</s> add let Form = (props) => { | validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
} | headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
}
validateTlsConfig(config) {
const { path, method } = this.TLS_VALIDATE;
const parameters = {
data: config,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, parameters);
}
} | [
"keep",
"keep",
"keep",
"add",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/api/Api.js |
import React, { Component, Fragment } from 'react';
import { HashRouter, Route } from 'react-router-dom';
import PropTypes from 'prop-types';
import { Trans, withNamespaces } from 'react-i18next';
import LoadingBar from 'react-redux-loading-bar';
import 'react-table/react-table.css';
import '../ui/Tabler.css';
import '../ui/ReactTable.css';
| </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; | import { withNamespaces } from 'react-i18next'; | import React, { Component, Fragment } from 'react';
import { HashRouter, Route } from 'react-router-dom';
import PropTypes from 'prop-types';
import { withNamespaces } from 'react-i18next';
import LoadingBar from 'react-redux-loading-bar';
import 'react-table/react-table.css';
import '../ui/Tabler.css';
import '../ui/ReactTable.css'; | [
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
import Status from '../ui/Status';
import Topline from '../ui/Topline';
import i18n from '../../i18n';
class App extends Component {
componentDidMount() {
this.props.getDnsStatus();
| </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; | import EncryptionTopline from '../ui/EncryptionTopline'; | import Status from '../ui/Status';
import Topline from '../ui/Topline';
import EncryptionTopline from '../ui/EncryptionTopline';
import i18n from '../../i18n';
class App extends Component {
componentDidMount() {
this.props.getDnsStatus(); | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
const updateAvailable =
!dashboard.processingVersions &&
dashboard.isCoreRunning &&
dashboard.isUpdateAvailable;
const isExpiringCertificate = !encryption.processing && encryption.warning;
return (
<HashRouter hashType='noslash'>
<Fragment>
{updateAvailable &&
| </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} /> | const updateAvailable =
!dashboard.processingVersions &&
dashboard.isCoreRunning &&
dashboard.isUpdateAvailable;
return (
<HashRouter hashType='noslash'>
<Fragment>
{updateAvailable && | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
|
<Topline type="info">
{dashboard.announcement} <a href={dashboard.announcementUrl} target="_blank" rel="noopener noreferrer">Click here</a> for more info.
</Topline>
}
{isExpiringCertificate &&
<Topline type="warning">
<Trans components={[<a href="#settings" key="0">link</a>]}>
topline_expiring_certificate
</Trans>
</Topline>
}
<LoadingBar className="loading-bar" updateTime={1000} />
<Route component={Header} />
<div className="container container--wrap">
{!dashboard.processing && !dashboard.isCoreRunning &&
| </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> | {!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} /> | <Topline type="info">
{dashboard.announcement} <a href={dashboard.announcementUrl} target="_blank" rel="noopener noreferrer">Click here</a> for more info.
</Topline>
}
{!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} />
{!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} />
{!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} />
{!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} />
{!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} />
{!encryption.processing &&
<EncryptionTopline notAfter={encryption.not_after} />
}
<LoadingBar className="loading-bar" updateTime={1000} />
<Route component={Header} />
<div className="container container--wrap">
{!dashboard.processing && !dashboard.isCoreRunning && | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/App/index.js |
class Header extends Component {
state = {
isMenuOpen: false,
isDropdownOpen: false,
};
toggleMenuOpen = () => {
this.setState(prevState => ({ isMenuOpen: !prevState.isMenuOpen }));
};
| </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> remove const Form = (props) => {
</s> add let Form = (props) => { |
class Header extends Component {
state = {
isMenuOpen: false,
};
toggleMenuOpen = () => {
this.setState(prevState => ({ isMenuOpen: !prevState.isMenuOpen }));
}; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Header/index.js |
|
render() {
const { dashboard } = this.props;
const badgeClass = classnames({
'badge dns-status': true,
'badge-success': dashboard.protectionEnabled,
'badge-danger': !dashboard.protectionEnabled,
});
| </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 | const { isMenuOpen } = this.state; | render() {
const { dashboard } = this.props;
const { isMenuOpen } = this.state;
const badgeClass = classnames({
'badge dns-status': true,
'badge-success': dashboard.protectionEnabled,
'badge-danger': !dashboard.protectionEnabled,
}); | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Header/index.js |
</div>
</div>
<Menu
location={this.props.location}
isMenuOpen={this.state.isMenuOpen}
toggleMenuOpen={this.toggleMenuOpen}
closeMenu={this.closeMenu}
/>
<div className="col col-sm-6 col-lg-3">
<Version
| </s> | isMenuOpen={isMenuOpen} | </div>
</div>
<Menu
location={this.props.location}
isMenuOpen={isMenuOpen}
toggleMenuOpen={this.toggleMenuOpen}
closeMenu={this.closeMenu}
/>
<div className="col col-sm-6 col-lg-3">
<Version | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Header/index.js |
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Field, reduxForm, formValueSelector } from 'redux-form';
import { Trans, withNamespaces } from 'react-i18next';
import flow from 'lodash/flow';
import format from 'date-fns/format';
| </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; | import { connect } from 'react-redux'; | import React, { Fragment } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Field, reduxForm, formValueSelector } from 'redux-form';
import { Trans, withNamespaces } from 'react-i18next';
import flow from 'lodash/flow';
import format from 'date-fns/format'; | [
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Field, reduxForm } from 'redux-form';
import { Trans, withNamespaces } from 'react-i18next';
import flow from 'lodash/flow';
import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
import i18n from '../../../i18n';
| </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; | import { Field, reduxForm, formValueSelector } from 'redux-form'; | import React, { Fragment } from 'react';
import PropTypes from 'prop-types';
import { Field, reduxForm, formValueSelector } from 'redux-form';
import { Trans, withNamespaces } from 'react-i18next';
import flow from 'lodash/flow';
import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
import i18n from '../../../i18n'; | [
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
import { Field, reduxForm, formValueSelector } from 'redux-form';
import { Trans, withNamespaces } from 'react-i18next';
import flow from 'lodash/flow';
import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
import { EMPTY_DATE } from '../../../helpers/constants';
import i18n from '../../../i18n';
const validate = (values) => {
| </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; | import format from 'date-fns/format'; | import { Field, reduxForm, formValueSelector } from 'redux-form';
import { Trans, withNamespaces } from 'react-i18next';
import flow from 'lodash/flow';
import format from 'date-fns/format';
import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
import { EMPTY_DATE } from '../../../helpers/constants';
import i18n from '../../../i18n';
const validate = (values) => { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
import format from 'date-fns/format';
import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
import i18n from '../../../i18n';
const validate = (values) => {
const errors = {};
| </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; | import { EMPTY_DATE } from '../../../helpers/constants'; | import format from 'date-fns/format';
import { renderField, renderSelectField, toNumber, port } from '../../../helpers/form';
import { EMPTY_DATE } from '../../../helpers/constants';
import i18n from '../../../i18n';
const validate = (values) => {
const errors = {}; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
return errors;
};
const Form = (props) => {
const {
t,
handleSubmit,
reset,
invalid,
| </s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </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 | let Form = (props) => { |
return errors;
};
let Form = (props) => {
const {
t,
handleSubmit,
reset,
invalid, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
let Form = (props) => {
const {
t,
handleSubmit,
reset,
invalid,
submitting,
processing,
| </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> 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 | handleChange,
isEnabled,
certificateChain,
privateKey, | let Form = (props) => {
const {
t,
handleSubmit,
handleChange,
isEnabled,
certificateChain,
privateKey,
reset,
invalid,
submitting,
processing, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
reset,
invalid,
submitting,
processing,
statusCert,
statusKey,
} = props;
return (
<form onSubmit={handleSubmit}>
<div className="row">
| </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 Form = (props) => {
</s> add let Form = (props) => { </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add | not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, | reset,
invalid,
submitting,
processing,
not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation,
not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation,
} = props;
return (
<form onSubmit={handleSubmit}>
<div className="row"> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
return (
<form onSubmit={handleSubmit}>
<div className="row">
<div className="col-12">
<label className="form__label" htmlFor="server_name">
<Trans>encryption_server</Trans>
</label>
</div>
| </s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </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 | <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> | return (
<form onSubmit={handleSubmit}>
<div className="row">
<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>
<div className="col-12">
<label className="form__label" htmlFor="server_name">
<Trans>encryption_server</Trans>
</label>
</div> | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
className="form-control"
placeholder={t('encryption_server_enter')}
/>
<div className="form__desc">
<Trans>encryption_server_desc</Trans>
</div>
| </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} | onChange={handleChange}
disabled={!isEnabled} | className="form-control"
placeholder={t('encryption_server_enter')}
onChange={handleChange}
disabled={!isEnabled}
/>
<div className="form__desc">
<Trans>encryption_server_desc</Trans>
</div> | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
component={renderSelectField}
placeholder={t('encryption_redirect')}
/>
<div className="form__desc">
<Trans>encryption_redirect_desc</Trans>
</div>
</div>
| </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} | onChange={handleChange}
disabled={!isEnabled} | component={renderSelectField}
placeholder={t('encryption_redirect')}
onChange={handleChange}
disabled={!isEnabled}
/>
<div className="form__desc">
<Trans>encryption_redirect_desc</Trans>
</div>
</div> | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
className="form-control"
placeholder={t('encryption_https')}
validate={[port]}
normalize={toNumber}
/>
<div className="form__desc">
<Trans>encryption_https_desc</Trans>
</div>
| </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} | onChange={handleChange}
disabled={!isEnabled} | className="form-control"
placeholder={t('encryption_https')}
validate={[port]}
normalize={toNumber}
onChange={handleChange}
disabled={!isEnabled}
/>
<div className="form__desc">
<Trans>encryption_https_desc</Trans>
</div> | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
validate={[port]}
normalize={toNumber}
/>
<div className="form__desc">
<Trans>encryption_dot_desc</Trans>
</div>
| </s> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} | onChange={handleChange}
disabled={!isEnabled} | validate={[port]}
normalize={toNumber}
onChange={handleChange}
disabled={!isEnabled}
/>
<div className="form__desc">
<Trans>encryption_dot_desc</Trans>
</div> | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
type="text"
className="form-control form-control--textarea"
placeholder={t('encryption_certificates_input')}
/>
<div className="form__status">
{certificateChain &&
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
| </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 <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> | onChange={handleChange}
disabled={!isEnabled} | type="text"
className="form-control form-control--textarea"
placeholder={t('encryption_certificates_input')}
onChange={handleChange}
disabled={!isEnabled}
/>
<div className="form__status">
{certificateChain &&
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>: | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
className="form-control form-control--textarea"
placeholder={t('encryption_certificates_input')}
/>
<div className="form__status">
{statusCert &&
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<div>
| </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 <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> | {certificateChain && | className="form-control form-control--textarea"
placeholder={t('encryption_certificates_input')}
/>
<div className="form__status">
{certificateChain &&
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<div>
{statusCert}
</div>
</Fragment>
}
{/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for
| </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 <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 {statusCert &&
</s> add {certificateChain && </s> remove {statusKey &&
</s> add {privateKey && | <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> | <Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<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>
<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>
<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>
</Fragment>
}
{/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
{statusCert}
</div>
</Fragment>
}
{/* <div>
<Trans values={{ domains: '*.example.org, example.org' }}>
encryption_certificates_for
</Trans>
</div>
<div>
<Trans values={{ date: '2022-01-01' }}>
encryption_expire
</Trans>
</div> */}
</div>
</div>
</div>
</div>
<div className="row">
| </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> remove {statusCert &&
</s> add {certificateChain && | {statusCert}
</div>
</Fragment>
}
</div>
</div>
</div>
</div>
<div className="row"> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
|
type="text"
className="form-control form-control--textarea"
placeholder="Copy/paste your PEM-encoded private key for your cerficate here."
/>
<div className="form__status">
{privateKey &&
<Fragment>
| </s> remove {statusKey &&
</s> add {privateKey && </s> remove {statusCert &&
</s> add {certificateChain && </s> remove "encryption_certificates_for": "Certificates for {{domains}}",
"encryption_expire": "Expire on {{date}}",
</s> add "encryption_expire": "Expires", | onChange={handleChange}
disabled={!isEnabled} | type="text"
className="form-control form-control--textarea"
placeholder="Copy/paste your PEM-encoded private key for your cerficate here."
onChange={handleChange}
disabled={!isEnabled}
/>
<div className="form__status">
{privateKey &&
<Fragment> | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
className="form-control form-control--textarea"
placeholder="Copy/paste your PEM-encoded private key for your cerficate here."
/>
<div className="form__status">
{statusKey &&
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<div>
| </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> 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> | {privateKey && | className="form-control form-control--textarea"
placeholder="Copy/paste your PEM-encoded private key for your cerficate here."
/>
<div className="form__status">
{privateKey &&
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
<Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<div>
{statusKey}
</div>
</Fragment>
}
</div>
</div>
</div>
| </s> remove {statusCert &&
</s> add {certificateChain && </s> remove {statusKey &&
</s> add {privateKey && </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 <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> | <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> | <Fragment>
<div className="form__label form__label--bold">
<Trans>encryption_status</Trans>:
</div>
<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>
<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>
<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>
</Fragment>
}
</div>
</div>
</div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
</div>
</div>
</div>
</div>
<div className="btn-list mt-2">
<button
| </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> 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> | <div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div> | </div>
</div>
</div>
<div className="col-12">
<p className="text-danger">
{warning_validation && warning_validation}
</p>
</div>
</div>
<div className="btn-list mt-2">
<button | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
</div>
</div>
</div>
<div className="btn-list">
<button
type="submit"
className="btn btn-success btn-standart"
disabled={invalid || submitting || processing}
>
| </s> remove disabled={invalid || submitting || processing}
</s> add disabled={
invalid
|| submitting
|| processing
|| !valid_chain
|| !valid_key
|| warning_validation
} </s> remove type="submit"
</s> add type="button" </s> remove statusCert={statusCert}
statusKey={statusKey}
</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 | <div className="btn-list mt-2"> | </div>
</div>
</div>
<div className="btn-list mt-2">
<button
type="submit"
className="btn btn-success btn-standart"
disabled={invalid || submitting || processing}
> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
<div className="btn-list">
<button
type="submit"
className="btn btn-success btn-standart"
disabled={invalid || submitting || processing}
>
<Trans>save_config</Trans>
</button>
<button
type="submit"
| </s> remove <div className="btn-list">
</s> add <div className="btn-list mt-2"> </s> remove type="submit"
</s> add type="button" </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 | disabled={
invalid
|| submitting
|| processing
|| !valid_chain
|| !valid_key
|| warning_validation
} | <div className="btn-list">
<button
type="submit"
className="btn btn-success btn-standart"
disabled={
invalid
|| submitting
|| processing
|| !valid_chain
|| !valid_key
|| warning_validation
}
>
<Trans>save_config</Trans>
</button>
<button
type="submit" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
>
<Trans>save_config</Trans>
</button>
<button
type="submit"
className="btn btn-secondary btn-standart"
disabled={submitting || processing}
onClick={reset}
>
<Trans>reset_settings</Trans>
| </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,
}} | type="button" | >
<Trans>save_config</Trans>
</button>
<button
type="button"
className="btn btn-secondary btn-standart"
disabled={submitting || processing}
onClick={reset}
>
<Trans>reset_settings</Trans> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
Form.propTypes = {
handleSubmit: PropTypes.func.isRequired,
reset: PropTypes.func.isRequired,
submitting: PropTypes.bool.isRequired,
invalid: PropTypes.bool.isRequired,
initialValues: PropTypes.object.isRequired,
processing: PropTypes.bool.isRequired,
| </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> 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 | handleChange: PropTypes.func,
isEnabled: PropTypes.bool.isRequired,
certificateChain: PropTypes.string.isRequired,
privateKey: PropTypes.string.isRequired, | Form.propTypes = {
handleSubmit: PropTypes.func.isRequired,
handleChange: PropTypes.func,
isEnabled: PropTypes.bool.isRequired,
certificateChain: PropTypes.string.isRequired,
privateKey: PropTypes.string.isRequired,
reset: PropTypes.func.isRequired,
submitting: PropTypes.bool.isRequired,
invalid: PropTypes.bool.isRequired,
initialValues: PropTypes.object.isRequired,
processing: PropTypes.bool.isRequired, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
submitting: PropTypes.bool.isRequired,
invalid: PropTypes.bool.isRequired,
initialValues: PropTypes.object.isRequired,
processing: PropTypes.bool.isRequired,
statusCert: PropTypes.string,
statusKey: PropTypes.string,
t: PropTypes.func.isRequired,
};
export default flow([
withNamespaces(),
| </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 | 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, | submitting: PropTypes.bool.isRequired,
invalid: PropTypes.bool.isRequired,
initialValues: PropTypes.object.isRequired,
processing: PropTypes.bool.isRequired,
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,
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,
t: PropTypes.func.isRequired,
};
export default flow([
withNamespaces(), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
subject: PropTypes.string,
t: PropTypes.func.isRequired,
};
export default flow([
withNamespaces(),
reduxForm({
form: 'encryptionForm',
| </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> 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 | 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);
| subject: PropTypes.string,
t: PropTypes.func.isRequired,
};
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);
export default flow([
withNamespaces(),
reduxForm({
form: 'encryptionForm', | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/Form.js |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withNamespaces } from 'react-i18next';
import Form from './Form';
import Card from '../../ui/Card';
| </s> remove import { Trans, withNamespaces } from 'react-i18next';
</s> add import { withNamespaces } from 'react-i18next'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; | import debounce from 'lodash/debounce'; | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { withNamespaces } from 'react-i18next';
import debounce from 'lodash/debounce';
import Form from './Form';
import Card from '../../ui/Card';
| [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
};
render() {
const { encryption, t } = this.props;
const {
enabled,
| </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 | handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
| };
handleFormChange = debounce((values) => {
this.props.validateTlsConfig(values);
}, 300);
render() {
const { encryption, t } = this.props;
const {
enabled, | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
render() {
const { encryption, t } = this.props;
const {
processing,
processingConfig,
status_cert: statusCert,
status_key: statusKey,
...values
} = encryption;
return (
<div className="encryption">
{encryption &&
| </s> remove statusCert,
statusKey,
</s> add not_after,
valid_chain,
valid_key,
dns_names,
key_type,
issuer,
subject,
warning_validation, </s> remove const isExpiringCertificate = !encryption.processing && encryption.warning;
</s> add | enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key, |
render() {
const { encryption, t } = this.props;
const {
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
} = encryption;
return (
<div className="encryption">
{encryption && | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
subtitle={t('encryption_desc')}
bodyType="card-body box-body--settings"
>
<Form
initialValues={{ ...values }}
processing={encryption.processingConfig}
statusCert={statusCert}
statusKey={statusKey}
onSubmit={this.handleFormSubmit}
/>
| </s> remove statusCert={statusCert}
statusKey={statusKey}
</s> add </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, | initialValues={{
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
}} | subtitle={t('encryption_desc')}
bodyType="card-body box-body--settings"
>
<Form
initialValues={{
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
}}
processing={encryption.processingConfig}
statusCert={statusCert}
statusKey={statusKey}
onSubmit={this.handleFormSubmit}
/> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
>
<Form
initialValues={{ ...values }}
processing={encryption.processingConfig}
statusCert={statusCert}
statusKey={statusKey}
onSubmit={this.handleFormSubmit}
/>
</Card>
}
</div>
| </s> remove initialValues={{ ...values }}
</s> add initialValues={{
enabled,
server_name,
force_https,
port_https,
port_dns_over_tls,
certificate_chain,
private_key,
}} </s> remove <div className="btn-list">
</s> add <div className="btn-list mt-2"> </s> remove type="submit"
</s> add type="button" </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, | >
<Form
initialValues={{ ...values }}
processing={encryption.processingConfig}
onSubmit={this.handleFormSubmit}
/>
</Card>
}
</div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
|
processing={encryption.processingConfig}
onSubmit={this.handleFormSubmit}
/>
</Card>
}
</div>
| </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> remove isMenuOpen={this.state.isMenuOpen}
</s> add isMenuOpen={isMenuOpen} | onChange={this.handleFormChange}
{...this.props.encryption} | processing={encryption.processingConfig}
onSubmit={this.handleFormSubmit}
onChange={this.handleFormChange}
{...this.props.encryption}
/>
</Card>
}
</div> | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
Encryption.propTypes = {
setTlsConfig: PropTypes.func.isRequired,
encryption: PropTypes.object.isRequired,
t: PropTypes.func.isRequired,
};
export default withNamespaces()(Encryption);
| </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, | validateTlsConfig: PropTypes.func.isRequired, | Encryption.propTypes = {
setTlsConfig: PropTypes.func.isRequired,
validateTlsConfig: PropTypes.func.isRequired,
encryption: PropTypes.object.isRequired,
t: PropTypes.func.isRequired,
};
export default withNamespaces()(Encryption); | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/Encryption/index.js |
encryption={this.props.encryption}
setTlsConfig={this.props.setTlsConfig}
/>
<Dhcp
dhcp={this.props.dhcp}
toggleDhcp={this.props.toggleDhcp}
getDhcpStatus={this.props.getDhcpStatus}
findActiveDhcp={this.props.findActiveDhcp}
| </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} /> | validateTlsConfig={this.props.validateTlsConfig} | encryption={this.props.encryption}
setTlsConfig={this.props.setTlsConfig}
validateTlsConfig={this.props.validateTlsConfig}
/>
<Dhcp
dhcp={this.props.dhcp}
toggleDhcp={this.props.toggleDhcp}
getDhcpStatus={this.props.getDhcpStatus}
findActiveDhcp={this.props.findActiveDhcp} | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/components/Settings/index.js |
getDhcpInterfaces,
setDhcpConfig,
findActiveDhcp,
getTlsStatus,
setTlsConfig,
validateTlsConfig,
} from '../actions/encryption';
| </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; </s> remove import { Field, reduxForm } from 'redux-form';
</s> add import { Field, reduxForm, formValueSelector } from 'redux-form'; | } from '../actions';
import { | getDhcpInterfaces,
setDhcpConfig,
findActiveDhcp,
} from '../actions';
import {
getTlsStatus,
setTlsConfig,
validateTlsConfig,
} from '../actions/encryption'; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/containers/Settings.js |
setDhcpConfig,
findActiveDhcp,
getTlsStatus,
setTlsConfig,
} from '../actions';
import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings,
| </s> | validateTlsConfig,
} from '../actions/encryption'; | setDhcpConfig,
findActiveDhcp,
getTlsStatus,
setTlsConfig,
validateTlsConfig,
} from '../actions/encryption';
import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/containers/Settings.js |
setDhcpConfig,
findActiveDhcp,
getTlsStatus,
setTlsConfig,
};
export default connect(
mapStateToProps,
mapDispatchToProps,
| </s> remove } from '../actions';
</s> add validateTlsConfig,
} from '../actions/encryption'; | validateTlsConfig, | setDhcpConfig,
findActiveDhcp,
getTlsStatus,
setTlsConfig,
validateTlsConfig,
};
export default connect(
mapStateToProps,
mapDispatchToProps, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/containers/Settings.js |
};
export const STANDARD_DNS_PORT = 53;
export const STANDARD_WEB_PORT = 80;
| </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 | export const EMPTY_DATE = '0001-01-01T00:00:00Z'; | };
export const STANDARD_DNS_PORT = 53;
export const STANDARD_WEB_PORT = 80;
export const EMPTY_DATE = '0001-01-01T00:00:00Z'; | [
"keep",
"keep",
"keep",
"add"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/helpers/constants.js |
import * as actions from '../actions';
import toasts from './toasts';
const settings = handleActions({
[actions.initSettingsRequest]: state => ({ ...state, processing: true }),
[actions.initSettingsFailure]: state => ({ ...state, processing: false }),
[actions.initSettingsSuccess]: (state, { payload }) => {
| </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'; | import encryption from './encryption'; | import * as actions from '../actions';
import toasts from './toasts';
import encryption from './encryption';
const settings = handleActions({
[actions.initSettingsRequest]: state => ({ ...state, processing: true }),
[actions.initSettingsFailure]: state => ({ ...state, processing: false }),
[actions.initSettingsSuccess]: (state, { payload }) => { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/reducers/index.js |
active: null,
leases: [],
});
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: '',
});
export default combineReducers({
settings,
dashboard,
queryLogs,
filtering,
| </s> remove isDropdownOpen: false,
</s> add </s> remove const Form = (props) => {
</s> add let Form = (props) => { | active: null,
leases: [],
});
export default combineReducers({
settings,
dashboard,
queryLogs,
filtering, | [
"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"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | client/src/reducers/index.js |
|
var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"}
type tlsConfigSettings struct {
Enabled bool `yaml:"enaled" json:"enabled"`
ServerName string `yaml:"server_name" json:"server_name,omitempty"`
ForceHTTPS bool `yaml:"force_https" json:"force_https,omitempty"`
PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"`
PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"`
| </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 Form = (props) => {
</s> add let Form = (props) => { | Enabled bool `yaml:"enabled" json:"enabled"` |
var defaultDNS = []string{"tls://1.1.1.1", "tls://1.0.0.1"}
type tlsConfigSettings struct {
Enabled bool `yaml:"enabled" json:"enabled"`
ServerName string `yaml:"server_name" json:"server_name,omitempty"`
ForceHTTPS bool `yaml:"force_https" json:"force_https,omitempty"`
PortHTTPS int `yaml:"port_https" json:"port_https,omitempty"`
PortDNSOverTLS int `yaml:"port_dns_over_tls" json:"port_dns_over_tls,omitempty"`
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Added validation on change and enable encryption checkbox | https://github.com/AdguardTeam/AdGuardHome/commit/05cce8b1073dd4c005157177bdc129cba813a12c | config.go |
// Checks filters updates if necessary
// If force is true, it ignores the filter.LastUpdated field value
func refreshFiltersIfNecessary(force bool) int {
var updateFilters []filter
config.RLock()
for i := range config.Filters {
f := &config.Filters[i] // otherwise we will be operating on a copy
| </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() | //
// 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 | // Checks filters updates if necessary
// If force is true, it ignores the filter.LastUpdated field value
//
// 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
func refreshFiltersIfNecessary(force bool) int {
var updateFilters []filter
config.RLock()
for i := range config.Filters {
f := &config.Filters[i] // otherwise we will be operating on a copy | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * filters: rework update mechanism so that UI doesn't get locked while update is in progress | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
// Checks filters updates if necessary
// If force is true, it ignores the filter.LastUpdated field value
func refreshFiltersIfNecessary(force bool) int {
config.Lock()
// fetch URLs
updateCount := 0
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy
| </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 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) | var updateFilters []filter |
// Checks filters updates if necessary
// If force is true, it ignores the filter.LastUpdated field value
func refreshFiltersIfNecessary(force bool) int {
var updateFilters []filter
// fetch URLs
updateCount := 0
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * filters: rework update mechanism so that UI doesn't get locked while update is in progress | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
// If force is true, it ignores the filter.LastUpdated field value
func refreshFiltersIfNecessary(force bool) int {
config.Lock()
// fetch URLs
updateCount := 0
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy
if !filter.Enabled {
continue
| </s> remove config.Lock()
</s> add var updateFilters []filter </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 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++ | config.RLock() | // If force is true, it ignores the filter.LastUpdated field value
func refreshFiltersIfNecessary(force bool) int {
config.Lock()
config.RLock()
config.RLock()
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy
if !filter.Enabled {
continue | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * filters: rework update mechanism so that UI doesn't get locked while update is in progress | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
// fetch URLs
updateCount := 0
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy
if !filter.Enabled {
continue
}
| </s> remove // fetch URLs
updateCount := 0
</s> add config.RLock() </s> remove if !filter.Enabled {
</s> add if !f.Enabled { </s> remove config.Lock()
</s> add var updateFilters []filter </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() | f := &config.Filters[i] // otherwise we will be operating on a copy |
// fetch URLs
updateCount := 0
for i := range config.Filters {
f := &config.Filters[i] // otherwise we will be operating on a copy
if !filter.Enabled {
continue
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * filters: rework update mechanism so that UI doesn't get locked while update is in progress | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
updateCount := 0
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy
if !filter.Enabled {
continue
}
if !force && time.Since(filter.LastUpdated) <= updatePeriod {
continue
| </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 !force && time.Since(filter.LastUpdated) <= updatePeriod {
</s> add if !force && time.Since(f.LastUpdated) <= updatePeriod { </s> remove // fetch URLs
updateCount := 0
</s> add config.RLock() </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 config.Lock()
</s> add var updateFilters []filter | if !f.Enabled { | updateCount := 0
for i := range config.Filters {
filter := &config.Filters[i] // otherwise we will be operating on a copy
if !f.Enabled {
continue
}
if !force && time.Since(filter.LastUpdated) <= updatePeriod {
continue | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | * filters: rework update mechanism so that UI doesn't get locked while update is in progress | https://github.com/AdguardTeam/AdGuardHome/commit/0647f3fe8666a38cbdc7a747279513338e49568a | filter.go |
Subsets and Splits