From 1bc9b31a83fefd65452ecc310e6baa19c94a1d2f Mon Sep 17 00:00:00 2001 From: Philipp Klaus Date: Thu, 24 Aug 2017 14:17:39 +0200 Subject: [PATCH] DASH: /api/history -> return unix time in ms for JS --- python_suite/dashboard/dashboard.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_suite/dashboard/dashboard.py b/python_suite/dashboard/dashboard.py index 0cf8930..fca0c8d 100755 --- a/python_suite/dashboard/dashboard.py +++ b/python_suite/dashboard/dashboard.py @@ -128,12 +128,14 @@ def api_values(): @route('/api/history/.json') def api_history(name): try: - history = copy.copy(HISTORY[name]) + history = copy.deepcopy(HISTORY[name]) except KeyError: abort(404, "PV not found") if len(history) != 0: # repeat latest value in history (to make plot lines end 'now') history.append([time.time(), history[-1][1]]) + for row in history: + row[0] *= 1000. return {'history': history} @route('/static/') -- 2.43.0