summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index e745d7d..7336142 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -916,6 +916,7 @@ def action_client_update():
"remote": form.remote.data,
"room": int(form.room.data),
"name": form.name.data,
+ "boot": form.boot.data,
"mac": form.mac.data }
server = get_server_from_ip_port(form.server.data)
r = server.post('/client/update', payload)
@@ -938,7 +939,7 @@ def action_client_update():
r = server.get('/client/info', payload)
db_client = r.json()
- form.mac.render_kw = {'placeholder': 'aabbccddeeaa'}
+ form.mac.render_kw = {'readonly': True}
form.server.data = "{0}:{1}".format(server.ip, server.port)
form.ip.data = db_client['ip']
form.ip.render_kw = {'readonly': True}
@@ -949,7 +950,13 @@ def action_client_update():
form.remote.data = db_client['remote']
form.maintenance.data = db_client['maintenance']
form.netiface.data = db_client['netiface']
- form.boot.render_kw = {'readonly': True}
+
+ current_mode = db_client['boot']
+ r = server.get('/mode')
+ available_modes = [(current_mode, current_mode)]
+ available_modes.extend([(mode, mode) for mode in r.json()['modes']
+ if mode != current_mode])
+ form.boot.choices = list(available_modes)
r = server.get('/scopes')
room_id = db_client['room']