mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
@@ -6,6 +6,7 @@ import dash_bootstrap_components as dbc
|
||||
from flask import Flask
|
||||
|
||||
from werkzeug import run_simple
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
|
||||
try:
|
||||
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
||||
@@ -40,6 +41,7 @@ def start_app(title, base_path, debug: bool, host, port, reloader=False, # pyl
|
||||
if unminified:
|
||||
locale_url = ["assets/plotly-with-meta.js"]
|
||||
app = Flask(__name__)
|
||||
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||||
app.config["DEBUG"] = debug
|
||||
if base_path == "/":
|
||||
application = DispatcherMiddleware(app)
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ def get_figures(car: Car):
|
||||
lats = [42, 41]
|
||||
lons = [1, 2]
|
||||
names = ["undefined", "undefined"]
|
||||
trips_map = px.line_mapbox(lat=lats, lon=lons, hover_name=names, zoom=12, mapbox_style="assets/style2.json")
|
||||
trips_map = px.line_mapbox(lat=lats, lon=lons, hover_name=names, zoom=12, mapbox_style="style.json")
|
||||
trips_map.add_trace(go.Scattermapbox(
|
||||
mode="markers",
|
||||
marker={"symbol": "marker", "size": 20},
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ def get_vehicle_info(vin):
|
||||
STYLE_CACHE = None
|
||||
|
||||
|
||||
@app.route("/assets/style2.json")
|
||||
@app.route("/style.json")
|
||||
def get_style():
|
||||
global STYLE_CACHE
|
||||
if not STYLE_CACHE:
|
||||
|
||||
Reference in New Issue
Block a user