From edd8c59a4fd597068dbbca1f5ff58aed2ca7451f Mon Sep 17 00:00:00 2001 From: Dan Maher Date: Tue, 21 Apr 2015 11:03:00 -0400 Subject: [PATCH] Fixed UI components for DPA = True D/L Link --- ooiui/core/routes/science.py | 26 +++++++++++++++++--- ooiui/static/js/partials/SVGPlotControl.html | 2 +- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ooiui/core/routes/science.py b/ooiui/core/routes/science.py index 25d8a1d7d..4fd8e5e11 100644 --- a/ooiui/core/routes/science.py +++ b/ooiui/core/routes/science.py @@ -183,7 +183,7 @@ def metadata_times_proxy(stream_name,reference_designator): @app.route('/api/uframe/get_csv////') def get_csv(stream_name, reference_designator,start,end): token = get_login() - dpa = "0" + dpa = "1" url = app.config['SERVICES_URL'] + '/uframe/get_csv/%s/%s/%s/%s/%s' % (stream_name, reference_designator,start,end,dpa) req = requests.get(url, auth=(token, ''), stream=True,params=request.args) return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) @@ -191,7 +191,7 @@ def get_csv(stream_name, reference_designator,start,end): @app.route('/api/uframe/get_json////') def get_json(stream_name, reference_designator,start,end): token = get_login() - dpa = "0" + dpa = "1" url = app.config['SERVICES_URL'] + '/uframe/get_json/%s/%s/%s/%s/%s' % (stream_name, reference_designator,start,end,dpa) req = requests.get(url, auth=(token, ''), stream=True,params=request.args) return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) @@ -199,7 +199,7 @@ def get_json(stream_name, reference_designator,start,end): @app.route('/api/uframe/get_netcdf////') def get_netcdf(stream_name, reference_designator,start,end): token = get_login() - dpa = "0" + dpa = "1" req = requests.get(app.config['SERVICES_URL'] + '/uframe/get_netcdf/%s/%s/%s/%s/%s' % (stream_name, reference_designator,start,end,dpa), auth=(token, ''), stream=True) return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) @@ -209,6 +209,26 @@ def get_profiles(stream_name, reference_designator): req = requests.get(app.config['SERVICES_URL'] + '/uframe/get_profiles/%s/%s/%s/%s' % (stream_name, reference_designator), auth=(token, ''), stream=True) return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) +@app.route('/api/uframe/get_csv/////') +def get_csv_dpaflag(stream_name, reference_designator,start,end,dpa): + token = get_login() + url = app.config['SERVICES_URL'] + '/uframe/get_csv/%s/%s/%s/%s/%s' % (stream_name, reference_designator,start,end,dpa) + req = requests.get(url, auth=(token, ''), stream=True,params=request.args) + return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) + +@app.route('/api/uframe/get_json/////') +def get_json_dpaflag(stream_name, reference_designator,start,end,dpa): + token = get_login() + url = app.config['SERVICES_URL'] + '/uframe/get_json/%s/%s/%s/%s/%s' % (stream_name, reference_designator,start,end,dpa) + req = requests.get(url, auth=(token, ''), stream=True,params=request.args) + return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) + +@app.route('/api/uframe/get_netcdf/////') +def get_netcdf_dpaflag(stream_name, reference_designator,start,end,dpa): + token = get_login() + req = requests.get(app.config['SERVICES_URL'] + '/uframe/get_netcdf/%s/%s/%s/%s/%s' % (stream_name, reference_designator,start,end,dpa), auth=(token, ''), stream=True) + return Response(stream_with_context(req.iter_content(chunk_size=1024*1024*4)), headers=dict(req.headers)) + @app.route('/svg/plot//', methods=['GET']) def get_plotdemo(instrument, stream): token = get_login() diff --git a/ooiui/static/js/partials/SVGPlotControl.html b/ooiui/static/js/partials/SVGPlotControl.html index 465f977fb..7f17d5c19 100644 --- a/ooiui/static/js/partials/SVGPlotControl.html +++ b/ooiui/static/js/partials/SVGPlotControl.html @@ -106,7 +106,7 @@ <% console.log(model.get('variables_shape')[varName]) %> <% if(model.get('variables_shape')[varName] == "function"){ %> - + <%} else { %> <% } %>