added back a route for the landing page, css tweaks
parent
67817f5094
commit
499e7fa836
20
app.py
20
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/<esn>/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/<esn>/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)
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
|
||||
<li class="nav-item active">
|
||||
<a href="/" class="navbar-brand d-flex align-items-center">
|
||||
<strong><small>status</small>.mcotton.space</strong>
|
||||
<small>status</small>.mcotton.space
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<div class="cover-container d-flex w-100 h-100 p-3 mx-auto flex-column">
|
||||
<header class="masthead mb-auto">
|
||||
<div class="inner">
|
||||
<h3 class="masthead-brand"><small>status</small>.mcotton.space</h3>
|
||||
<h3 class="masthead-brand"><a href="/"><small>status</small>.mcotton.space</a></h3>
|
||||
<!-- <nav class="nav nav-masthead justify-content-center">
|
||||
<a class="nav-link active" href="#">Home</a>
|
||||
<a class="nav-link" href="#">Features</a>
|
||||
|
|
Loading…
Reference in New Issue