From 138c5b1e8c6949514a427d5fa010c191351c7f25 Mon Sep 17 00:00:00 2001 From: olaf Date: Wed, 4 Jun 2025 17:05:59 +0000 Subject: [PATCH] minor changes to overview callbacks --- dashboard/callbacks/overview_callbacks.py | 8 ++++---- server/nano.7258.save | 16 ---------------- 2 files changed, 4 insertions(+), 20 deletions(-) delete mode 100644 server/nano.7258.save diff --git a/dashboard/callbacks/overview_callbacks.py b/dashboard/callbacks/overview_callbacks.py index 548e467..ee35494 100644 --- a/dashboard/callbacks/overview_callbacks.py +++ b/dashboard/callbacks/overview_callbacks.py @@ -13,7 +13,7 @@ import os from server.models import Client mqtt_thread_started = False -SCREENSHOT_DIR = "/workspace/received-screenshots" +SCREENSHOT_DIR = "received-screenshots" def ensure_mqtt_running(): global mqtt_thread_started @@ -23,12 +23,12 @@ def ensure_mqtt_running(): mqtt_thread_started = True def get_latest_screenshot(client_uuid): - prefix = f"client_{client_uuid}_" + prefix = f"{client_uuid}_" try: - files = [f for f in os.listdir(SCREENSHOT_DIR) if f.startswith(prefix)] + files = [f for f in os.listdir('..', SCREENSHOT_DIR) if f.startswith(prefix)] if not files: return "/assets/placeholder.png" - latest = max(files, key=lambda x: os.path.getmtime(os.path.join(SCREENSHOT_DIR, x))) + latest = max(files, key=lambda x: os.path.getmtime(os.path.join('.', SCREENSHOT_DIR, x))) return f"/received-screenshots/{latest}" except Exception: return "/assets/placeholder.png" diff --git a/server/nano.7258.save b/server/nano.7258.save deleted file mode 100644 index 9cc1e40..0000000 --- a/server/nano.7258.save +++ /dev/null @@ -1,16 +0,0 @@ -# server/wsgi.py - -from flask import Flask, jsonify - -app = Flask(__name__) - -@app.route("/health") -def health(): - return jsonify(status="ok") - -# Optional: Test-Route -@app.route("/") -def index(): - return "Hello from Infoscreen‐API!" - -# (Weitere Endpunkte, Blueprints, Datenbank-Initialisierung usw. kommen hierher)