Adds breadcrumbs and navigation, moves QR code to its own page.

This commit is contained in:
Ana Custura 2026-02-18 13:17:22 +00:00
parent d9f4c6d597
commit 947b4ac59a
7 changed files with 93 additions and 27 deletions

View file

@ -79,16 +79,6 @@ def dump_settings(filename: str) -> None:
@app.route('/')
@app.route('/index')
def index():
display_wifi_password = False
wifi_password = get_setting("wifi_password")
if wifi_password:
wifi_ssid = get_setting("ssid")
wifi_encryption_type = "WPA2"
img = qrcode.make(f"WIFI:T:{wifi_encryption_type};S:{wifi_ssid};P:{wifi_password};;")
img.save("app/static/images/wifi_qr_code.png")
display_wifi_password = True
else:
os.remove("app/static/images/wifi_qr_code.png")
enable_chat = get_setting("enable_chat")
enable_app_store = get_setting("enable_app_store")
enable_map_viewer = get_setting("enable_map_viewer")
@ -116,7 +106,7 @@ def index():
"name": name,
"image": url_for("static", filename="images/explore-icon.svg"),
"url": url_for("files", path=""),})
return render_template('index.html', title='Home', get_setting=get_setting, services=service_array, display_wifi_password=display_wifi_password)
return render_template('index.html', title='Home', get_setting=get_setting, services=service_array)
@app.route('/files/', defaults={'path': ''})
@app.route('/files/<path:path>')
@ -236,4 +226,23 @@ def generate_random_deltachat_credentials():
flash(f"Username: {username}")
flash(f"Password: {password}")
flash(f"IP: {ip}")
return redirect(url_for("messaging"))
return redirect(url_for("messaging"))
@app.route('/share')
def share():
display_wifi_password = False
wifi_password = get_setting("wifi_password")
if wifi_password:
wifi_ssid = get_setting("ssid")
wifi_encryption_type = "WPA2"
img = qrcode.make(f"WIFI:T:{wifi_encryption_type};S:{wifi_ssid};P:{wifi_password};;")
img.save("app/static/images/wifi_qr_code.png")
display_wifi_password = True
else:
if os.path.exists("app/static/images/wifi_qr_code.png"):
os.remove("app/static/images/wifi_qr_code.png")
return render_template('share.html', get_setting=get_setting, display_wifi_password=display_wifi_password)
@app.route('/about')
def about():
return render_template('about.html', get_setting=get_setting)