From f91081b93f971d31fc1eac1bf26101ef97ec6aa0 Mon Sep 17 00:00:00 2001 From: Stefan Hoffmann Date: Tue, 2 Mar 2021 20:15:54 +0100 Subject: [PATCH] Added config flag to display Users --- example.config.json | 1 + main.go | 2 +- types.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/example.config.json b/example.config.json index ef11cd8..d1f81e6 100644 --- a/example.config.json +++ b/example.config.json @@ -7,6 +7,7 @@ }, "unifi": { "enabled": false, + "displayusers": true, "APIUrl": "https://unifi.freifunk-troisdorf.de:8443", "user": "APIuser", "password": "PASSWORD", diff --git a/main.go b/main.go index 6f10cab..7c29eb8 100644 --- a/main.go +++ b/main.go @@ -110,7 +110,7 @@ func processUcAPIs() ([]node, []link) { } var model = lookupModels(currentDevice.Model) var clients = currentDevice.Users - if conf.Meshviewer.Enabled == false { + if conf.Unifi.DisplayUsers == false { clients = 0 } nodes = append(nodes, node{ diff --git a/types.go b/types.go index 0bdc88c..cc61ec1 100644 --- a/types.go +++ b/types.go @@ -19,6 +19,7 @@ type config struct { } `json:"unms"` Unifi struct { Enabled bool `json:"enabled"` + DisplayUsers bool `json:"enabled"` APIURL string `json:"APIUrl"` User string `json:"user"` Password string `json:"password"`