feat: upgrade python version and install frontend in container
This commit is contained in:
parent
3be3a45606
commit
a482d5bba8
6 changed files with 77 additions and 30 deletions
|
@ -1,7 +1,7 @@
|
|||
import os
|
||||
from typing import Iterator
|
||||
|
||||
from flask import Flask, redirect, url_for
|
||||
from flask import Flask, redirect, url_for, send_from_directory
|
||||
from flask.typing import ResponseReturnValue
|
||||
from prometheus_client.metrics_core import GaugeMetricFamily, CounterMetricFamily
|
||||
from prometheus_client.registry import Collector
|
||||
|
@ -109,8 +109,21 @@ if not_migrating() and 'DISABLE_METRICS' not in os.environ:
|
|||
REGISTRY.register(AutomationCollector())
|
||||
|
||||
|
||||
@app.route('/ui')
|
||||
def redirect_ui():
|
||||
return redirect("/ui/")
|
||||
|
||||
@app.route('/ui/', defaults={'path': ''})
|
||||
@app.route('/ui/<path:path>')
|
||||
def serve_ui(path):
|
||||
if path != "" and os.path.exists("app/static/ui/" + path):
|
||||
return send_from_directory('static/ui', path)
|
||||
else:
|
||||
return send_from_directory('static/ui', 'index.html')
|
||||
|
||||
@app.route('/')
|
||||
def index() -> ResponseReturnValue:
|
||||
# TODO: update to point at new UI when ready
|
||||
return redirect(url_for("portal.portal_home"))
|
||||
|
||||
|
||||
|
|
|
@ -195,11 +195,13 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if config['ADDITIONAL_SIDEBAR_LINKS'] %}
|
||||
<h6 class="sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted">
|
||||
<span>Extras</span>
|
||||
</h6>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/ui/">{{ icon("globe") }} New UI</a>
|
||||
</li>
|
||||
{% for link in config['ADDITIONAL_SIDEBAR_LINKS'] %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ link['url'] }}">
|
||||
|
@ -208,7 +210,6 @@
|
|||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</nav>
|
||||
|
||||
<main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue