aboutsummaryrefslogtreecommitdiffstats
path: root/gui/static/js/odr-predistortion.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-predistortion.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-predistortion.js')
-rw-r--r--gui/static/js/odr-predistortion.js40
1 files changed, 4 insertions, 36 deletions
diff --git a/gui/static/js/odr-predistortion.js b/gui/static/js/odr-predistortion.js
index dce3922..13dac7a 100644
--- a/gui/static/js/odr-predistortion.js
+++ b/gui/static/js/odr-predistortion.js
@@ -20,46 +20,14 @@
$(function(){
$('#capturebutton').click(function() {
- $.ajax({
- type: "POST",
- url: "/api/trigger_capture",
- contentType: 'text/plain',
- dataType: '',
- data: '',
-
- error: function(data) {
- $.gritter.add({
- title: 'Capture trigger',
- text: "ERROR",
- image: '/fonts/warning.png',
- sticky: true,
- });
- },
- success: function(data) {
- $('#capturestatus').val(data);
- },
+ doApiRequestPOST("/api/trigger_capture", {}, function(data) {
+ $('#capturestatus').val(data);
});
});
$('#dpdstatusbutton').click(function() {
- $.ajax({
- type: "GET",
- url: "/api/dpd_status",
- contentType: 'application/json',
- dataType: '',
- data: '',
-
- error: function(data) {
- $.gritter.add({
- title: 'DPD Status Update',
- text: "ERROR",
- image: '/fonts/warning.png',
- sticky: true,
- });
- },
- success: function(data) {
- $('#dpdstatus').val(data);
- },
+ doApiRequestGET("/api/dpd_status", function(data) {
+ $('#dpdstatus').val(data);
});
});
});