diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 18:19:48 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2016-10-07 18:19:48 +0200 |
commit | f02e4b97c487c980bc823f467e078a966f747bee (patch) | |
tree | 8b4d84eed3df78560e50576c762420ff35e777b4 /gui/odr-dabmux-gui.py | |
parent | 77b399804d0b7f3bdabcf8c1adcd95beafd9c8ad (diff) | |
download | dabmux-f02e4b97c487c980bc823f467e078a966f747bee.tar.gz dabmux-f02e4b97c487c980bc823f467e078a966f747bee.tar.bz2 dabmux-f02e4b97c487c980bc823f467e078a966f747bee.zip |
Add ability to change RC settings from gui
Diffstat (limited to 'gui/odr-dabmux-gui.py')
-rwxr-xr-x | gui/odr-dabmux-gui.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gui/odr-dabmux-gui.py b/gui/odr-dabmux-gui.py index 7e3cb3e..2f028e4 100755 --- a/gui/odr-dabmux-gui.py +++ b/gui/odr-dabmux-gui.py @@ -78,6 +78,28 @@ def config_json_get(): 'config': conf.get_full_configuration() } +@route('/rc/<module>/<param>', method="GET") +def rc_get(module, param): + rc.load() + + value = rc.get_param_value(module, param) + + return template('rcparam', + module = module, + param = param, + value = value) + +@route('/rc/<module>/<param>', method="POST") +def rc_post(module, param): + value = request.forms.get('newvalue') + + rc.set_param_value(module, param, value) + + value = rc.get_param_value(module, param) + + return """<p>Parameter is now {}</p> +<p><a href="/#rcmodules">Return</a></p>""".format(value) + @route('/') def index(): conf.load() |