aboutsummaryrefslogtreecommitdiffstats
path: root/gui/static/js/odr-rcvalues.js
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-09-24 19:42:01 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-09-24 20:47:08 +0200
commit5ad01f6415710521173e7a612b32c982847eada4 (patch)
tree4d4c8ca0a7ce0ff0f81702ee7bfad0b57c899929 /gui/static/js/odr-rcvalues.js
parent5bb71419937a4d8919ef33df088f73e6c705b028 (diff)
downloaddabmod-5ad01f6415710521173e7a612b32c982847eada4.tar.gz
dabmod-5ad01f6415710521173e7a612b32c982847eada4.tar.bz2
dabmod-5ad01f6415710521173e7a612b32c982847eada4.zip
gui: use json for all API answers
Diffstat (limited to 'gui/static/js/odr-rcvalues.js')
-rw-r--r--gui/static/js/odr-rcvalues.js31
1 files changed, 8 insertions, 23 deletions
diff --git a/gui/static/js/odr-rcvalues.js b/gui/static/js/odr-rcvalues.js
index 6d53e8d..f40279d 100644
--- a/gui/static/js/odr-rcvalues.js
+++ b/gui/static/js/odr-rcvalues.js
@@ -21,30 +21,15 @@
function requestStatus(callback) {
$('#rctable > tbody').empty();
- $.ajax({
- type: "GET",
- url: "/api/rc_parameters",
- contentType: 'application/json',
- dataType: 'json',
-
- error: function(data) {
- $.gritter.add({
- title: 'RC info',
- text: "ERROR: ",
- image: '/fonts/warning.png',
- sticky: true,
- });
- },
- success: function(data) {
- $.each( data, function( key1, controllable ) {
- $.each( controllable, function( key2, param ) {
- $('#rctable > tbody:last').append(
- '<tr><td>'+key1+'.'+key2+'</td>'+
- '<td>'+param['value']+'</td>'+
- '<td>'+param['help']+'</td></tr>');
- });
+ doApiRequestGET("/api/rc_parameters", function(data) {
+ $.each( data, function( key1, controllable ) {
+ $.each( controllable, function( key2, param ) {
+ $('#rctable > tbody:last').append(
+ '<tr><td>'+key1+'.'+key2+'</td>'+
+ '<td>'+param['value']+'</td>'+
+ '<td>'+param['help']+'</td></tr>');
});
- }
+ });
});
}