]> jspc29.x-matter.uni-frankfurt.de Git - mvd_epics.git/commitdiff
DASH: cleaning up the /api route names
authorPhilipp Klaus <philipp.klaus@gmail.com>
Mon, 25 Sep 2017 13:53:23 +0000 (21:53 +0800)
committerPhilipp Klaus <philipp.klaus@gmail.com>
Mon, 25 Sep 2017 13:53:23 +0000 (21:53 +0800)
python_suite/dashboard/dashboard.py
python_suite/dashboard/static/js/gview.js
python_suite/dashboard/static/js/script.js

index 4e8fba1670e27b3f08df657c8e7b65936c4fe032..85943a7306a683bf41179adf4f63dd307f7285c9 100755 (executable)
@@ -231,12 +231,12 @@ def gview(name):
         return abort(404, 'Page not found')
     return {'config': CONFIG, 'req_page': name, 'svg': svg}
 
-@app.route('/api/values.json')
+@app.route('/api/current_state')
 @json_replace_nan()
 def api_values():
     return CONFIG
 
-@app.route('/api/history/<name>.json')
+@app.route('/api/history/<name>')
 @json_replace_nan()
 def api_history(name):
     try:
index fdad8c471eba1fa11bd6ca65490179227ec1cdea..8942351d41127cb0fd9e5a5c0eeebfd8732c24bf 100644 (file)
@@ -1,5 +1,5 @@
 function updateStatus() {
-  $.getJSON("/api/values.json")
+  $.getJSON("/api/current_state")
     .fail(function( jqxhr, textStatus, error ) {
       var err = textStatus + ", " + error;
       console.log( "Request Failed: " + err );
index c05890b3a326be0f11a2acc1f2669a025c8df35a..0f11ea46e2937bbf9e99a39edf59bb29bdbe8600 100644 (file)
@@ -14,7 +14,7 @@ function updateSparklines() {
                          .width(155)
                          .height(50)
                          .gradientColors(['green', 'orange', 'red']) // OK, WARNING, ALARM
-                         .dataSource('/api/history/' + pvName + '.json')
+                         .dataSource('/api/history/' + pvName)
                          .dataSourceType('JSON')
                          .selector('#'+el.id);
     sparklineChart();  // render the chart