From: Philipp Klaus Date: Mon, 25 Sep 2017 13:53:23 +0000 (+0800) Subject: DASH: cleaning up the /api route names X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=79662229f391512ada250e91558e3ea06a6a5e1a;p=mvd_epics.git DASH: cleaning up the /api route names --- diff --git a/python_suite/dashboard/dashboard.py b/python_suite/dashboard/dashboard.py index 4e8fba1..85943a7 100755 --- a/python_suite/dashboard/dashboard.py +++ b/python_suite/dashboard/dashboard.py @@ -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/.json') +@app.route('/api/history/') @json_replace_nan() def api_history(name): try: diff --git a/python_suite/dashboard/static/js/gview.js b/python_suite/dashboard/static/js/gview.js index fdad8c4..8942351 100644 --- a/python_suite/dashboard/static/js/gview.js +++ b/python_suite/dashboard/static/js/gview.js @@ -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 ); diff --git a/python_suite/dashboard/static/js/script.js b/python_suite/dashboard/static/js/script.js index c05890b..0f11ea4 100644 --- a/python_suite/dashboard/static/js/script.js +++ b/python_suite/dashboard/static/js/script.js @@ -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