Set all requests to ssl
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
import logging
|
||||
from math import fabs
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
# dashboard/callbacks/appointments_callbacks.py
|
||||
import requests
|
||||
import json
|
||||
@@ -7,6 +11,10 @@ import os
|
||||
import sys
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
# This message will now appear in the terminal during startup
|
||||
logger.debug("Registering appointments page...")
|
||||
|
||||
|
||||
# --- Modalbox öffnen: jetzt auch auf Kalenderklick reagieren ---
|
||||
|
||||
sys.path.append('/workspace')
|
||||
@@ -14,6 +22,7 @@ sys.path.append('/workspace')
|
||||
print("appointments_callbacks.py geladen")
|
||||
|
||||
API_BASE_URL = os.getenv("API_BASE_URL", "http://192.168.43.100")
|
||||
ENV = os.getenv("ENV", "development")
|
||||
|
||||
|
||||
@callback(
|
||||
@@ -51,22 +60,23 @@ def display_select(select_info):
|
||||
dash.Input('calendar', 'lastNavClick'),
|
||||
)
|
||||
def load_events(view_dates):
|
||||
"""
|
||||
Lädt Events aus der API für den angezeigten Zeitraum im Kalender.
|
||||
"""
|
||||
print("Lade Events für Zeitraum:", view_dates)
|
||||
logger.info(f"Lade Events für Zeitraum: {view_dates}")
|
||||
if not view_dates or "start" not in view_dates or "end" not in view_dates:
|
||||
return []
|
||||
start = view_dates["start"]
|
||||
end = view_dates["end"]
|
||||
try:
|
||||
resp = requests.get(f"{API_BASE_URL}/api/events",
|
||||
params={"start": start, "end": end})
|
||||
verify_ssl = True if ENV == "production" else False
|
||||
resp = requests.get(
|
||||
f"{API_BASE_URL}/api/events",
|
||||
params={"start": start, "end": end},
|
||||
verify=verify_ssl
|
||||
)
|
||||
resp.raise_for_status()
|
||||
events = resp.json()
|
||||
return events
|
||||
except Exception as e:
|
||||
print("Fehler beim Laden der Events:", e)
|
||||
logger.info(f"Fehler beim Laden der Events: {e}")
|
||||
return []
|
||||
|
||||
# --- Modalbox öffnen ---
|
||||
|
||||
@@ -17,7 +17,7 @@ from datetime import datetime
|
||||
|
||||
print("overview_callbacks.py geladen")
|
||||
|
||||
API_BASE_URL = os.getenv("API_BASE_URL", "http://192.168.43.100")
|
||||
API_BASE_URL = os.getenv("API_BASE_URL", "https://192.168.43.100")
|
||||
|
||||
mqtt_thread_started = False
|
||||
SCREENSHOT_DIR = "received-screenshots"
|
||||
@@ -40,7 +40,11 @@ def get_latest_screenshot(client_uuid):
|
||||
|
||||
def fetch_clients():
|
||||
try:
|
||||
resp = requests.get(f"{API_BASE_URL}/api/clients")
|
||||
verify_ssl = True if ENV == "production" else False
|
||||
resp = requests.get(
|
||||
f"{API_BASE_URL}/api/clients",
|
||||
verify=verify_ssl
|
||||
)
|
||||
resp.raise_for_status()
|
||||
return resp.json()
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user