|
@@ -78,7 +78,8 @@ class BaseStorage(object):
|
|
|
|
|
|
nodes = 0
|
|
|
nodes_active = 0
|
|
|
- clients = 0
|
|
|
+ sum_clients = 0
|
|
|
+ clients = set()
|
|
|
|
|
|
for item_id in self.data:
|
|
|
if item_id.startswith('__'):
|
|
@@ -87,12 +88,21 @@ class BaseStorage(object):
|
|
|
node = self.data[item_id]
|
|
|
|
|
|
nodes += 1
|
|
|
- clients += node.get('clientcount', 0)
|
|
|
if self.get_nodestatus(item_id) == 'active':
|
|
|
nodes_active += 1
|
|
|
|
|
|
+ sum_clients += node.get('clientcount', 0)
|
|
|
+ nodemacs = [x for x in node.get('macs', [])]
|
|
|
+ if 'mac' in node:
|
|
|
+ nodemacs.add(node['mac'])
|
|
|
+ for client in node.get('clients', []):
|
|
|
+ if client in nodemacs:
|
|
|
+ continue
|
|
|
+ clients.add(client)
|
|
|
+
|
|
|
return {
|
|
|
- 'clients': clients,
|
|
|
+ 'clients_sum': sum_clients,
|
|
|
+ 'clients_unique': len(clients),
|
|
|
'nodes': nodes,
|
|
|
'nodes_active': nodes_active,
|
|
|
}
|