+ clients: add BlockedServices field
This commit is contained in:
parent
8307a5a494
commit
04a477c14a
|
@ -31,6 +31,9 @@ type Client struct {
|
||||||
SafeSearchEnabled bool
|
SafeSearchEnabled bool
|
||||||
SafeBrowsingEnabled bool
|
SafeBrowsingEnabled bool
|
||||||
ParentalEnabled bool
|
ParentalEnabled bool
|
||||||
|
|
||||||
|
UseOwnBlockedServices bool // false: use global settings
|
||||||
|
BlockedServices []string
|
||||||
}
|
}
|
||||||
|
|
||||||
type clientJSON struct {
|
type clientJSON struct {
|
||||||
|
@ -42,6 +45,9 @@ type clientJSON struct {
|
||||||
ParentalEnabled bool `json:"parental_enabled"`
|
ParentalEnabled bool `json:"parental_enabled"`
|
||||||
SafeSearchEnabled bool `json:"safebrowsing_enabled"`
|
SafeSearchEnabled bool `json:"safebrowsing_enabled"`
|
||||||
SafeBrowsingEnabled bool `json:"safesearch_enabled"`
|
SafeBrowsingEnabled bool `json:"safesearch_enabled"`
|
||||||
|
|
||||||
|
UseGlobalBlockedServices bool `json:"use_global_blocked_services"`
|
||||||
|
BlockedServices []string `json:"blocked_services"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type clientSource uint
|
type clientSource uint
|
||||||
|
@ -391,6 +397,9 @@ func handleGetClients(w http.ResponseWriter, r *http.Request) {
|
||||||
ParentalEnabled: c.ParentalEnabled,
|
ParentalEnabled: c.ParentalEnabled,
|
||||||
SafeSearchEnabled: c.SafeSearchEnabled,
|
SafeSearchEnabled: c.SafeSearchEnabled,
|
||||||
SafeBrowsingEnabled: c.SafeBrowsingEnabled,
|
SafeBrowsingEnabled: c.SafeBrowsingEnabled,
|
||||||
|
|
||||||
|
UseGlobalBlockedServices: !c.UseOwnBlockedServices,
|
||||||
|
BlockedServices: c.BlockedServices,
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(c.MAC) != 0 {
|
if len(c.MAC) != 0 {
|
||||||
|
@ -438,6 +447,9 @@ func jsonToClient(cj clientJSON) (*Client, error) {
|
||||||
ParentalEnabled: cj.ParentalEnabled,
|
ParentalEnabled: cj.ParentalEnabled,
|
||||||
SafeSearchEnabled: cj.SafeSearchEnabled,
|
SafeSearchEnabled: cj.SafeSearchEnabled,
|
||||||
SafeBrowsingEnabled: cj.SafeBrowsingEnabled,
|
SafeBrowsingEnabled: cj.SafeBrowsingEnabled,
|
||||||
|
|
||||||
|
UseOwnBlockedServices: !cj.UseGlobalBlockedServices,
|
||||||
|
BlockedServices: cj.BlockedServices,
|
||||||
}
|
}
|
||||||
return &c, nil
|
return &c, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue