From 499e7fa836db3a567ab5edac8bd90058855e8c89 Mon Sep 17 00:00:00 2001 From: Mark Cotton Date: Fri, 28 Jul 2023 10:55:08 -0600 Subject: [PATCH] added back a route for the landing page, css tweaks --- app.py | 20 ++++++++++++++++++++ templates/base.html | 2 +- templates/cover.html | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index c59dcd0..d5cff2d 100644 --- a/app.py +++ b/app.py @@ -46,6 +46,20 @@ else: +@app.route('/landing') +def landing(): + + # sometimes you just want to get to the landing page and want to avoid the index redirect logic + if 'een' in session: + een = session['een'] + else: + een = EagleEyev3(config) + session['een'] = een + + base_url = "https://auth.eagleeyenetworks.com/oauth2/authorize" + path_url = f"?client_id={een.client_id}&response_type=code&scope=vms.all&redirect_uri={een.redirect_uri}" + values = { "login_link": f"{base_url}{path_url}" } + return render_template('cover.html', template_values=values) @app.route('/') @@ -148,6 +162,7 @@ def camera__preivew_image(esn=None): else: return send_file('static/placeholder.png') + @app.route('/camera//preview') def camera_live_preivew(esn=None): if 'een' in session: @@ -189,6 +204,7 @@ def camera_detail(esn=None): return render_template('camera_events_partial.html', template_values=values) + @app.route('/camera//status_plot') def camera_status_plot(esn=None): if 'een' in session: @@ -236,5 +252,9 @@ def camera_status_plot(esn=None): + + + + if __name__ == '__main__': app.run(host=een.server_host, port=een.server_port) diff --git a/templates/base.html b/templates/base.html index aae388e..ffd8f39 100644 --- a/templates/base.html +++ b/templates/base.html @@ -52,7 +52,7 @@