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
|
---|---|---|---|---|---|---|---|
func generateServerConfig() (newConf dnsforward.ServerConfig, err error) {
dnsConf := config.DNS
hosts := dnsConf.BindHosts
if len(hosts) == 0 {
hosts = []net.IP{{127, 0, 0, 1}}
}
newConf = dnsforward.ServerConfig{
UDPListenAddrs: ipsToUDPAddrs(hosts, dnsConf.Port),
TCPListenAddrs: ipsToTCPAddrs(hosts, dnsConf.Port),
| </s> remove addrs = appendDNSAddrs(addrs, net.IP{127, 0, 0, 1})
</s> add addr := aghnet.IPv4Localhost()
addrs = appendDNSAddrs(addrs, addr) </s> remove err := CheckPort("udp", net.IP{0, 0, 0, 0}, 0)
</s> add err := CheckPort("udp", netip.AddrPortFrom(netip.IPv4Unspecified(), 0)) </s> remove if len(v4Conf.RangeStart) == 0 {
</s> add if !v4Conf.RangeStart.IsValid() { </s> remove func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) {
</s> add func newDNSCrypt(hosts []netip.Addr, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port
</s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port | hosts = []netip.Addr{aghnet.IPv4Localhost()} | func generateServerConfig() (newConf dnsforward.ServerConfig, err error) {
dnsConf := config.DNS
hosts := dnsConf.BindHosts
if len(hosts) == 0 {
hosts = []netip.Addr{aghnet.IPv4Localhost()}
}
newConf = dnsforward.ServerConfig{
UDPListenAddrs: ipsToUDPAddrs(hosts, dnsConf.Port),
TCPListenAddrs: ipsToTCPAddrs(hosts, dnsConf.Port), | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
return newConf, nil
}
func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) {
if tlsConf.DNSCryptConfigFile == "" {
return dnscc, errors.Error("no dnscrypt_config_file")
}
f, err := os.Open(tlsConf.DNSCryptConfigFile)
| </s> remove return Context.web.httpsServer.server != nil ||
aghnet.CheckPort("tcp", config.BindHost, port) == nil
</s> add if Context.web.httpsServer.server != nil {
return true
}
return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil </s> remove func ipsToUDPAddrs(ips []net.IP, port int) (udpAddrs []*net.UDPAddr) {
</s> add func ipsToUDPAddrs(ips []netip.Addr, port int) (udpAddrs []*net.UDPAddr) { </s> remove func ipsToTCPAddrs(ips []net.IP, port int) (tcpAddrs []*net.TCPAddr) {
</s> add func ipsToTCPAddrs(ips []netip.Addr, port int) (tcpAddrs []*net.TCPAddr) { </s> remove func ifaceIPv4Subnet(iface *net.Interface) (subnet *net.IPNet, err error) {
</s> add func ifaceIPv4Subnet(iface *net.Interface) (subnet netip.Prefix, err error) { </s> remove if ipNet.IP == nil {
</s> add if !ipNet.Addr().IsValid() { | func newDNSCrypt(hosts []netip.Addr, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { |
return newConf, nil
}
func newDNSCrypt(hosts []netip.Addr, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) {
if tlsConf.DNSCryptConfigFile == "" {
return dnscc, errors.Error("no dnscrypt_config_file")
}
f, err := os.Open(tlsConf.DNSCryptConfigFile) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/dns.go |
"net"
"net/http"
"net/http/pprof"
"net/url"
"os"
"os/signal"
"path/filepath"
| </s> remove "net"
</s> add </s> remove "net"
</s> add </s> remove "net"
</s> add "net/netip" | "net/netip" | "net"
"net/http"
"net/http/pprof"
"net/netip"
"net/url"
"os"
"os/signal"
"path/filepath" | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/home.go |
config.BindPort = opts.bindPort
}
// override bind host/port from the console
if opts.bindHost != nil {
config.BindHost = opts.bindHost
}
if len(opts.pidFile) != 0 && writePIDFile(opts.pidFile) {
Context.pidFileName = opts.pidFile
}
| </s> remove restartHTTP = !config.BindHost.Equal(req.Web.IP) || config.BindPort != req.Web.Port
</s> add restartHTTP = config.BindHost != req.Web.IP || config.BindPort != req.Web.Port </s> remove v4conf.Enabled = s.conf.Enabled && len(v4conf.RangeStart) != 0
</s> add v4conf.Enabled = s.conf.Enabled && v4conf.RangeStart.IsValid() </s> remove if ipnet.IP.To4() != nil {
jsonIface.Addrs4 = append(jsonIface.Addrs4, ipnet.IP)
</s> add if ip4 := ipnet.IP.To4(); ip4 != nil {
addr := netip.AddrFrom4(*(*[4]byte)(ip4))
jsonIface.Addrs4 = append(jsonIface.Addrs4, addr) </s> remove err = aghnet.CheckPort("tcp", req.Web.IP, req.Web.Port)
</s> add err = aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(req.Web.Port))) </s> remove jsonIface.Addrs6 = append(jsonIface.Addrs6, ipnet.IP)
</s> add addr := netip.AddrFrom16(*(*[16]byte)(ipnet.IP))
jsonIface.Addrs6 = append(jsonIface.Addrs6, addr) | if opts.bindHost.IsValid() { | config.BindPort = opts.bindPort
}
// override bind host/port from the console
if opts.bindHost.IsValid() {
config.BindHost = opts.bindHost
}
if len(opts.pidFile) != 0 && writePIDFile(opts.pidFile) {
Context.pidFileName = opts.pidFile
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/home.go |
log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.")
}
// We should check if AdGuard Home is able to bind to port 53
err := aghnet.CheckPort("tcp", net.IP{127, 0, 0, 1}, defaultPortDNS)
if err != nil {
if errors.Is(err, os.ErrPermission) {
log.Fatal(`Permission check failed.
AdGuard Home is not allowed to bind to privileged ports (for instance, port 53).
| </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt)
</s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> remove bindHost net.IP
</s> add bindHost netip.Addr </s> remove return net.ParseIP(string(fields[2]))
</s> add ip, err = netip.ParseAddr(string(fields[2]))
if err != nil {
return netip.Addr{}
}
return ip </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server
BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client
Users []webUser `yaml:"users"` // Users that can access HTTP server
</s> add // BindHost is the address for the web interface server to listen on.
BindHost netip.Addr `yaml:"bind_host"`
// BindPort is the port for the web interface server to listen on.
BindPort int `yaml:"bind_port"`
// BetaBindPort is the port for the new client's web interface server to
// listen on.
BetaBindPort int `yaml:"beta_bind_port"`
// Users are the clients capable for accessing the web interface.
Users []webUser `yaml:"users"` </s> remove return nil
</s> add return p | err := aghnet.CheckPort("tcp", netip.AddrPortFrom(aghnet.IPv4Localhost(), defaultPortDNS)) | log.Fatal("This is the first launch of AdGuard Home. You must run it as Administrator.")
}
// We should check if AdGuard Home is able to bind to port 53
err := aghnet.CheckPort("tcp", netip.AddrPortFrom(aghnet.IPv4Localhost(), defaultPortDNS))
if err != nil {
if errors.Is(err, os.ErrPermission) {
log.Fatal(`Permission check failed.
AdGuard Home is not allowed to bind to privileged ports (for instance, port 53). | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/home.go |
import (
"bytes"
"encoding/json"
"net"
"net/http"
"net/http/httptest"
"testing"
"github.com/AdguardTeam/golibs/netutil"
| </s> remove "github.com/AdguardTeam/golibs/netutil"
</s> add </s> remove "net"
</s> add "net/netip" </s> remove "net"
</s> add "net/netip" |
import (
"bytes"
"encoding/json"
"net/http"
"net/http/httptest"
"testing"
"github.com/AdguardTeam/golibs/netutil" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/mobileconfig_test.go |
|
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
| </s> remove "github.com/AdguardTeam/golibs/netutil"
</s> add </s> remove "net"
</s> add "net/netip" </s> remove "net"
</s> add | "net/netip" | "net/http"
"net/http/httptest"
"net/netip"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/mobileconfig_test.go |
"net/http"
"net/http/httptest"
"testing"
"github.com/AdguardTeam/golibs/netutil"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"howett.net/plist"
)
| </s> remove "net"
</s> add </s> remove "net"
</s> add "net/netip" </s> remove "github.com/AdguardTeam/golibs/netutil"
</s> add </s> remove "github.com/AdguardTeam/golibs/netutil"
</s> add | "net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"howett.net/plist"
)
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/mobileconfig_test.go |
|
})
config = &configuration{
DNS: dnsConfig{
BindHosts: []net.IP{netutil.IPv4Zero()},
Port: defaultPortDNS,
},
}
Context.tls = &TLSMod{}
| </s> remove BindHosts: []net.IP{{0, 0, 0, 0}},
</s> add BindHosts: []netip.Addr{netip.IPv4Unspecified()}, </s> remove BindHost: net.IP{0, 0, 0, 0},
</s> add BindHost: netip.IPv4Unspecified(), </s> remove IP: anotherIP,
</s> add IP: anotherIP.AsSlice(), </s> remove IP: anotherIP,
</s> add IP: anotherIP.AsSlice(), </s> remove tcpAddrs = make([]*net.TCPAddr, len(ips))
for i, ip := range ips {
tcpAddrs[i] = &net.TCPAddr{
IP: ip,
Port: port,
}
</s> add tcpAddrs = make([]*net.TCPAddr, 0, len(ips))
for _, ip := range ips {
tcpAddrs = append(tcpAddrs, net.TCPAddrFromAddrPort(netip.AddrPortFrom(ip, uint16(port)))) | BindHosts: []netip.Addr{netip.IPv4Unspecified()}, | })
config = &configuration{
DNS: dnsConfig{
BindHosts: []netip.Addr{netip.IPv4Unspecified()},
Port: defaultPortDNS,
},
}
Context.tls = &TLSMod{} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/mobileconfig_test.go |
package home
import (
"fmt"
"net"
"os"
"strconv"
"strings"
"github.com/AdguardTeam/AdGuardHome/internal/version"
| </s> remove "net"
</s> add </s> remove "net"
</s> add "net/netip" </s> remove "net"
</s> add "net/netip" | "net/netip" | package home
import (
"fmt"
"net/netip"
"os"
"strconv"
"strings"
"github.com/AdguardTeam/AdGuardHome/internal/version" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options.go |
// [service.ControlAction] and [handleServiceControlAction].
serviceControlAction string
// bindHost is the address on which to serve the HTTP UI.
bindHost net.IP
// bindPort is the port on which to serve the HTTP UI.
bindPort int
// checkConfig is true if the current invocation is only required to check
| </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server
BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client
Users []webUser `yaml:"users"` // Users that can access HTTP server
</s> add // BindHost is the address for the web interface server to listen on.
BindHost netip.Addr `yaml:"bind_host"`
// BindPort is the port for the web interface server to listen on.
BindPort int `yaml:"bind_port"`
// BetaBindPort is the port for the new client's web interface server to
// listen on.
BetaBindPort int `yaml:"beta_bind_port"`
// Users are the clients capable for accessing the web interface.
Users []webUser `yaml:"users"` </s> remove AuthBlockMin uint `yaml:"block_auth_min"`
ProxyURL string `yaml:"http_proxy"` // Proxy address for our HTTP client
Language string `yaml:"language"` // two-letter ISO 639-1 language code
DebugPProf bool `yaml:"debug_pprof"` // Enable pprof HTTP server on port 6060
</s> add AuthBlockMin uint `yaml:"block_auth_min"`
// ProxyURL is the address of proxy server for the internal HTTP client.
ProxyURL string `yaml:"http_proxy"`
// Language is a two-letter ISO 639-1 language code.
Language string `yaml:"language"`
// DebugPProf defines if the profiling HTTP handler will listen on :6060.
DebugPProf bool `yaml:"debug_pprof"` </s> remove return aghnet.CheckPort("tcp", req.Web.IP, portInt)
</s> add return aghnet.CheckPort("tcp", netip.AddrPortFrom(req.Web.IP, uint16(portInt))) </s> remove dnsIPAddrs []net.IP // IPv4 addresses to return to DHCP clients as DNS server addresses
</s> add dnsIPAddrs []netip.Addr // IPv4 addresses to return to DHCP clients as DNS server addresses | bindHost netip.Addr | // [service.ControlAction] and [handleServiceControlAction].
serviceControlAction string
// bindHost is the address on which to serve the HTTP UI.
bindHost netip.Addr
// bindPort is the port on which to serve the HTTP UI.
bindPort int
// checkConfig is true if the current invocation is only required to check | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options.go |
description: "Path to the working directory.",
longName: "work-dir",
shortName: "w",
}, {
updateWithValue: func(o options, v string) (options, error) {
o.bindHost = net.ParseIP(v)
return o, nil
},
updateNoValue: nil,
effect: nil,
serialize: func(o options) (val string, ok bool) {
if o.bindHost == nil {
| </s> remove if o.bindHost == nil {
</s> add if !o.bindHost.IsValid() { </s> remove return nil, fmt.Errorf("couldn't get interfaces: %w", err)
} else if len(ifaces) == 0 {
return nil, errors.Error("couldn't find any legible interface")
</s> add return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err) </s> remove want: nil,
</s> add want: netip.Addr{},
name: "bad_output", </s> remove if ipNet.IP == nil {
</s> add if !ipNet.Addr().IsValid() { </s> remove for _, iface := range ifaces {
var addrs []net.Addr
addrs, err = iface.Addrs()
if err != nil {
return nil, fmt.Errorf("failed to get addresses for interface %s: %w", iface.Name, err)
</s> add // Collect network interface addresses.
for _, addr := range addrs {
n, ok := addr.(*net.IPNet)
if !ok {
// Should be *net.IPNet, this is weird.
return nil, fmt.Errorf("expected %[2]s to be %[1]T, got %[2]T", n, addr)
} else if ip4 := n.IP.To4(); ip4 != nil {
n.IP = ip4 | updateWithValue: func(o options, v string) (oo options, err error) {
o.bindHost, err = netip.ParseAddr(v)
return o, err | description: "Path to the working directory.",
longName: "work-dir",
shortName: "w",
}, {
updateWithValue: func(o options, v string) (oo options, err error) {
o.bindHost, err = netip.ParseAddr(v)
return o, err
updateWithValue: func(o options, v string) (oo options, err error) {
o.bindHost, err = netip.ParseAddr(v)
return o, err
updateWithValue: func(o options, v string) (oo options, err error) {
o.bindHost, err = netip.ParseAddr(v)
return o, err
},
updateNoValue: nil,
effect: nil,
serialize: func(o options) (val string, ok bool) {
if o.bindHost == nil { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options.go |
},
updateNoValue: nil,
effect: nil,
serialize: func(o options) (val string, ok bool) {
if o.bindHost == nil {
return "", false
}
return o.bindHost.String(), true
},
| </s> remove updateWithValue: func(o options, v string) (options, error) {
o.bindHost = net.ParseIP(v)
return o, nil
</s> add updateWithValue: func(o options, v string) (oo options, err error) {
o.bindHost, err = netip.ParseAddr(v)
return o, err </s> remove want: nil,
</s> add want: netip.Addr{},
name: "err_runcmd", </s> remove want: nil,
</s> add want: netip.Addr{},
name: "bad_output", </s> remove name: "err_runcmd",
</s> add </s> remove name: "bad_code",
</s> add | if !o.bindHost.IsValid() { | },
updateNoValue: nil,
effect: nil,
serialize: func(o options) (val string, ok bool) {
if !o.bindHost.IsValid() {
return "", false
}
return o.bindHost.String(), true
}, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options.go |
package home
import (
"fmt"
"net"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
| </s> remove "net"
</s> add </s> remove "net"
</s> add "net/netip" </s> remove "github.com/AdguardTeam/golibs/netutil"
</s> add | "net/netip" | package home
import (
"fmt"
"net/netip"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options_test.go |
testParseParamMissing(t, "--work-dir")
}
func TestParseBindHost(t *testing.T) {
assert.Nil(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host")
testParseParamMissing(t, "-h")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host")
testParseParamMissing(t, "--host")
}
| </s> remove assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host")
</s> add assert.Equal(t, wantAddr, testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host") </s> remove GatewayIP: net.IP{1, 2, 3, 1},
SubnetMask: net.IP{255, 255, 255, 0},
RangeStart: net.IP{1, 2, 3, 2},
RangeEnd: net.IP{1, 2, 3, 10},
</s> add GatewayIP: netip.MustParseAddr("1.2.3.1"),
SubnetMask: netip.MustParseAddr("255.255.255.0"),
RangeStart: netip.MustParseAddr("1.2.3.2"),
RangeEnd: netip.MustParseAddr("1.2.3.10"), </s> remove known6 := net.IP{
1, 2, 3, 4,
5, 6, 7, 8,
9, 10, 11, 12,
13, 14, 15, 16,
}
</s> add known4 := netip.MustParseAddr("192.168.0.1")
fullBroadcast4 := netip.MustParseAddr("255.255.255.255")
known6 := netip.MustParseAddr("102:304:506:708:90a:b0c:d0e:f10") </s> remove opts: options{bindHost: net.IP{1, 2, 3, 4}},
</s> add </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
</s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice()))
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) | wantAddr := netip.MustParseAddr("1.2.3.4")
assert.Zero(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, wantAddr, testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host") | testParseParamMissing(t, "--work-dir")
}
func TestParseBindHost(t *testing.T) {
wantAddr := netip.MustParseAddr("1.2.3.4")
assert.Zero(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, wantAddr, testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host")
wantAddr := netip.MustParseAddr("1.2.3.4")
assert.Zero(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, wantAddr, testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host")
testParseParamMissing(t, "-h")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host")
testParseParamMissing(t, "--host")
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options_test.go |
assert.Nil(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host")
testParseParamMissing(t, "-h")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host")
testParseParamMissing(t, "--host")
}
func TestParseBindPort(t *testing.T) {
assert.Equal(t, 0, testParseOK(t).bindPort, "empty is port 0")
| </s> remove assert.Nil(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host")
</s> add wantAddr := netip.MustParseAddr("1.2.3.4")
assert.Zero(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, wantAddr, testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host") </s> remove assert.Equal(t, s.conf.RangeStart, resp.YourIPAddr)
assert.Equal(t, s.conf.GatewayIP, resp.ServerIdentifier())
</s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
</s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice()))
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) </s> remove assert.True(t, s.conf.RangeStart.Equal(resp.YourIPAddr))
</s> add assert.True(t, resp.YourIPAddr.Equal(s.conf.RangeStart.AsSlice())) </s> remove assert.True(t, s.conf.GatewayIP.Equal(resp.Router()[0]))
assert.True(t, s.conf.GatewayIP.Equal(resp.ServerIdentifier()))
assert.Equal(t, s.conf.subnet.Mask, resp.SubnetMask())
</s> add assert.True(t, resp.Router()[0].Equal(s.conf.GatewayIP.AsSlice()))
assert.True(t, resp.ServerIdentifier().Equal(s.conf.GatewayIP.AsSlice()))
ones, _ := resp.SubnetMask().Size()
assert.Equal(t, s.conf.subnet.Bits(), ones) | assert.Equal(t, wantAddr, testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host") | assert.Nil(t, testParseOK(t).bindHost, "empty is not host")
assert.Equal(t, net.IPv4(1, 2, 3, 4), testParseOK(t, "-h", "1.2.3.4").bindHost, "-h is host")
testParseParamMissing(t, "-h")
assert.Equal(t, wantAddr, testParseOK(t, "--host", "1.2.3.4").bindHost, "--host is host")
testParseParamMissing(t, "--host")
}
func TestParseBindPort(t *testing.T) {
assert.Equal(t, 0, testParseOK(t).bindPort, "empty is port 0") | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options_test.go |
opts: options{workDir: "path"},
}, {
name: "bind_host",
args: []string{"-h", "1.2.3.4"},
}, {
name: "bind_port",
args: []string{"-p", "666"},
opts: options{bindPort: 666},
}, {
| </s> remove opts: options{bindHost: net.IP{1, 2, 3, 4}},
</s> add </s> remove want: nil,
</s> add want: netip.Addr{},
name: "bad_output", | opts: options{bindHost: netip.MustParseAddr("1.2.3.4")}, | opts: options{workDir: "path"},
}, {
name: "bind_host",
opts: options{bindHost: netip.MustParseAddr("1.2.3.4")},
args: []string{"-h", "1.2.3.4"},
}, {
name: "bind_port",
args: []string{"-p", "666"},
opts: options{bindPort: 666},
}, { | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options_test.go |
opts: options{workDir: "path"},
}, {
name: "bind_host",
args: []string{"-h", "1.2.3.4"},
opts: options{bindHost: net.IP{1, 2, 3, 4}},
}, {
name: "bind_port",
args: []string{"-p", "666"},
opts: options{bindPort: 666},
}, {
| </s> remove want: net.IP{
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0x0, 0x0,
0x0, 0x0, 0xFF, 0xFF,
},
</s> add want: netip.MustParseAddr("::ffff"),
name: "success_v6", </s> remove want net.IP
</s> add want netip.Addr
name string </s> remove name: "success_v4",
</s> add </s> remove want: net.IP{1, 2, 3, 4}.To16(),
</s> add want: netip.MustParseAddr("1.2.3.4"),
name: "success_v4", | opts: options{workDir: "path"},
}, {
name: "bind_host",
args: []string{"-h", "1.2.3.4"},
}, {
name: "bind_port",
args: []string{"-p", "666"},
opts: options{bindPort: 666},
}, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/options_test.go |
|
import (
"context"
"crypto/tls"
"io/fs"
"net"
"net/http"
"sync"
"time"
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
| </s> remove "net"
</s> add </s> remove "net"
</s> add "net/netip" | import (
"context"
"crypto/tls"
"io/fs"
"net/http"
"sync"
"time"
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/web.go |
|
"io/fs"
"net/http"
"sync"
"time"
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
"github.com/AdguardTeam/AdGuardHome/internal/aghnet"
"github.com/AdguardTeam/AdGuardHome/internal/aghtls"
| </s> remove "net"
</s> add | "net/netip" | "io/fs"
"net/http"
"net/netip"
"sync"
"time"
"github.com/AdguardTeam/AdGuardHome/internal/aghhttp"
"github.com/AdguardTeam/AdGuardHome/internal/aghnet"
"github.com/AdguardTeam/AdGuardHome/internal/aghtls" | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/web.go |
type webConfig struct {
clientFS fs.FS
clientBetaFS fs.FS
BindHost net.IP
BindPort int
BetaBindPort int
PortHTTPS int
// ReadTimeout is an option to pass to http.Server for setting an
| </s> remove BindHost net.IP `yaml:"bind_host"` // BindHost is the IP address of the HTTP server to bind to
BindPort int `yaml:"bind_port"` // BindPort is the port the HTTP server
BetaBindPort int `yaml:"beta_bind_port"` // BetaBindPort is the port for new client
Users []webUser `yaml:"users"` // Users that can access HTTP server
</s> add // BindHost is the address for the web interface server to listen on.
BindHost netip.Addr `yaml:"bind_host"`
// BindPort is the port for the web interface server to listen on.
BindPort int `yaml:"bind_port"`
// BetaBindPort is the port for the new client's web interface server to
// listen on.
BetaBindPort int `yaml:"beta_bind_port"`
// Users are the clients capable for accessing the web interface.
Users []webUser `yaml:"users"` </s> remove IP net.IP `json:"ip"`
Port int `json:"port"`
</s> add IP netip.Addr `json:"ip"`
Port int `json:"port"` </s> remove IP net.IP `json:"ip"`
Port int `json:"port"`
Autofix bool `json:"autofix"`
</s> add IP netip.Addr `json:"ip"`
Port int `json:"port"`
Autofix bool `json:"autofix"` </s> remove IP []net.IP `json:"ip"`
Port int `json:"port"`
</s> add IP []netip.Addr `json:"ip"`
Port int `json:"port"` </s> remove BindHosts []net.IP `yaml:"bind_hosts"`
Port int `yaml:"port"`
</s> add BindHosts []netip.Addr `yaml:"bind_hosts"`
Port int `yaml:"port"` | BindHost netip.Addr | type webConfig struct {
clientFS fs.FS
clientBetaFS fs.FS
BindHost netip.Addr
BindPort int
BetaBindPort int
PortHTTPS int
// ReadTimeout is an option to pass to http.Server for setting an | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/web.go |
// available, unless the HTTPS server isn't active.
//
// TODO(a.garipov): Adapt for HTTP/3.
func webCheckPortAvailable(port int) (ok bool) {
return Context.web.httpsServer.server != nil ||
aghnet.CheckPort("tcp", config.BindHost, port) == nil
}
// TLSConfigChanged updates the TLS configuration and restarts the HTTPS server
// if necessary.
func (web *Web) TLSConfigChanged(ctx context.Context, tlsConf tlsConfigSettings) {
| </s> remove func newDNSCrypt(hosts []net.IP, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) {
</s> add func newDNSCrypt(hosts []netip.Addr, tlsConf tlsConfigSettings) (dnscc dnsforward.DNSCryptConfig, err error) { </s> remove if !sid.Equal(s.conf.dnsIPAddrs[0]) {
</s> add if !sid.Equal(s.conf.dnsIPAddrs[0].AsSlice()) { </s> remove config.DNS.BindHosts = []net.IP{req.DNS.IP}
</s> add config.DNS.BindHosts = []netip.Addr{req.DNS.IP} </s> remove defaultIP := net.IP{192, 168, 1, 1}
</s> add defaultIP := netip.MustParseAddr("192.168.1.1") </s> remove if !s.conf.subnet.Contains(reqIP) {
</s> add if !s.conf.subnet.Contains(netip.AddrFrom4(*(*[4]byte)(ip4))) { | if Context.web.httpsServer.server != nil {
return true
}
return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil | // available, unless the HTTPS server isn't active.
//
// TODO(a.garipov): Adapt for HTTP/3.
func webCheckPortAvailable(port int) (ok bool) {
if Context.web.httpsServer.server != nil {
return true
}
return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil
if Context.web.httpsServer.server != nil {
return true
}
return aghnet.CheckPort("tcp", netip.AddrPortFrom(config.BindHost, uint16(port))) == nil
}
// TLSConfigChanged updates the TLS configuration and restarts the HTTPS server
// if necessary.
func (web *Web) TLSConfigChanged(ctx context.Context, tlsConf tlsConfigSettings) { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: Migrate to netip.Addr vol.1
Merge in DNS/adguard-home from 2926-lla-v6 to master
Updates #2926.
Updates #5035.
Squashed commit of the following:
commit 2e770d4b6d4e1ec3f7762f2f2466662983bf146c
Merge: 25c1afc5 893358ea
Author: Eugene Burkov <[email protected]>
Date: Fri Oct 14 15:14:56 2022 +0300
Merge branch 'master' into 2926-lla-v6
commit 25c1afc5f0a5027fafac9dee77618886aefee29c
Author: Eugene Burkov <[email protected]>
Date: Thu Oct 13 18:24:20 2022 +0300
all: imp code, docs
commit 59549c4f74ee17b10eae542d1f1828d4e59894c9
Author: Eugene Burkov <[email protected]>
Date: Tue Oct 11 18:49:09 2022 +0300
dhcpd: use netip initially
commit 1af623096b0517d07752385540f2f750f7f5b3bb
Author: Eugene Burkov <[email protected]>
Date: Fri Sep 30 18:03:52 2022 +0300
all: imp docs, code
commit e9faeb71dbc0e887b25a7f3d5b33a401805f2ae7
Author: Eugene Burkov <[email protected]>
Date: Thu Sep 29 14:56:37 2022 +0300
all: use netip for web
commit 38305e555a6884c3bd1b0839330b942ce0e59093
Author: Eugene Burkov <[email protected]>
Date: Wed Sep 28 19:13:58 2022 +0300
add basic lla | https://github.com/AdguardTeam/AdGuardHome/commit/4582b1c9198dcbc1927b74080839e81ba347265a | internal/home/web.go |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Card from '../ui/Card';
class UserRules extends Component {
handleChange = (e) => {
const { value } = e.currentTarget;
| </s> remove export default class UserRules extends Component {
</s> add class UserRules extends Component { | import { Trans, withNamespaces } from 'react-i18next'; | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Trans, withNamespaces } from 'react-i18next';
import Card from '../ui/Card';
class UserRules extends Component {
handleChange = (e) => {
const { value } = e.currentTarget; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Card from '../ui/Card';
export default class UserRules extends Component {
handleChange = (e) => {
const { value } = e.currentTarget;
this.props.handleRulesChange(value);
};
| </s> | class UserRules extends Component { | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import Card from '../ui/Card';
class UserRules extends Component {
handleChange = (e) => {
const { value } = e.currentTarget;
this.props.handleRulesChange(value);
};
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
render() {
return (
<Card
title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') }
| </s> remove title="Custom filtering rules"
subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax."
</s> add title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> remove title="Filters and hosts blocklists"
subtitle="AdGuard Home understands basic adblock rules and hosts files syntax."
</s> add title={ t('Filters and hosts blocklists') }
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') } </s> remove title="New filter subscription"
inputDescription="Enter a valid URL to a filter subscription or a hosts file."
</s> add title={ t('New filter subscription') }
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> | const { t } = this.props; |
render() {
const { t } = this.props;
return (
<Card
title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
render() {
return (
<Card
title="Custom filtering rules"
subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax."
>
<form onSubmit={this.handleSubmit}>
<textarea className="form-control form-control--textarea-large" value={this.props.userRules} onChange={this.handleChange} />
<div className="card-actions">
<button
| </s> remove title="Filters and hosts blocklists"
subtitle="AdGuard Home understands basic adblock rules and hosts files syntax."
</s> add title={ t('Filters and hosts blocklists') }
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') } </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> </s> remove title="New filter subscription"
inputDescription="Enter a valid URL to a filter subscription or a hosts file."
</s> add title={ t('New filter subscription') }
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } | title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } |
render() {
return (
<Card
title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') }
title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') }
>
<form onSubmit={this.handleSubmit}>
<textarea className="form-control form-control--textarea-large" value={this.props.userRules} onChange={this.handleChange} />
<div className="card-actions">
<button | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
className="btn btn-success btn-standart"
type="submit"
onClick={this.handleSubmit}
>
Apply
</button>
</div>
</form>
<hr/>
<div className="list leading-loose">
| </s> remove Examples:
</s> add <Trans>Examples</Trans>: </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove noDataText="No filters added"
</s> add noDataText={ t('No filters added') } </s> remove {buttonText}
</s> add <Trans>{buttonText}</Trans> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> | <Trans>Apply</Trans> | className="btn btn-success btn-standart"
type="submit"
onClick={this.handleSubmit}
>
<Trans>Apply</Trans>
</button>
</div>
</form>
<hr/>
<div className="list leading-loose"> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
</div>
</form>
<hr/>
<div className="list leading-loose">
Examples:
<ol className="leading-loose">
<li>
<code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</li>
| </s> remove <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove <code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove Apply
</s> add <Trans>Apply</Trans> </s> remove <code>! Here goes a comment</code> - just a comment
</s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } | <Trans>Examples</Trans>: | </div>
</form>
<hr/>
<div className="list leading-loose">
<Trans>Examples</Trans>:
<ol className="leading-loose">
<li>
<code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</li> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
<div className="list leading-loose">
Examples:
<ol className="leading-loose">
<li>
<code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</li>
<li>
<code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</li>
| </s> remove <code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove Examples:
</s> add <Trans>Examples</Trans>: </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove <code>! Here goes a comment</code> - just a comment
</s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code># Also a comment</code> - just a comment
</s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } | <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } | <div className="list leading-loose">
Examples:
<ol className="leading-loose">
<li>
<code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') }
<code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') }
</li>
<li>
<code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</li> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
<code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</li>
<li>
<code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</li>
<li>
<code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</li>
| </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove Examples:
</s> add <Trans>Examples</Trans>: </s> remove <code>! Here goes a comment</code> - just a comment
</s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code># Also a comment</code> - just a comment
</s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } | <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } | <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</li>
<li>
<code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') }
<code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') }
</li>
<li>
<code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</li> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
<code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</li>
<li>
<code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</li>
<li>
<code>! Here goes a comment</code> - just a comment
</li>
<li>
| </s> remove <code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>! Here goes a comment</code> - just a comment
</s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove Examples:
</s> add <Trans>Examples</Trans>: </s> remove <code># Also a comment</code> - just a comment
</s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } | <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } | <code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</li>
<li>
<code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') }
<code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') }
</li>
<li>
<code>! Here goes a comment</code> - just a comment
</li>
<li> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
<code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</li>
<li>
<code>! Here goes a comment</code> - just a comment
</li>
<li>
<code># Also a comment</code> - just a comment
</li>
</ol>
| </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove <code># Also a comment</code> - just a comment
</s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } </s> remove <code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } </s> remove Examples:
</s> add <Trans>Examples</Trans>: | <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } | <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</li>
<li>
<code>{ t('! Here goes a comment') }</code> - { t('just a comment') }
</li>
<li>
<code># Also a comment</code> - just a comment
</li>
</ol> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
<li>
<code>! Here goes a comment</code> - just a comment
</li>
<li>
<code># Also a comment</code> - just a comment
</li>
</ol>
</div>
</Card>
);
| </s> remove <code>! Here goes a comment</code> - just a comment
</s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } </s> remove title="New filter subscription"
inputDescription="Enter a valid URL to a filter subscription or a hosts file."
</s> add title={ t('New filter subscription') }
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } </s> remove <code> @@||example.org^</code> - unblock access to the example.org
domain and all its subdomains
</s> add <code> @@||example.org^</code> - { t('unblock access to the example.org domain and all its subdomains') } </s> remove <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } | <code>{ t('# Also a comment') }</code> - { t('just a comment') } | <li>
<code>! Here goes a comment</code> - just a comment
</li>
<li>
<code>{ t('# Also a comment') }</code> - { t('just a comment') }
</li>
</ol>
</div>
</Card>
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
userRules: PropTypes.string,
handleRulesChange: PropTypes.func,
handleRulesSubmit: PropTypes.func,
};
export default withNamespaces()(UserRules);
| </s> remove export default Logs;
</s> add export default withNamespaces()(Logs); </s> remove export default Filters;
</s> add export default withNamespaces()(Filters); | t: PropTypes.func, | userRules: PropTypes.string,
handleRulesChange: PropTypes.func,
handleRulesSubmit: PropTypes.func,
t: PropTypes.func,
};
export default withNamespaces()(UserRules); | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/UserRules.js |
import React, { Component } from 'react';
import ReactTable from 'react-table';
import PropTypes from 'prop-types';
import Modal from '../ui/Modal';
import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card';
import UserRules from './UserRules';
import './Filters.css';
| </s> remove export default class UserRules extends Component {
</s> add class UserRules extends Component { | import { Trans, withNamespaces } from 'react-i18next'; | import React, { Component } from 'react';
import ReactTable from 'react-table';
import PropTypes from 'prop-types';
import { Trans, withNamespaces } from 'react-i18next';
import Modal from '../ui/Modal';
import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card';
import UserRules from './UserRules';
import './Filters.css'; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
);
};
columns = [{
Header: 'Enabled',
accessor: 'enabled',
Cell: this.renderCheckbox,
width: 90,
className: 'text-center',
}, {
| </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Actions',
</s> add Header: this.props.t('Actions'), </s> remove Header: 'Last time updated',
</s> add Header: this.props.t('Last time updated'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Time',
</s> add Header: t('Time'), | Header: this.props.t('Enabled'), | );
};
columns = [{
Header: this.props.t('Enabled'),
accessor: 'enabled',
Cell: this.renderCheckbox,
width: 90,
className: 'text-center',
}, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
Cell: this.renderCheckbox,
width: 90,
className: 'text-center',
}, {
Header: 'Name',
accessor: 'name',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
}, {
Header: 'Filter URL',
accessor: 'url',
| </s> remove Header: 'Filter URL',
</s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Rules count',
</s> add Header: this.props.t('Rules count'), </s> remove Header: 'Enabled',
</s> add Header: this.props.t('Enabled'), </s> remove Header: 'Actions',
</s> add Header: this.props.t('Actions'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), | Header: this.props.t('Name'), | Cell: this.renderCheckbox,
width: 90,
className: 'text-center',
}, {
Header: this.props.t('Name'),
accessor: 'name',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
}, {
Header: 'Filter URL',
accessor: 'url', | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
Header: 'Name',
accessor: 'name',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
}, {
Header: 'Filter URL',
accessor: 'url',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><a href={value} target='_blank' rel='noopener noreferrer' className="link logs__text">{value}</a></div>),
}, {
Header: 'Rules count',
accessor: 'rulesCount',
| </s> remove Header: 'Rules count',
</s> add Header: this.props.t('Rules count'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Time',
</s> add Header: t('Time'), </s> remove Header: 'Domain name',
</s> add Header: t('Domain name'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), | Header: this.props.t('Filter URL'), | Header: 'Name',
accessor: 'name',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><span className="logs__text" title={value}>{value}</span></div>),
}, {
Header: this.props.t('Filter URL'),
accessor: 'url',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><a href={value} target='_blank' rel='noopener noreferrer' className="link logs__text">{value}</a></div>),
}, {
Header: 'Rules count',
accessor: 'rulesCount', | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
Header: 'Filter URL',
accessor: 'url',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><a href={value} target='_blank' rel='noopener noreferrer' className="link logs__text">{value}</a></div>),
}, {
Header: 'Rules count',
accessor: 'rulesCount',
className: 'text-center',
Cell: props => props.value.toLocaleString(),
}, {
Header: 'Last time updated',
| </s> remove Header: 'Filter URL',
</s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Last time updated',
</s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Actions',
</s> add Header: this.props.t('Actions'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), | Header: this.props.t('Rules count'), | Header: 'Filter URL',
accessor: 'url',
Cell: ({ value }) => (<div className="logs__row logs__row--overflow"><a href={value} target='_blank' rel='noopener noreferrer' className="link logs__text">{value}</a></div>),
}, {
Header: this.props.t('Rules count'),
accessor: 'rulesCount',
className: 'text-center',
Cell: props => props.value.toLocaleString(),
}, {
Header: 'Last time updated', | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
accessor: 'rulesCount',
className: 'text-center',
Cell: props => props.value.toLocaleString(),
}, {
Header: 'Last time updated',
accessor: 'lastUpdated',
className: 'text-center',
}, {
Header: 'Actions',
accessor: 'url',
| </s> remove Header: 'Actions',
</s> add Header: this.props.t('Actions'), </s> remove Header: 'Rules count',
</s> add Header: this.props.t('Rules count'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Enabled',
</s> add Header: this.props.t('Enabled'), | Header: this.props.t('Last time updated'), | accessor: 'rulesCount',
className: 'text-center',
Cell: props => props.value.toLocaleString(),
}, {
Header: this.props.t('Last time updated'),
accessor: 'lastUpdated',
className: 'text-center',
}, {
Header: 'Actions',
accessor: 'url', | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
Header: 'Last time updated',
accessor: 'lastUpdated',
className: 'text-center',
}, {
Header: 'Actions',
accessor: 'url',
Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
className: 'text-center',
width: 75,
sortable: false,
| </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), </s> remove Header: 'Last time updated',
</s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Rules count',
</s> add Header: this.props.t('Rules count'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Enabled',
</s> add Header: this.props.t('Enabled'), | Header: this.props.t('Actions'), | Header: 'Last time updated',
accessor: 'lastUpdated',
className: 'text-center',
}, {
Header: this.props.t('Actions'),
accessor: 'url',
Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
className: 'text-center',
width: 75,
sortable: false, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
className: 'text-center',
}, {
Header: 'Actions',
accessor: 'url',
Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
className: 'text-center',
width: 75,
sortable: false,
},
];
| </s> remove Header: 'Actions',
</s> add Header: this.props.t('Actions'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Last time updated',
</s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Rules count',
</s> add Header: this.props.t('Rules count'), </s> remove Header: 'Enabled',
</s> add Header: this.props.t('Enabled'), | Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), | className: 'text-center',
}, {
Header: 'Actions',
accessor: 'url',
Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
className: 'text-center',
width: 75,
sortable: false,
},
]; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
},
];
render() {
const { filters, userRules } = this.props.filtering;
return (
<div>
<PageTitle title={ t('Filters') } />
<div className="content">
| </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries">
</s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }> </s> remove <input type="text" className={inputNameClass} placeholder="Enter name" onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder="Enter URL" onChange={this.handleUrlChange} />
</s> add <input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} /> | const { t } = this.props; | },
];
render() {
const { t } = this.props;
const { filters, userRules } = this.props.filtering;
return (
<div>
<PageTitle title={ t('Filters') } />
<div className="content"> | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
render() {
const { filters, userRules } = this.props.filtering;
return (
<div>
<PageTitle title="Filters" />
<div className="content">
<div className="row">
<div className="col-md-12">
<Card
title="Filters and hosts blocklists"
| </s> remove title="Filters and hosts blocklists"
subtitle="AdGuard Home understands basic adblock rules and hosts files syntax."
</s> add title={ t('Filters and hosts blocklists') }
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') } </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; </s> remove title="Custom filtering rules"
subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax."
</s> add title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } | <PageTitle title={ t('Filters') } /> | render() {
const { filters, userRules } = this.props.filtering;
return (
<div>
<PageTitle title={ t('Filters') } />
<div className="content">
<div className="row">
<div className="col-md-12">
<Card
title="Filters and hosts blocklists" | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
<div className="content">
<div className="row">
<div className="col-md-12">
<Card
title="Filters and hosts blocklists"
subtitle="AdGuard Home understands basic adblock rules and hosts files syntax."
>
<ReactTable
data={filters}
columns={this.columns}
showPagination={false}
| </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> </s> remove title="Custom filtering rules"
subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax."
</s> add title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> remove noDataText="No filters added"
</s> add noDataText={ t('No filters added') } </s> remove <code>||example.org^</code> - block access to the example.org domain
and all its subdomains
</s> add <code>||example.org^</code> - { t('block access to the example.org domain and all its subdomains') } | title={ t('Filters and hosts blocklists') }
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') } | <div className="content">
<div className="row">
<div className="col-md-12">
<Card
title={ t('Filters and hosts blocklists') }
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') }
title={ t('Filters and hosts blocklists') }
subtitle={ t('AdGuard Home understands basic adblock rules and hosts files syntax.') }
>
<ReactTable
data={filters}
columns={this.columns}
showPagination={false} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
<ReactTable
data={filters}
columns={this.columns}
showPagination={false}
noDataText="No filters added"
minRows={4} // TODO find out what to show if rules.length is 0
/>
<div className="card-actions">
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
| </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove >Disable log</button>
</s> add ><Trans>Disable log</Trans></button> </s> remove >Download log file</button>
</s> add ><Trans>Download log file</Trans></button> </s> remove Apply
</s> add <Trans>Apply</Trans> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> | noDataText={ t('No filters added') } | <ReactTable
data={filters}
columns={this.columns}
showPagination={false}
noDataText={ t('No filters added') }
minRows={4} // TODO find out what to show if rules.length is 0
/>
<div className="card-actions">
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
noDataText="No filters added"
minRows={4} // TODO find out what to show if rules.length is 0
/>
<div className="card-actions">
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</div>
</Card>
</div>
<div className="col-md-12">
<UserRules
| </s> remove noDataText="No filters added"
</s> add noDataText={ t('No filters added') } </s> remove >Disable log</button>
</s> add ><Trans>Disable log</Trans></button> </s> remove >Download log file</button>
</s> add ><Trans>Download log file</Trans></button> </s> remove Apply
</s> add <Trans>Apply</Trans> </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button>
</s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> | <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> | noDataText="No filters added"
minRows={4} // TODO find out what to show if rules.length is 0
/>
<div className="card-actions">
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button>
<button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button>
</div>
</Card>
</div>
<div className="col-md-12">
<UserRules | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
isOpen={this.props.filtering.isFilteringModalOpen}
toggleModal={this.props.toggleFilteringModal}
addFilter={this.props.addFilter}
isFilterAdded={this.props.filtering.isFilterAdded}
title="New filter subscription"
inputDescription="Enter a valid URL to a filter subscription or a hosts file."
/>
</div>
);
}
}
| </s> remove <code># Also a comment</code> - just a comment
</s> add <code>{ t('# Also a comment') }</code> - { t('just a comment') } </s> remove title="Custom filtering rules"
subtitle="Enter one rule on a line. You can use either adblock rules or hosts files syntax."
</s> add title={ t('Custom filtering rules') }
subtitle={ t('Enter one rule on a line. You can use either adblock rules or hosts files syntax.') } </s> remove <code>! Here goes a comment</code> - just a comment
</s> add <code>{ t('! Here goes a comment') }</code> - { t('just a comment') } </s> remove <code>127.0.0.1 example.org</code> - AdGuard Home will now return
127.0.0.1 address for the example.org domain (but not its subdomains).
</s> add <code>127.0.0.1 example.org</code> - { t('AdGuard Home will now return 127.0.0.1 address for the example.org domain (but not its subdomains).') } | title={ t('New filter subscription') }
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') } | isOpen={this.props.filtering.isFilteringModalOpen}
toggleModal={this.props.toggleFilteringModal}
addFilter={this.props.addFilter}
isFilterAdded={this.props.filtering.isFilterAdded}
title={ t('New filter subscription') }
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') }
title={ t('New filter subscription') }
inputDescription={ t('Enter a valid URL to a filter subscription or a hosts file.') }
/>
</div>
);
}
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
addFilter: PropTypes.func.isRequired,
toggleFilteringModal: PropTypes.func.isRequired,
handleRulesChange: PropTypes.func.isRequired,
refreshFilters: PropTypes.func.isRequired,
};
export default withNamespaces()(Filters);
| </s> remove export default Filters;
</s> add export default withNamespaces()(Filters); </s> remove export default Logs;
</s> add export default withNamespaces()(Logs); | t: PropTypes.func, | addFilter: PropTypes.func.isRequired,
toggleFilteringModal: PropTypes.func.isRequired,
handleRulesChange: PropTypes.func.isRequired,
refreshFilters: PropTypes.func.isRequired,
t: PropTypes.func,
};
export default withNamespaces()(Filters); | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
refreshFilters: PropTypes.func.isRequired,
};
export default Filters;
| </s> remove export default Logs;
</s> add export default withNamespaces()(Logs); | export default withNamespaces()(Filters); | refreshFilters: PropTypes.func.isRequired,
};
export default withNamespaces()(Filters); | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Filters/index.js |
import { saveAs } from 'file-saver/FileSaver';
import escapeRegExp from 'lodash/escapeRegExp';
import endsWith from 'lodash/endsWith';
import { formatTime } from '../../helpers/helpers';
import { getTrackerData } from '../../helpers/trackers/trackers';
import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card';
import Loading from '../ui/Loading';
| </s> remove export default class UserRules extends Component {
</s> add class UserRules extends Component { | import { Trans, withNamespaces } from 'react-i18next'; | import { saveAs } from 'file-saver/FileSaver';
import escapeRegExp from 'lodash/escapeRegExp';
import endsWith from 'lodash/endsWith';
import { Trans, withNamespaces } from 'react-i18next';
import { formatTime } from '../../helpers/helpers';
import { getTrackerData } from '../../helpers/trackers/trackers';
import PageTitle from '../ui/PageTitle';
import Card from '../ui/Card';
import Loading from '../ui/Loading'; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
type="button"
className={`btn btn-sm ${buttonClass}`}
onClick={() => this.toggleBlocking(buttonText.toLowerCase(), domain)}
>
{buttonText}
</button>
</div>
);
}
| </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button>
</s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> </s> remove Apply
</s> add <Trans>Apply</Trans> </s> remove Url added successfully
</s> add <Trans>Url added successfully</Trans> </s> remove >Disable log</button>
</s> add ><Trans>Disable log</Trans></button> | <Trans>{buttonText}</Trans> | type="button"
className={`btn btn-sm ${buttonClass}`}
onClick={() => this.toggleBlocking(buttonText.toLowerCase(), domain)}
>
<Trans>{buttonText}</Trans>
</button>
</div>
);
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
);
}
renderLogs(logs) {
const columns = [{
Header: t('Time'),
accessor: 'time',
maxWidth: 110,
filterable: false,
| </s> remove Header: 'Time',
</s> add Header: t('Time'), </s> remove Header: 'Domain name',
</s> add Header: t('Domain name'), </s> remove Header: 'Enabled',
</s> add Header: this.props.t('Enabled'), </s> remove Header: 'Response',
</s> add Header: t('Response'), </s> remove Header: 'Type',
</s> add Header: t('Type'), | const { t } = this.props; | );
}
renderLogs(logs) {
const { t } = this.props;
const columns = [{
Header: t('Time'),
accessor: 'time',
maxWidth: 110,
filterable: false, | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
}
renderLogs(logs) {
const columns = [{
Header: 'Time',
accessor: 'time',
maxWidth: 110,
filterable: false,
Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>),
}, {
| </s> remove Header: 'Domain name',
</s> add Header: t('Domain name'), </s> remove Header: 'Filter URL',
</s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Cell: ({ value }) => (<span className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>),
</s> add Cell: ({ value }) => (<span title={ this.props.t('Delete') } className='remove-icon fe fe-trash-2' onClick={() => this.props.removeFilter(value)}/>), | Header: t('Time'), | }
renderLogs(logs) {
const columns = [{
Header: t('Time'),
accessor: 'time',
maxWidth: 110,
filterable: false,
Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>),
}, { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
maxWidth: 110,
filterable: false,
Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>),
}, {
Header: 'Domain name',
accessor: 'domain',
Cell: (row) => {
const response = row.value;
const trackerData = getTrackerData(response);
| </s> remove Header: 'Time',
</s> add Header: t('Time'), </s> remove Header: 'Filter URL',
</s> add Header: this.props.t('Filter URL'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Response',
</s> add Header: t('Response'), | Header: t('Domain name'), | maxWidth: 110,
filterable: false,
Cell: ({ value }) => (<div className="logs__row"><span className="logs__text" title={value}>{formatTime(value)}</span></div>),
}, {
Header: t('Domain name'),
accessor: 'domain',
Cell: (row) => {
const response = row.value;
const trackerData = getTrackerData(response);
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
</div>
);
},
}, {
Header: 'Type',
accessor: 'type',
maxWidth: 60,
}, {
Header: 'Response',
accessor: 'response',
| </s> remove Header: 'Response',
</s> add Header: t('Response'), </s> remove Header: 'Last time updated',
</s> add Header: this.props.t('Last time updated'), </s> remove Header: 'Enabled',
</s> add Header: this.props.t('Enabled'), </s> remove Header: 'Name',
</s> add Header: this.props.t('Name'), </s> remove Header: 'Time',
</s> add Header: t('Time'), | Header: t('Type'), | </div>
);
},
}, {
Header: t('Type'),
accessor: 'type',
maxWidth: 60,
}, {
Header: 'Response',
accessor: 'response', | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
Header: 'Type',
accessor: 'type',
maxWidth: 60,
}, {
Header: 'Response',
accessor: 'response',
Cell: (row) => {
const responses = row.value;
const { reason } = row.original;
const isFiltered = row ? reason.indexOf('Filtered') === 0 : false;
| </s> remove Header: 'Client',
</s> add Header: t('Client'), </s> remove Header: 'Type',
</s> add Header: t('Type'), </s> remove Header: 'Domain name',
</s> add Header: t('Domain name'), </s> remove Header: 'Time',
</s> add Header: t('Time'), | Header: t('Response'), | Header: 'Type',
accessor: 'type',
maxWidth: 60,
}, {
Header: t('Response'),
accessor: 'response',
Cell: (row) => {
const responses = row.value;
const { reason } = row.original;
const isFiltered = row ? reason.indexOf('Filtered') === 0 : false; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
}
return (
<div className="logs__row">
{this.renderTooltip(isFiltered, rule)}
<span>Empty</span>
</div>
);
},
filterMethod: (filter, row) => {
if (filter.value === 'filtered') {
| </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; </s> remove <input type="text" className={inputNameClass} placeholder="Enter name" onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder="Enter URL" onChange={this.handleUrlChange} />
</s> add <input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} /> </s> remove Url added successfully
</s> add <Trans>Url added successfully</Trans> </s> remove Header: 'Type',
</s> add Header: t('Type'), | <span><Trans>Empty</Trans></span> | }
return (
<div className="logs__row">
{this.renderTooltip(isFiltered, rule)}
<span><Trans>Empty</Trans></span>
</div>
);
},
filterMethod: (filter, row) => {
if (filter.value === 'filtered') { | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
onChange={event => onChange(event.target.value)}
className="form-control"
value={filter ? filter.value : 'all'}
>
<option value="all">Show all</option>
<option value="filtered">Show filtered</option>
</select>,
}, {
Header: 'Client',
accessor: 'client',
maxWidth: 250,
| </s> remove Header: 'Client',
</s> add Header: t('Client'), </s> remove Header: 'Response',
</s> add Header: t('Response'), </s> remove Header: 'Type',
</s> add Header: t('Type'), </s> remove Header: 'Time',
</s> add Header: t('Time'), </s> remove Header: 'Domain name',
</s> add Header: t('Domain name'), | <option value="all">{ t('Show all') }</option>
<option value="filtered">{ t('Show filtered') }</option> | onChange={event => onChange(event.target.value)}
className="form-control"
value={filter ? filter.value : 'all'}
>
<option value="all">{ t('Show all') }</option>
<option value="filtered">{ t('Show filtered') }</option>
<option value="all">{ t('Show all') }</option>
<option value="filtered">{ t('Show filtered') }</option>
</select>,
}, {
Header: 'Client',
accessor: 'client',
maxWidth: 250, | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
<option value="all">Show all</option>
<option value="filtered">Show filtered</option>
</select>,
}, {
Header: 'Client',
accessor: 'client',
maxWidth: 250,
Cell: (row) => {
const { reason } = row.original;
const isFiltered = row ? reason.indexOf('Filtered') === 0 : false;
| </s> remove <option value="all">Show all</option>
<option value="filtered">Show filtered</option>
</s> add <option value="all">{ t('Show all') }</option>
<option value="filtered">{ t('Show filtered') }</option> </s> remove Header: 'Response',
</s> add Header: t('Response'), </s> remove Header: 'Domain name',
</s> add Header: t('Domain name'), </s> remove Header: 'Time',
</s> add Header: t('Time'), | Header: t('Client'), | <option value="all">Show all</option>
<option value="filtered">Show filtered</option>
</select>,
}, {
Header: t('Client'),
accessor: 'client',
maxWidth: 250,
Cell: (row) => {
const { reason } = row.original;
const isFiltered = row ? reason.indexOf('Filtered') === 0 : false; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
columns={columns}
showPagination={true}
defaultPageSize={50}
minRows={7}
noDataText="No logs found"
defaultFilterMethod={(filter, row) => {
const id = filter.pivotId || filter.id;
return row[id] !== undefined ?
String(row[id]).indexOf(filter.value) !== -1 : true;
}}
| </s> remove Header: 'Response',
</s> add Header: t('Response'), </s> remove Header: 'Client',
</s> add Header: t('Client'), </s> remove <span>Empty</span>
</s> add <span><Trans>Empty</Trans></span> </s> remove <option value="all">Show all</option>
<option value="filtered">Show filtered</option>
</s> add <option value="all">{ t('Show all') }</option>
<option value="filtered">{ t('Show filtered') }</option> | // Text
previousText={ t('Previous') }
nextText={ t('Next') }
loadingText={ t('Loading...') }
pageText={ t('Page') }
ofText={ t('of') }
rowsText={ t('rows') }
noDataText={ t('No logs found') } | columns={columns}
showPagination={true}
defaultPageSize={50}
minRows={7}
// Text
previousText={ t('Previous') }
nextText={ t('Next') }
loadingText={ t('Loading...') }
pageText={ t('Page') }
ofText={ t('of') }
rowsText={ t('rows') }
noDataText={ t('No logs found') }
defaultFilterMethod={(filter, row) => {
const id = filter.pivotId || filter.id;
return row[id] !== undefined ?
String(row[id]).indexOf(filter.value) !== -1 : true;
}} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
<button
className="btn btn-gray btn-sm mr-2"
type="submit"
onClick={() => this.props.toggleLogStatus(queryLogEnabled)}
>Disable log</button>
<button
className="btn btn-primary btn-sm mr-2"
type="submit"
onClick={this.handleDownloadButton}
>Download log file</button>
| </s> remove >Download log file</button>
</s> add ><Trans>Download log file</Trans></button> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove noDataText="No filters added"
</s> add noDataText={ t('No filters added') } </s> remove >Refresh</button>
</s> add ><Trans>Refresh</Trans></button> | ><Trans>Disable log</Trans></button> | <button
className="btn btn-gray btn-sm mr-2"
type="submit"
onClick={() => this.props.toggleLogStatus(queryLogEnabled)}
><Trans>Disable log</Trans></button>
<button
className="btn btn-primary btn-sm mr-2"
type="submit"
onClick={this.handleDownloadButton}
>Download log file</button> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
<button
className="btn btn-primary btn-sm mr-2"
type="submit"
onClick={this.handleDownloadButton}
>Download log file</button>
<button
className="btn btn-outline-primary btn-sm"
type="submit"
onClick={this.getLogs}
>Refresh</button>
| </s> remove >Disable log</button>
</s> add ><Trans>Disable log</Trans></button> </s> remove >Refresh</button>
</s> add ><Trans>Refresh</Trans></button> </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove noDataText="No filters added"
</s> add noDataText={ t('No filters added') } </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> | ><Trans>Download log file</Trans></button> | <button
className="btn btn-primary btn-sm mr-2"
type="submit"
onClick={this.handleDownloadButton}
><Trans>Download log file</Trans></button>
<button
className="btn btn-outline-primary btn-sm"
type="submit"
onClick={this.getLogs}
>Refresh</button> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
<button
className="btn btn-outline-primary btn-sm"
type="submit"
onClick={this.getLogs}
>Refresh</button>
</Fragment>
);
}
return (
| </s> remove >Download log file</button>
</s> add ><Trans>Download log file</Trans></button> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove >Disable log</button>
</s> add ><Trans>Disable log</Trans></button> </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button>
</s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> | ><Trans>Refresh</Trans></button> | <button
className="btn btn-outline-primary btn-sm"
type="submit"
onClick={this.getLogs}
><Trans>Refresh</Trans></button>
</Fragment>
);
}
return ( | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
<button
className="btn btn-success btn-sm mr-2"
type="submit"
onClick={() => this.props.toggleLogStatus(queryLogEnabled)}
>Enable log</button>
);
}
render() {
const { queryLogs, dashboard } = this.props;
| </s> remove >Disable log</button>
</s> add ><Trans>Disable log</Trans></button> </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; </s> remove >Download log file</button>
</s> add ><Trans>Download log file</Trans></button> </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries">
</s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }> | ><Trans>Enable log</Trans></button> | <button
className="btn btn-success btn-sm mr-2"
type="submit"
onClick={() => this.props.toggleLogStatus(queryLogEnabled)}
><Trans>Enable log</Trans></button>
);
}
render() {
const { queryLogs, dashboard } = this.props; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
);
}
render() {
const { queryLogs, dashboard } = this.props;
const { queryLogEnabled } = dashboard;
return (
<Fragment>
<PageTitle title="Query Log" subtitle="Last 5000 DNS queries">
<div className="page-title__actions">
| </s> remove <PageTitle title="Query Log" subtitle="Last 5000 DNS queries">
</s> add <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> | const { queryLogs, dashboard, t } = this.props; | );
}
render() {
const { queryLogs, dashboard, t } = this.props;
const { queryLogEnabled } = dashboard;
return (
<Fragment>
<PageTitle title="Query Log" subtitle="Last 5000 DNS queries">
<div className="page-title__actions"> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
const { queryLogs, dashboard } = this.props;
const { queryLogEnabled } = dashboard;
return (
<Fragment>
<PageTitle title="Query Log" subtitle="Last 5000 DNS queries">
<div className="page-title__actions">
{this.renderButtons(queryLogEnabled)}
</div>
</PageTitle>
<Card>
| </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> | <PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }> | const { queryLogs, dashboard } = this.props;
const { queryLogEnabled } = dashboard;
return (
<Fragment>
<PageTitle title={ t('Query Log') } subtitle={ t('Last 5000 DNS queries') }>
<div className="page-title__actions">
{this.renderButtons(queryLogEnabled)}
</div>
</PageTitle>
<Card> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
setRules: PropTypes.func,
addSuccessToast: PropTypes.func,
};
export default withNamespaces()(Logs);
| </s> remove export default Logs;
</s> add export default withNamespaces()(Logs); </s> remove export default Filters;
</s> add export default withNamespaces()(Filters); | t: PropTypes.func, | setRules: PropTypes.func,
addSuccessToast: PropTypes.func,
t: PropTypes.func,
};
export default withNamespaces()(Logs); | [
"keep",
"add",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
setRules: PropTypes.func,
addSuccessToast: PropTypes.func,
};
export default Logs;
| </s> remove export default Filters;
</s> add export default withNamespaces()(Filters); | export default withNamespaces()(Logs); | setRules: PropTypes.func,
addSuccessToast: PropTypes.func,
};
export default withNamespaces()(Logs); | [
"keep",
"keep",
"keep",
"keep",
"replace"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Logs/index.js |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class Toast extends Component {
componentDidMount() {
const timeout = this.props.type === 'error' ? 30000 : 5000;
| </s> remove export default class UserRules extends Component {
</s> add class UserRules extends Component { | import { Trans } from 'react-i18next'; | import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Trans } from 'react-i18next';
class Toast extends Component {
componentDidMount() {
const timeout = this.props.type === 'error' ? 30000 : 5000; | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Toasts/Toast.js |
render() {
return (
<div className={`toast toast--${this.props.type}`}>
<p className="toast__content">
{this.props.message}
</p>
<button className="toast__dismiss" onClick={() => this.props.removeToast(this.props.id)}>
<svg stroke="#fff" fill="none" width="20" height="20" strokeWidth="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m18 6-12 12"/><path d="m6 6 12 12"/></svg>
</button>
</div>
| </s> remove {buttonText}
</s> add <Trans>{buttonText}</Trans> </s> remove >Enable log</button>
</s> add ><Trans>Enable log</Trans></button> </s> remove Url added successfully
</s> add <Trans>Url added successfully</Trans> </s> remove <span>Empty</span>
</s> add <span><Trans>Empty</Trans></span> </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> | <Trans>{this.props.message}</Trans> | render() {
return (
<div className={`toast toast--${this.props.type}`}>
<p className="toast__content">
<Trans>{this.props.message}</Trans>
</p>
<button className="toast__dismiss" onClick={() => this.props.removeToast(this.props.id)}>
<svg stroke="#fff" fill="none" width="20" height="20" strokeWidth="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m18 6-12 12"/><path d="m6 6 12 12"/></svg>
</button>
</div> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/Toasts/Toast.js |
import ReactModal from 'react-modal';
import classnames from 'classnames';
import { R_URL_REQUIRES_PROTOCOL } from '../../helpers/constants';
import './Modal.css';
ReactModal.setAppElement('#root');
const initialState = {
| </s> remove export default class UserRules extends Component {
</s> add class UserRules extends Component { | import { Trans, withNamespaces } from 'react-i18next'; | import ReactModal from 'react-modal';
import classnames from 'classnames';
import { Trans, withNamespaces } from 'react-i18next';
import { R_URL_REQUIRES_PROTOCOL } from '../../helpers/constants';
import './Modal.css';
ReactModal.setAppElement('#root');
const initialState = { | [
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/ui/Modal.js |
name: '',
isUrlValid: false,
};
export default class Modal extends Component {
state = initialState;
// eslint-disable-next-line
isUrlValid = url => {
return R_URL_REQUIRES_PROTOCOL.test(url);
| </s> remove export default class UserRules extends Component {
</s> add class UserRules extends Component { </s> remove export default Filters;
</s> add export default withNamespaces()(Filters); </s> remove export default Logs;
</s> add export default withNamespaces()(Logs); | class Modal extends Component { | name: '',
isUrlValid: false,
};
class Modal extends Component {
state = initialState;
// eslint-disable-next-line
isUrlValid = url => {
return R_URL_REQUIRES_PROTOCOL.test(url); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/ui/Modal.js |
const renderBody = () => {
if (!this.props.isFilterAdded) {
return (
<React.Fragment>
<input type="text" className={inputNameClass} placeholder="Enter name" onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder="Enter URL" onChange={this.handleUrlChange} />
{inputDescription &&
<div className="description">
{inputDescription}
</div>}
</React.Fragment>
| </s> remove <PageTitle title="Filters" />
</s> add <PageTitle title={ t('Filters') } /> </s> remove Url added successfully
</s> add <Trans>Url added successfully</Trans> </s> remove <span>Empty</span>
</s> add <span><Trans>Empty</Trans></span> </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; | <input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} /> | const renderBody = () => {
if (!this.props.isFilterAdded) {
return (
<React.Fragment>
<input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} />
<input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} />
{inputDescription &&
<div className="description">
{inputDescription}
</div>}
</React.Fragment> | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/ui/Modal.js |
);
}
return (
<div className="description">
Url added successfully
</div>
);
};
const isValidForSubmit = !(url.length > 0 && isUrlValid && name.length > 0);
| </s> remove {buttonText}
</s> add <Trans>{buttonText}</Trans> </s> remove <button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button>
</s> add <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> </s> remove <input type="text" className={inputNameClass} placeholder="Enter name" onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder="Enter URL" onChange={this.handleUrlChange} />
</s> add <input type="text" className={inputNameClass} placeholder={ this.props.t('Enter name') } onChange={this.handleNameChange} />
<input type="text" className={inputUrlClass} placeholder={ this.props.t('Enter URL') } onChange={this.handleUrlChange} /> </s> remove <span>Empty</span>
</s> add <span><Trans>Empty</Trans></span> </s> remove const { queryLogs, dashboard } = this.props;
</s> add const { queryLogs, dashboard, t } = this.props; | <Trans>Url added successfully</Trans> | );
}
return (
<div className="description">
<Trans>Url added successfully</Trans>
</div>
);
};
const isValidForSubmit = !(url.length > 0 && isUrlValid && name.length > 0); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/ui/Modal.js |
</div>
{
!this.props.isFilterAdded &&
<div className="modal-footer">
<button type="button" className="btn btn-secondary" onClick={this.closeModal}>Cancel</button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}>Add filter</button>
</div>
}
</div>
</ReactModal>
);
| </s> remove <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}>Add filter</button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}>Check updates</button>
</s> add <button className="btn btn-success btn-standart mr-2" type="submit" onClick={this.props.toggleFilteringModal}><Trans>Add filter</Trans></button>
<button className="btn btn-primary btn-standart" type="submit" onClick={this.props.refreshFilters}><Trans>Check updates</Trans></button> </s> remove {buttonText}
</s> add <Trans>{buttonText}</Trans> </s> remove noDataText="No filters added"
</s> add noDataText={ t('No filters added') } </s> remove >Refresh</button>
</s> add ><Trans>Refresh</Trans></button> </s> remove Url added successfully
</s> add <Trans>Url added successfully</Trans> | <button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button> | </div>
{
!this.props.isFilterAdded &&
<div className="modal-footer">
<button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button>
<button type="button" className="btn btn-secondary" onClick={this.closeModal}><Trans>Cancel</Trans></button>
<button type="button" className="btn btn-success" onClick={this.handleNext} disabled={isValidForSubmit}><Trans>Add filter</Trans></button>
</div>
}
</div>
</ReactModal>
); | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/ui/Modal.js |
inputDescription: PropTypes.string,
addFilter: PropTypes.func.isRequired,
isFilterAdded: PropTypes.bool,
};
export default withNamespaces()(Modal);
| </s> remove export default Filters;
</s> add export default withNamespaces()(Filters); </s> remove export default Logs;
</s> add export default withNamespaces()(Logs); | t: PropTypes.func, | inputDescription: PropTypes.string,
addFilter: PropTypes.func.isRequired,
isFilterAdded: PropTypes.bool,
t: PropTypes.func,
};
export default withNamespaces()(Modal); | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep"
] | Complete translate client to Vietnamese | https://github.com/AdguardTeam/AdGuardHome/commit/4590564fea78b4aa247db0e2bd0ac400c60c8252 | client/src/components/ui/Modal.js |
// Update filters we've just loaded right away, don't wait for periodic update timer
go func() {
refreshFiltersIfNeccessary(false)
// Save the updated config
err := writeConfig()
if err != nil {
log.Fatal(err)
}
}()
| </s> remove err := writeConfig()
</s> add err := config.write() </s> remove err := writeConfig()
</s> add err := config.write() </s> remove func writeConfig() error {
</s> add func (c *configuration) write() error { | err := config.write() | // Update filters we've just loaded right away, don't wait for periodic update timer
go func() {
refreshFiltersIfNeccessary(false)
// Save the updated config
err := config.write()
if err != nil {
log.Fatal(err)
}
}()
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix incorrect cherry-pick in previous commit. | https://github.com/AdguardTeam/AdGuardHome/commit/45ae984f3bd7bad1f21c1e8f9910558cc2986cba | app.go |
os.Args = os.Args[:1]
}
// Save the updated config
err := writeConfig()
if err != nil {
log.Fatal(err)
}
address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.BindPort))
| </s> remove err := writeConfig()
</s> add err := config.write() </s> remove err := writeConfig()
</s> add err := config.write() </s> remove func writeConfig() error {
</s> add func (c *configuration) write() error { | err := config.write() | os.Args = os.Args[:1]
}
// Save the updated config
err := config.write()
if err != nil {
log.Fatal(err)
}
address := net.JoinHostPort(config.BindHost, strconv.Itoa(config.BindPort)) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix incorrect cherry-pick in previous commit. | https://github.com/AdguardTeam/AdGuardHome/commit/45ae984f3bd7bad1f21c1e8f9910558cc2986cba | app.go |
return nil
}
// Saves configuration to the YAML file and also saves the user filter contents to a file
func writeConfig() error {
c.Lock()
defer c.Unlock()
configFile := filepath.Join(config.ourBinaryDir, config.ourConfigFilename)
log.Printf("Writing YAML file: %s", configFile)
yamlText, err := yaml.Marshal(&config)
| </s> remove err := writeConfig()
</s> add err := config.write() </s> remove err := writeConfig()
</s> add err := config.write() </s> remove err := writeConfig()
</s> add err := config.write() | func (c *configuration) write() error { | return nil
}
// Saves configuration to the YAML file and also saves the user filter contents to a file
func (c *configuration) write() error {
c.Lock()
defer c.Unlock()
configFile := filepath.Join(config.ourBinaryDir, config.ourConfigFilename)
log.Printf("Writing YAML file: %s", configFile)
yamlText, err := yaml.Marshal(&config) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix incorrect cherry-pick in previous commit. | https://github.com/AdguardTeam/AdGuardHome/commit/45ae984f3bd7bad1f21c1e8f9910558cc2986cba | config.go |
return nil
}
func writeAllConfigs() error {
err := writeConfig()
if err != nil {
log.Printf("Couldn't write our config: %s", err)
return err
}
err = writeCoreDNSConfig()
| </s> remove err := writeConfig()
</s> add err := config.write() </s> remove err := writeConfig()
</s> add err := config.write() </s> remove func writeConfig() error {
</s> add func (c *configuration) write() error { | err := config.write() | return nil
}
func writeAllConfigs() error {
err := config.write()
if err != nil {
log.Printf("Couldn't write our config: %s", err)
return err
}
err = writeCoreDNSConfig() | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix incorrect cherry-pick in previous commit. | https://github.com/AdguardTeam/AdGuardHome/commit/45ae984f3bd7bad1f21c1e8f9910558cc2986cba | config.go |
var webHandlersRegistered = false
// Client contains information about persistent clients.
type Client struct {
IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
upstreamConfig *proxy.UpstreamConfig
}
type clientSource uint
| </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. | var webHandlersRegistered = false
// Client contains information about persistent clients.
type Client struct {
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
// upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
upstreamConfig *proxy.UpstreamConfig
}
type clientSource uint
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clients.go |
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
upstreamConfig *proxy.UpstreamConfig
}
type clientSource uint
// Client sources. The order determines the priority.
| </s> remove IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
</s> add // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | Name string
IDs []string
Tags []string
BlockedServices []string
Upstreams []string
UseOwnSettings bool
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool | // it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used.
upstreamConfig *proxy.UpstreamConfig
Name string
IDs []string
Tags []string
BlockedServices []string
Upstreams []string
UseOwnSettings bool
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool
}
type clientSource uint
// Client sources. The order determines the priority. | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clients.go |
)
// RuntimeClient information
type RuntimeClient struct {
Host string
Source clientSource
}
// RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
| </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add </s> remove IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
</s> add // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` | WhoisInfo *RuntimeClientWhoisInfo | )
// RuntimeClient information
type RuntimeClient struct {
WhoisInfo *RuntimeClientWhoisInfo
Host string
Source clientSource
}
// RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client. | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clients.go |
// RuntimeClient information
type RuntimeClient struct {
Host string
Source clientSource
WhoisInfo *RuntimeClientWhoisInfo
}
// RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
City string `json:"city,omitempty"`
| </s> remove IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
</s> add // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` | // RuntimeClient information
type RuntimeClient struct {
Host string
Source clientSource
}
// RuntimeClientWhoisInfo is the filtered WHOIS data for a runtime client.
type RuntimeClientWhoisInfo struct {
City string `json:"city,omitempty"` | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clients.go |
|
"net"
"net/http"
)
type clientJSON struct {
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
| </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` </s> remove IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
</s> add // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | // clientJSON is a common structure used by several handlers to deal with
// clients. Some of the fields are only necessary in one or two handlers and
// are thus made pointers with an omitempty tag.
//
// TODO(a.garipov): Consider using nullbool and an optional string here? Or
// split into several structs? | "net"
"net/http"
)
// clientJSON is a common structure used by several handlers to deal with
// clients. Some of the fields are only necessary in one or two handlers and
// are thus made pointers with an omitempty tag.
//
// TODO(a.garipov): Consider using nullbool and an optional string here? Or
// split into several structs?
type clientJSON struct {
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"` | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clientshttp.go |
"net/http"
)
type clientJSON struct {
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
}
type runtimeClientJSON struct {
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
| </s> remove IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
</s> add // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` | "net/http"
)
type clientJSON struct {
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
// Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"`
}
type runtimeClientJSON struct {
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
| [
"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",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clientshttp.go |
UseGlobalBlockedServices: !c.UseOwnBlockedServices,
BlockedServices: c.BlockedServices,
Upstreams: c.Upstreams,
WhoisInfo: &RuntimeClientWhoisInfo{},
}
return cj
}
| </s> remove Disallowed: disallowed,
DisallowedRule: rule,
</s> add Disallowed: &disallowed,
DisallowedRule: &rule, </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | UseGlobalBlockedServices: !c.UseOwnBlockedServices,
BlockedServices: c.BlockedServices,
Upstreams: c.Upstreams,
}
return cj
}
| [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clientshttp.go |
|
continue
}
} else {
cj = clientToJSON(c)
cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
}
data = append(data, map[string]clientJSON{
idStr: cj,
})
| </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove Disallowed: disallowed,
DisallowedRule: rule,
</s> add Disallowed: &disallowed,
DisallowedRule: &rule, </s> remove
WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule | continue
}
} else {
cj = clientToJSON(c)
disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule
}
data = append(data, map[string]clientJSON{
idStr: cj,
}) | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clientshttp.go |
}
cj = clientJSON{
IDs: []string{idStr},
Disallowed: disallowed,
DisallowedRule: rule,
WhoisInfo: &RuntimeClientWhoisInfo{},
}
return cj, true
}
| </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove
WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove WhoisInfo *RuntimeClientWhoisInfo
</s> add | Disallowed: &disallowed,
DisallowedRule: &rule, | }
cj = clientJSON{
IDs: []string{idStr},
Disallowed: &disallowed,
DisallowedRule: &rule,
Disallowed: &disallowed,
DisallowedRule: &rule,
WhoisInfo: &RuntimeClientWhoisInfo{},
}
return cj, true
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clientshttp.go |
return cj, true
}
cj = runtimeClientToJSON(idStr, rc)
cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
return cj, true
}
// RegisterClientsHandlers registers HTTP handlers
| </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove Disallowed: disallowed,
DisallowedRule: rule,
</s> add Disallowed: &disallowed,
DisallowedRule: &rule, </s> remove
WhoisInfo: &RuntimeClientWhoisInfo{},
</s> add </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` | disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule | return cj, true
}
cj = runtimeClientToJSON(idStr, rc)
disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule
return cj, true
}
// RegisterClientsHandlers registers HTTP handlers | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | internal/home/clientshttp.go |
'type': 'array'
'items':
'type': 'string'
'ClientAuto':
'type': 'object'
'description': 'Auto-Client information'
'properties':
'ip':
'type': 'string'
| </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove Disallowed: disallowed,
DisallowedRule: rule,
</s> add Disallowed: &disallowed,
DisallowedRule: &rule, </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule | 'tags':
'items':
'type': 'string'
'type': 'array' | 'type': 'array'
'items':
'type': 'string'
'tags':
'items':
'type': 'string'
'type': 'array'
'ClientAuto':
'type': 'object'
'description': 'Auto-Client information'
'properties':
'ip':
'type': 'string' | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | openapi/openapi.yaml |
'source':
'type': 'string'
'description': 'The source of this information'
'example': 'etc/hosts'
'ClientUpdate':
'type': 'object'
'description': 'Client update request'
'properties':
'name':
'type': 'string'
| </s> remove IDs []string
Tags []string
Name string
UseOwnSettings bool // false: use global settings
FilteringEnabled bool
SafeSearchEnabled bool
SafeBrowsingEnabled bool
ParentalEnabled bool
UseOwnBlockedServices bool // false: use global settings
BlockedServices []string
Upstreams []string // list of upstream servers to be used for the client's requests
// Custom upstream config for this client
// nil: not yet initialized
// not nil, but empty: initialized, no good upstreams
// not nil, not empty: Upstreams ready to be used
</s> add // upstreamConfig is the custom upstream config for this client. If
// it's nil, it has not been initialized yet. If it's non-nil and
// empty, there are no valid upstreams. If it's non-nil and non-empty,
// these upstream must be used. </s> remove IDs []string `json:"ids"`
Tags []string `json:"tags"`
Name string `json:"name"`
UseGlobalSettings bool `json:"use_global_settings"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
BlockedServices []string `json:"blocked_services"`
Upstreams []string `json:"upstreams"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info"`
// Disallowed - if true -- client's IP is not disallowed
// Otherwise, it is blocked.
Disallowed bool `json:"disallowed"`
// DisallowedRule - the rule due to which the client is disallowed
// If Disallowed is true, and this string is empty - it means that the client IP
// is disallowed by the "allowed IP list", i.e. it is not included in allowed.
DisallowedRule string `json:"disallowed_rule"`
</s> add // Disallowed, if non-nil and false, means that the client's IP is
// allowed. Otherwise, the IP is blocked.
Disallowed *bool `json:"disallowed,omitempty"`
// DisallowedRule is the rule due to which the client is disallowed.
// If Disallowed is true and this string is empty, the client IP is
// disallowed by the "allowed IP list", that is it is not included in
// the allowlist.
DisallowedRule *string `json:"disallowed_rule,omitempty"`
WhoisInfo *RuntimeClientWhoisInfo `json:"whois_info,omitempty"`
Name string `json:"name"`
BlockedServices []string `json:"blocked_services"`
IDs []string `json:"ids"`
Tags []string `json:"tags"`
Upstreams []string `json:"upstreams"`
FilteringEnabled bool `json:"filtering_enabled"`
ParentalEnabled bool `json:"parental_enabled"`
SafeBrowsingEnabled bool `json:"safebrowsing_enabled"`
SafeSearchEnabled bool `json:"safesearch_enabled"`
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
UseGlobalSettings bool `json:"use_global_settings"` | 'whois_info':
'$ref': '#/components/schemas/WhoisInfo' | 'source':
'type': 'string'
'description': 'The source of this information'
'example': 'etc/hosts'
'whois_info':
'$ref': '#/components/schemas/WhoisInfo'
'ClientUpdate':
'type': 'object'
'description': 'Client update request'
'properties':
'name':
'type': 'string' | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | openapi/openapi.yaml |
'$ref': '#/components/schemas/ClientsArray'
'auto_clients':
'$ref': '#/components/schemas/ClientsAutoArray'
'ClientsArray':
'type': 'array'
'items':
'$ref': '#/components/schemas/Client'
'description': 'Clients array'
'ClientsAutoArray':
| </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule </s> remove Disallowed: disallowed,
DisallowedRule: rule,
</s> add Disallowed: &disallowed,
DisallowedRule: &rule, </s> remove cj.Disallowed, cj.DisallowedRule = clients.dnsServer.IsBlockedIP(ip)
</s> add disallowed, rule := clients.dnsServer.IsBlockedIP(ip)
cj.Disallowed, cj.DisallowedRule = &disallowed, &rule | 'supported_tags':
'items':
'type': 'string'
'type': 'array' | '$ref': '#/components/schemas/ClientsArray'
'auto_clients':
'$ref': '#/components/schemas/ClientsAutoArray'
'supported_tags':
'items':
'type': 'string'
'type': 'array'
'ClientsArray':
'type': 'array'
'items':
'$ref': '#/components/schemas/Client'
'description': 'Clients array'
'ClientsAutoArray': | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Pull request: home: imp client http api, docs
Updates #3075.
Squashed commit of the following:
commit c88fd2e24a19474bce736e5b6af7e094b43be390
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 16:09:49 2021 +0300
home: imp code, docs
commit 8ae7d9001927d56394d2177c22fe114d98f01732
Author: Ainar Garipov <[email protected]>
Date: Thu May 6 15:35:49 2021 +0300
home: imp client http api, docs | https://github.com/AdguardTeam/AdGuardHome/commit/460aa1a5ba4409a2fccb596b2156922532bab5b3 | openapi/openapi.yaml |
:root {
--bgcolor: #f5f7fb;
--mcolor: #495057;
--scolor: rgba(74, 74, 74, 0.7);
--border-color: rgba(0, 40, 100, 0.12);
--header-bgcolor: #fff;
| </s> remove background-color: #fff;
</s> add background-color: var(--card-bgcolor); </s> remove border-color: #5eba00;
</s> add border-color: var(--btn-success-bgcolor); </s> remove border-color: #3e7a00;
</s> add border-color: #448700; | --black: #131313; | :root {
--black: #131313;
--bgcolor: #f5f7fb;
--mcolor: #495057;
--scolor: rgba(74, 74, 74, 0.7);
--border-color: rgba(0, 40, 100, 0.12);
--header-bgcolor: #fff; | [
"add",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix dark theme bugs
Updates #5375
Squashed commit of the following:
commit 40666b010697381e11b3a36d9c2ed1c1507f27ed
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 18:34:06 2023 +0200
Review fix
commit 44f3d6095bc9b426e8142f8c9d915a1441f3d791
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 17:02:38 2023 +0200
Clear
commit 44274ba54c9ff2bd2caf5fa69bf06c587f8858e5
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 13:25:01 2023 +0200
Clear
commit 8b48c523cbbe3f73160331a9c516388c7965a7a2
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 12:14:37 2023 +0200
Review fix
commit 3b8cd94cdd8d3fc90cdc27053964489414055cc9
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 16:13:15 2023 +0200
Fix query log popup bg
commit 14d4c87164200f7c918bac02c9cc5f1cffb83932
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 15:03:06 2023 +0200
revert icons
commit 98b042726e1510f85c9cf5a4caba2d56885f120b
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 14:45:35 2023 +0200
Fix dark theme bugs | https://github.com/AdguardTeam/AdGuardHome/commit/46382e88250d9734a6e634fa79376334ee1fbe24 | client/src/components/App/index.css |
--green79: #67b279;
--gray-a5: #a5a5a5;
--gray-d8: #d8d8d8;
--gray-f3: #f3f3f3;
--font-family-monospace: Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace;
--font-size-disable-autozoom: 1rem;
}
[data-theme="dark"] {
--black: #ffffff;
| </s> remove --form-disabled-bgcolor: #3d3d3d;
</s> add --form-disabled-bgcolor: #2d2d2d; </s> remove --modal-overlay-bgcolor: #1c1c1c;
</s> add --modal-overlay-bgcolor: rgba(19, 19, 19, 0.75); | --loading-bg: rgba(255, 255, 255, 0.48); | --green79: #67b279;
--gray-a5: #a5a5a5;
--gray-d8: #d8d8d8;
--gray-f3: #f3f3f3;
--loading-bg: rgba(255, 255, 255, 0.48);
--font-family-monospace: Monaco, Menlo, "Ubuntu Mono", Consolas, source-code-pro, monospace;
--font-size-disable-autozoom: 1rem;
}
[data-theme="dark"] {
--black: #ffffff; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix dark theme bugs
Updates #5375
Squashed commit of the following:
commit 40666b010697381e11b3a36d9c2ed1c1507f27ed
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 18:34:06 2023 +0200
Review fix
commit 44f3d6095bc9b426e8142f8c9d915a1441f3d791
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 17:02:38 2023 +0200
Clear
commit 44274ba54c9ff2bd2caf5fa69bf06c587f8858e5
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 13:25:01 2023 +0200
Clear
commit 8b48c523cbbe3f73160331a9c516388c7965a7a2
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 12:14:37 2023 +0200
Review fix
commit 3b8cd94cdd8d3fc90cdc27053964489414055cc9
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 16:13:15 2023 +0200
Fix query log popup bg
commit 14d4c87164200f7c918bac02c9cc5f1cffb83932
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 15:03:06 2023 +0200
revert icons
commit 98b042726e1510f85c9cf5a4caba2d56885f120b
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 14:45:35 2023 +0200
Fix dark theme bugs | https://github.com/AdguardTeam/AdGuardHome/commit/46382e88250d9734a6e634fa79376334ee1fbe24 | client/src/components/App/index.css |
--font-size-disable-autozoom: 1rem;
}
[data-theme="dark"] {
--bgcolor: #131313;
--mcolor: #e6e6e6;
--scolor: #a5a5a5;
--header-bgcolor: #131313;
--border-color: #222;
--card-bgcolor: #1c1c1c;
| </s> remove --modal-overlay-bgcolor: #1c1c1c;
</s> add --modal-overlay-bgcolor: rgba(19, 19, 19, 0.75); </s> remove --form-disabled-bgcolor: #3d3d3d;
</s> add --form-disabled-bgcolor: #2d2d2d; | --black: #ffffff; | --font-size-disable-autozoom: 1rem;
}
[data-theme="dark"] {
--black: #ffffff;
--bgcolor: #131313;
--mcolor: #e6e6e6;
--scolor: #a5a5a5;
--header-bgcolor: #131313;
--border-color: #222;
--card-bgcolor: #1c1c1c; | [
"keep",
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix dark theme bugs
Updates #5375
Squashed commit of the following:
commit 40666b010697381e11b3a36d9c2ed1c1507f27ed
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 18:34:06 2023 +0200
Review fix
commit 44f3d6095bc9b426e8142f8c9d915a1441f3d791
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 17:02:38 2023 +0200
Clear
commit 44274ba54c9ff2bd2caf5fa69bf06c587f8858e5
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 13:25:01 2023 +0200
Clear
commit 8b48c523cbbe3f73160331a9c516388c7965a7a2
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 12:14:37 2023 +0200
Review fix
commit 3b8cd94cdd8d3fc90cdc27053964489414055cc9
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 16:13:15 2023 +0200
Fix query log popup bg
commit 14d4c87164200f7c918bac02c9cc5f1cffb83932
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 15:03:06 2023 +0200
revert icons
commit 98b042726e1510f85c9cf5a4caba2d56885f120b
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 14:45:35 2023 +0200
Fix dark theme bugs | https://github.com/AdguardTeam/AdGuardHome/commit/46382e88250d9734a6e634fa79376334ee1fbe24 | client/src/components/App/index.css |
--ctrl-dropdown-color: #fff;
--ctrl-dropdown-bgcolor-focus: #000;
--ctrl-dropdown-color-focus: #fff;
--btn-success-bgcolor: #67b279;
--form-disabled-bgcolor: #3d3d3d;
--form-disabled-color: #a5a5a5;
--logs__text-color: #f3f3f3;
--rt-nodata-bgcolor: #1c1c1c;
--rt-nodata-color: #fff;
--modal-overlay-bgcolor: #1c1c1c;
| </s> remove --modal-overlay-bgcolor: #1c1c1c;
</s> add --modal-overlay-bgcolor: rgba(19, 19, 19, 0.75); </s> remove border-color: #5eba00;
</s> add border-color: var(--btn-success-bgcolor); | --form-disabled-bgcolor: #2d2d2d; | --ctrl-dropdown-color: #fff;
--ctrl-dropdown-bgcolor-focus: #000;
--ctrl-dropdown-color-focus: #fff;
--btn-success-bgcolor: #67b279;
--form-disabled-bgcolor: #2d2d2d;
--form-disabled-color: #a5a5a5;
--logs__text-color: #f3f3f3;
--rt-nodata-bgcolor: #1c1c1c;
--rt-nodata-color: #fff;
--modal-overlay-bgcolor: #1c1c1c; | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix dark theme bugs
Updates #5375
Squashed commit of the following:
commit 40666b010697381e11b3a36d9c2ed1c1507f27ed
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 18:34:06 2023 +0200
Review fix
commit 44f3d6095bc9b426e8142f8c9d915a1441f3d791
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 17:02:38 2023 +0200
Clear
commit 44274ba54c9ff2bd2caf5fa69bf06c587f8858e5
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 13:25:01 2023 +0200
Clear
commit 8b48c523cbbe3f73160331a9c516388c7965a7a2
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 12:14:37 2023 +0200
Review fix
commit 3b8cd94cdd8d3fc90cdc27053964489414055cc9
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 16:13:15 2023 +0200
Fix query log popup bg
commit 14d4c87164200f7c918bac02c9cc5f1cffb83932
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 15:03:06 2023 +0200
revert icons
commit 98b042726e1510f85c9cf5a4caba2d56885f120b
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 14:45:35 2023 +0200
Fix dark theme bugs | https://github.com/AdguardTeam/AdGuardHome/commit/46382e88250d9734a6e634fa79376334ee1fbe24 | client/src/components/App/index.css |
--form-disabled-color: #a5a5a5;
--logs__text-color: #f3f3f3;
--rt-nodata-bgcolor: #1c1c1c;
--rt-nodata-color: #fff;
--modal-overlay-bgcolor: #1c1c1c;
--logs__table-bgcolor: #3d3d3d;
--logs__row--blue-bgcolor: #467fcf;
--logs__row--white-bgcolor: #1c1c1c;
--detailed-info-color: #fff;
}
| </s> remove --form-disabled-bgcolor: #3d3d3d;
</s> add --form-disabled-bgcolor: #2d2d2d; </s> remove border-color: #5eba00;
</s> add border-color: var(--btn-success-bgcolor); | --modal-overlay-bgcolor: rgba(19, 19, 19, 0.75); | --form-disabled-color: #a5a5a5;
--logs__text-color: #f3f3f3;
--rt-nodata-bgcolor: #1c1c1c;
--rt-nodata-color: #fff;
--modal-overlay-bgcolor: rgba(19, 19, 19, 0.75);
--logs__table-bgcolor: #3d3d3d;
--logs__row--blue-bgcolor: #467fcf;
--logs__row--white-bgcolor: #1c1c1c;
--detailed-info-color: #fff;
} | [
"keep",
"keep",
"keep",
"keep",
"replace",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix dark theme bugs
Updates #5375
Squashed commit of the following:
commit 40666b010697381e11b3a36d9c2ed1c1507f27ed
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 18:34:06 2023 +0200
Review fix
commit 44f3d6095bc9b426e8142f8c9d915a1441f3d791
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 17:02:38 2023 +0200
Clear
commit 44274ba54c9ff2bd2caf5fa69bf06c587f8858e5
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 13:25:01 2023 +0200
Clear
commit 8b48c523cbbe3f73160331a9c516388c7965a7a2
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 12:14:37 2023 +0200
Review fix
commit 3b8cd94cdd8d3fc90cdc27053964489414055cc9
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 16:13:15 2023 +0200
Fix query log popup bg
commit 14d4c87164200f7c918bac02c9cc5f1cffb83932
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 15:03:06 2023 +0200
revert icons
commit 98b042726e1510f85c9cf5a4caba2d56885f120b
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 14:45:35 2023 +0200
Fix dark theme bugs | https://github.com/AdguardTeam/AdGuardHome/commit/46382e88250d9734a6e634fa79376334ee1fbe24 | client/src/components/App/index.css |
--logs__row--blue-bgcolor: #467fcf;
--logs__row--white-bgcolor: #1c1c1c;
--detailed-info-color: #fff;
}
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
| </s> remove --modal-overlay-bgcolor: #1c1c1c;
</s> add --modal-overlay-bgcolor: rgba(19, 19, 19, 0.75); </s> remove border-top: 1px solid #dee2e6;
</s> add border-top: 1px solid var(--card-border-color); | --gray300: #f3f3f3;
--loading-bg: #131313; | --logs__row--blue-bgcolor: #467fcf;
--logs__row--white-bgcolor: #1c1c1c;
--detailed-info-color: #fff;
--gray300: #f3f3f3;
--loading-bg: #131313;
}
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; | [
"keep",
"keep",
"add",
"keep",
"keep",
"keep",
"keep",
"keep",
"keep"
] | Fix dark theme bugs
Updates #5375
Squashed commit of the following:
commit 40666b010697381e11b3a36d9c2ed1c1507f27ed
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 18:34:06 2023 +0200
Review fix
commit 44f3d6095bc9b426e8142f8c9d915a1441f3d791
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 17:02:38 2023 +0200
Clear
commit 44274ba54c9ff2bd2caf5fa69bf06c587f8858e5
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 13:25:01 2023 +0200
Clear
commit 8b48c523cbbe3f73160331a9c516388c7965a7a2
Author: Arseny Lisin <[email protected]>
Date: Tue Jan 31 12:14:37 2023 +0200
Review fix
commit 3b8cd94cdd8d3fc90cdc27053964489414055cc9
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 16:13:15 2023 +0200
Fix query log popup bg
commit 14d4c87164200f7c918bac02c9cc5f1cffb83932
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 15:03:06 2023 +0200
revert icons
commit 98b042726e1510f85c9cf5a4caba2d56885f120b
Author: Arseny Lisin <[email protected]>
Date: Mon Jan 30 14:45:35 2023 +0200
Fix dark theme bugs | https://github.com/AdguardTeam/AdGuardHome/commit/46382e88250d9734a6e634fa79376334ee1fbe24 | client/src/components/App/index.css |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.