Added config flag to display Users
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Stefan Hoffmann 2021-03-02 20:15:54 +01:00
parent ab5939eb9d
commit f91081b93f
3 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@
}, },
"unifi": { "unifi": {
"enabled": false, "enabled": false,
"displayusers": true,
"APIUrl": "https://unifi.freifunk-troisdorf.de:8443", "APIUrl": "https://unifi.freifunk-troisdorf.de:8443",
"user": "APIuser", "user": "APIuser",
"password": "PASSWORD", "password": "PASSWORD",

View File

@ -110,7 +110,7 @@ func processUcAPIs() ([]node, []link) {
} }
var model = lookupModels(currentDevice.Model) var model = lookupModels(currentDevice.Model)
var clients = currentDevice.Users var clients = currentDevice.Users
if conf.Meshviewer.Enabled == false { if conf.Unifi.DisplayUsers == false {
clients = 0 clients = 0
} }
nodes = append(nodes, node{ nodes = append(nodes, node{

View File

@ -19,6 +19,7 @@ type config struct {
} `json:"unms"` } `json:"unms"`
Unifi struct { Unifi struct {
Enabled bool `json:"enabled"` Enabled bool `json:"enabled"`
DisplayUsers bool `json:"enabled"`
APIURL string `json:"APIUrl"` APIURL string `json:"APIUrl"`
User string `json:"user"` User string `json:"user"`
Password string `json:"password"` Password string `json:"password"`