summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 1beaa5b..2a89d01 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -551,6 +551,28 @@ def get_client_mac():
return jsonify(pretty_mac)
+@app.route('/client/list', methods=['GET'])
+@login_required
+def client_list():
+ clients_response = multi_request('get', '/clients')
+ servers_data = {}
+ for i in clients_response:
+ server_id = i['server'].id
+ if server_id not in servers_data:
+ servers_data[server_id] = {}
+ servers_data[server_id]['clients'] = i['json']['clients']
+ for server in servers:
+ if server.id == server_id:
+ servers_data[server_id]['name'] = server.name
+
+ scopes, clients = get_scopes()
+ selected_clients = list(get_selected_clients(scopes['scope']).items())
+
+ return render_template('client_list.html', servers_data=servers_data,
+ selected_clients=selected_clients,
+ scopes=scopes)
+
+
@app.route('/scopes/')
@login_required
def scopes():