Merge: Add "Setup guide" menu item #605

* commit 'c091d10a416b0ea9c72fb1addd95e7194281d9ce':
  * client: update translations
  + client: added setup guide page and DNS addresses popover
  + control: use the list of IP addresses instead of single string in "dns_address"
This commit is contained in:
Simon Zolin
2019-03-20 12:56:47 +03:00
16 changed files with 280 additions and 98 deletions

View File

@@ -79,8 +79,25 @@ func httpUpdateConfigReloadDNSReturnOK(w http.ResponseWriter, r *http.Request) {
func handleStatus(w http.ResponseWriter, r *http.Request) {
log.Tracef("%s %v", r.Method, r.URL)
dnsAddresses := []string{}
if config.DNS.BindHost == "0.0.0.0" {
ifaces, e := getValidNetInterfacesForWeb()
if e != nil {
log.Error("Couldn't get network interfaces: %v", e)
}
for _, iface := range ifaces {
for _, addr := range iface.Addresses {
dnsAddresses = append(dnsAddresses, addr)
}
}
}
if len(dnsAddresses) == 0 {
dnsAddresses = append(dnsAddresses, config.DNS.BindHost)
}
data := map[string]interface{}{
"dns_address": config.DNS.BindHost,
"dns_addresses": dnsAddresses,
"http_port": config.BindPort,
"dns_port": config.DNS.Port,
"protection_enabled": config.DNS.ProtectionEnabled,