WebSocket stabiler gemacht mit Puffern beim Broker
This commit is contained in:
1 parent
12523ddd0a
commit
c793e8b16d
10 files changed
+533
-37
No files matched your search
@@ -46,6 +46,26 @@ in `Caddyfile.example`.
|
|||||||
Wichtig: Der Flask-Port sollte nur für den Reverse-Proxy erreichbar sein, damit
|
Wichtig: Der Flask-Port sollte nur für den Reverse-Proxy erreichbar sein, damit
|
||||||
Clients den Header nicht selbst setzen können.
|
Clients den Header nicht selbst setzen können.
|
||||||
|
|
||||||
|
## WebSocket-Synchronisierung
|
||||||
|
|
||||||
|
Jeder Browser-Tab erzeugt eine Sitzungs-ID, die in `sessionStorage` gespeichert
|
||||||
|
wird und ein Neuladen übersteht. Nicht zustellbare Nachrichten mit Code >= 100
|
||||||
|
werden beim Broker pro `(Mandant, Account, Sitzungs-ID)` gepuffert und bei der
|
||||||
|
nächsten WebSocket-Verbindung mit derselben ID ausgeliefert.
|
||||||
|
|
||||||
|
Die beiden Zeitfenster lassen sich über Umgebungsvariablen konfigurieren:
|
||||||
|
|
||||||
|
- `CMBNET_WS_QUEUE_MAX_AGE_MINUTES` (Default `15`): Maximales Alter einer
|
||||||
|
Sitzungs-Queue. Ältere Queues werden verworfen; beim nächsten Reconnect wird
|
||||||
|
stattdessen eine Code-99-Nachricht mit Hinweis auf die zu lange Unterbrechung
|
||||||
|
zugestellt.
|
||||||
|
- `CMBNET_WS_GROUP_ONLINE_TIMEOUT_SECONDS` (Default `120`): Zeit ohne Code-2-
|
||||||
|
Lebenszeichen, nach der eine Gruppe von `online` auf `unterwegs` wechselt.
|
||||||
|
|
||||||
|
Die Sitzungs-Queues liegen im Arbeitsspeicher des Broker-Prozesses. Sie
|
||||||
|
überstehen damit WebSocket-Unterbrechungen und Seiten-Reloads, nicht aber einen
|
||||||
|
Neustart des Servers.
|
||||||
|
|
||||||
## Erste Einrichtung
|
## Erste Einrichtung
|
||||||
|
|
||||||
Nach der Initialisierung der Datenbank müssen noch Mandanten und ein Admin-Account angelegt werden.
|
Nach der Initialisierung der Datenbank müssen noch Mandanten und ein Admin-Account angelegt werden.
|
||||||
|
|||||||
+386
-20
@@ -15,10 +15,18 @@ Wichtige Regeln aus der Spezifikation:
|
|||||||
damit sie bei einer späteren Anmeldung als "Late Entry" nachgeliefert werden
|
damit sie bei einer späteren Anmeldung als "Late Entry" nachgeliefert werden
|
||||||
können. Nachrichten, die älter als LATE_ENTRY_MAX_AGE_HOURS (Default 8h) sind,
|
können. Nachrichten, die älter als LATE_ENTRY_MAX_AGE_HOURS (Default 8h) sind,
|
||||||
werden gelöscht.
|
werden gelöscht.
|
||||||
|
- Nicht zustellbare Nachrichten ab Code 100 werden pro Client-Sitzung gepuffert.
|
||||||
|
Eine zu alte Queue wird verworfen; beim nächsten Reconnect wird dann Code 99
|
||||||
|
mit einem Hinweis auf die zu lange Unterbrechung gesendet.
|
||||||
|
- Code 2 dient zugleich als Lebenszeichen einer Gruppe. Gruppen wechseln bei
|
||||||
|
einem Pong von "unterwegs" auf "online" und ohne Pong nach dem konfigurierten
|
||||||
|
Zeitfenster wieder zurück auf "unterwegs".
|
||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
from datetime import datetime, timedelta, timezone
|
from datetime import datetime, timedelta, timezone
|
||||||
|
from threading import Lock
|
||||||
from flask import current_app
|
from flask import current_app
|
||||||
from cmbnet.db import get_db
|
from cmbnet.db import get_db
|
||||||
from cmbnet.services.groups_service import GroupsService
|
from cmbnet.services.groups_service import GroupsService
|
||||||
@@ -38,6 +46,19 @@ class WebSocketBroker:
|
|||||||
# über die Verbindung senden.
|
# über die Verbindung senden.
|
||||||
self.authenticated = {}
|
self.authenticated = {}
|
||||||
|
|
||||||
|
# Nicht zustellbare Nachrichten werden pro Client-Sitzung gepuffert.
|
||||||
|
# Schlüssel: (tenant_id, account_id, session_id).
|
||||||
|
self.session_queues = {}
|
||||||
|
# Zuletzt bekannte Sitzungs-ID je Account. Sie erlaubt es, Nachrichten
|
||||||
|
# auch dann der richtigen Queue zuzuordnen, wenn gerade keine
|
||||||
|
# WebSocket-Verbindung besteht.
|
||||||
|
self.account_sessions = {}
|
||||||
|
self.queue_lock = Lock()
|
||||||
|
|
||||||
|
# Zeitpunkt des letzten Code-2-Pongs je Gruppe (monotonic).
|
||||||
|
self.group_last_pong = {}
|
||||||
|
self.group_online_since = {}
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# Verbindungen und Authentifizierung
|
# Verbindungen und Authentifizierung
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
@@ -84,16 +105,50 @@ class WebSocketBroker:
|
|||||||
'ws': ws,
|
'ws': ws,
|
||||||
'role': role,
|
'role': role,
|
||||||
'group_id': group_id,
|
'group_id': group_id,
|
||||||
'last_ping': datetime.now()
|
'session_id': None,
|
||||||
|
'last_ping': datetime.now(),
|
||||||
|
'connected_at': time.monotonic(),
|
||||||
|
'last_pong_at': None,
|
||||||
|
# simple-websocket schreibt Nachrichten direkt auf den Socket.
|
||||||
|
# Da Heartbeat, WebSocket-Routen und HTTP-ausgelöste Broadcasts
|
||||||
|
# aus unterschiedlichen Threads senden können, müssen die Frames
|
||||||
|
# pro Verbindung serialisiert werden. Sonst können sich zwei
|
||||||
|
# Frames überlagern und der Browser meldet "Invalid frame header".
|
||||||
|
'send_lock': Lock()
|
||||||
}
|
}
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def send_to_connection(self, tenant_id, account_id, data):
|
||||||
|
"""Sendet einen Frame thread-sicher an eine registrierte Verbindung."""
|
||||||
|
conn = self._get_connection(tenant_id, account_id)
|
||||||
|
if not conn:
|
||||||
|
return False
|
||||||
|
|
||||||
|
try:
|
||||||
|
lock = conn.get('send_lock')
|
||||||
|
if lock is None:
|
||||||
|
lock = Lock()
|
||||||
|
conn['send_lock'] = lock
|
||||||
|
with lock:
|
||||||
|
conn['ws'].send(data)
|
||||||
|
return True
|
||||||
|
except Exception:
|
||||||
|
# Eine fehlerhafte Verbindung darf den Versand an andere Clients
|
||||||
|
# nicht verhindern. Das Aufräumen übernimmt die Route beim
|
||||||
|
# Schließen der Verbindung.
|
||||||
|
return False
|
||||||
|
|
||||||
def is_authenticated(self, tenant_id, account_id):
|
def is_authenticated(self, tenant_id, account_id):
|
||||||
"""Prüft, ob eine Verbindung den Code-0-Handshake erfolgreich absolviert hat."""
|
"""Prüft, ob eine Verbindung den Code-0-Handshake erfolgreich absolviert hat."""
|
||||||
return self.authenticated.get(tenant_id, {}).get(account_id, False)
|
return self.authenticated.get(tenant_id, {}).get(account_id, False)
|
||||||
|
|
||||||
def authenticate(self, tenant_id, account_id, token):
|
def authenticate(self, tenant_id, account_id, token, session_id=None):
|
||||||
"""Authentifiziert eine Verbindung anhand des Einmal-Tokens (Code 0)."""
|
"""Authentifiziert eine Verbindung anhand des Einmal-Tokens (Code 0).
|
||||||
|
|
||||||
|
Die Sitzungs-ID stammt vom Client und bleibt auch nach einem Neuladen
|
||||||
|
erhalten. Sie ordnet die Verbindung einer eventuell vorhandenen
|
||||||
|
Nachrichten-Queue zu.
|
||||||
|
"""
|
||||||
db = get_db()
|
db = get_db()
|
||||||
token_row = db.execute(
|
token_row = db.execute(
|
||||||
'SELECT * FROM ws_tokens WHERE token = ? AND tenant_id = ? '
|
'SELECT * FROM ws_tokens WHERE token = ? AND tenant_id = ? '
|
||||||
@@ -121,13 +176,37 @@ class WebSocketBroker:
|
|||||||
db.execute('UPDATE ws_tokens SET used = 1 WHERE id = ?', (token_row['id'],))
|
db.execute('UPDATE ws_tokens SET used = 1 WHERE id = ?', (token_row['id'],))
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
|
session_id = self._normalize_session_id(session_id, account_id)
|
||||||
|
conn = self._get_connection(tenant_id, account_id)
|
||||||
|
if conn:
|
||||||
|
conn['session_id'] = session_id
|
||||||
|
if conn.get('role') == 'Gruppe' and conn.get('group_id'):
|
||||||
|
# Ein frisch verbundener Gruppen-Client erhält eine
|
||||||
|
# Zwei-Minuten-Kulanz, bis der erste Code-2-Pong eintrifft.
|
||||||
|
key = (tenant_id, conn['group_id'])
|
||||||
|
self.group_online_since[key] = time.monotonic()
|
||||||
|
self.account_sessions[(tenant_id, account_id)] = session_id
|
||||||
|
|
||||||
if tenant_id not in self.authenticated:
|
if tenant_id not in self.authenticated:
|
||||||
self.authenticated[tenant_id] = {}
|
self.authenticated[tenant_id] = {}
|
||||||
self.authenticated[tenant_id][account_id] = True
|
self.authenticated[tenant_id][account_id] = True
|
||||||
|
|
||||||
|
# Zuerst die für diese Sitzung gepufferten Nachrichten ausliefern.
|
||||||
|
# Wurde die Queue wegen Überschreitung der Maximalzeit verworfen, wird
|
||||||
|
# stattdessen ausschließlich ein Code-99-Hinweis gesendet.
|
||||||
|
queued_messages, suppress_late_entries = self.restore_session_queue(
|
||||||
|
tenant_id, account_id, session_id
|
||||||
|
)
|
||||||
|
|
||||||
# Nach erfolgreicher Authentifizierung dürfen die gespeicherten
|
# Nach erfolgreicher Authentifizierung dürfen die gespeicherten
|
||||||
# Nachrichten der letzten 8 Stunden nachgeliefert werden.
|
# Nachrichten der letzten 8 Stunden nachgeliefert werden. Bereits aus
|
||||||
self.send_late_entries(tenant_id, account_id)
|
# der Sitzungs-Queue zugestellte Nachrichten werden dabei ausgelassen.
|
||||||
|
if not suppress_late_entries:
|
||||||
|
self.send_late_entries(
|
||||||
|
tenant_id,
|
||||||
|
account_id,
|
||||||
|
skip_messages=queued_messages
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def remove_connection(self, tenant_id, account_id, ws=None):
|
def remove_connection(self, tenant_id, account_id, ws=None):
|
||||||
@@ -139,7 +218,9 @@ class WebSocketBroker:
|
|||||||
"""
|
"""
|
||||||
connections = self.connections.get(tenant_id)
|
connections = self.connections.get(tenant_id)
|
||||||
if connections and account_id in connections:
|
if connections and account_id in connections:
|
||||||
if ws is None or connections[account_id].get('ws') is ws:
|
conn = connections[account_id]
|
||||||
|
if ws is None or conn.get('ws') is ws:
|
||||||
|
session_id = conn.get('session_id')
|
||||||
del connections[account_id]
|
del connections[account_id]
|
||||||
# Nur wenn die tatsächlich beendete Verbindung die aktuelle
|
# Nur wenn die tatsächlich beendete Verbindung die aktuelle
|
||||||
# war, darf auch der Authentifizierungsstatus entfernt werden.
|
# war, darf auch der Authentifizierungsstatus entfernt werden.
|
||||||
@@ -147,13 +228,178 @@ class WebSocketBroker:
|
|||||||
if authenticated and account_id in authenticated:
|
if authenticated and account_id in authenticated:
|
||||||
del authenticated[account_id]
|
del authenticated[account_id]
|
||||||
|
|
||||||
|
# Ab dem Trennen beginnt die Lebenszeit der Sitzungs-Queue.
|
||||||
|
if session_id:
|
||||||
|
with self.queue_lock:
|
||||||
|
self._ensure_session_queue(
|
||||||
|
tenant_id, account_id, session_id
|
||||||
|
)
|
||||||
|
|
||||||
def _get_connection(self, tenant_id, account_id):
|
def _get_connection(self, tenant_id, account_id):
|
||||||
return self.connections.get(tenant_id, {}).get(account_id)
|
return self.connections.get(tenant_id, {}).get(account_id)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# Sitzungs-Queues
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
@staticmethod
|
||||||
|
def _normalize_session_id(value, account_id):
|
||||||
|
"""Validiert die vom Client gelieferte Sitzungs-ID.
|
||||||
|
|
||||||
|
Ältere Clients senden noch keine ID. Für sie wird eine stabile
|
||||||
|
Ersatz-ID je Account gebildet, damit auch dort die Queue funktioniert.
|
||||||
|
"""
|
||||||
|
text = str(value or '').strip()
|
||||||
|
if re.fullmatch(r'[A-Za-z0-9._:-]{8,128}', text):
|
||||||
|
return text
|
||||||
|
return f'legacy-{account_id}'
|
||||||
|
|
||||||
|
def _session_queue_max_age_seconds(self):
|
||||||
|
minutes = current_app.config.get('WS_QUEUE_MAX_AGE_MINUTES', 15)
|
||||||
|
try:
|
||||||
|
minutes = float(minutes)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
minutes = 15
|
||||||
|
return max(0.0, minutes * 60)
|
||||||
|
|
||||||
|
def _ensure_session_queue(self, tenant_id, account_id, session_id, now=None):
|
||||||
|
"""Liefert die Queue einer Sitzung und legt sie bei Bedarf an."""
|
||||||
|
key = (tenant_id, account_id, session_id)
|
||||||
|
queue = self.session_queues.get(key)
|
||||||
|
if queue is None:
|
||||||
|
queue = {
|
||||||
|
'messages': [],
|
||||||
|
'created_at': now if now is not None else time.monotonic(),
|
||||||
|
'expired': False,
|
||||||
|
'code99_only': False,
|
||||||
|
'code99_message': None,
|
||||||
|
}
|
||||||
|
self.session_queues[key] = queue
|
||||||
|
return queue
|
||||||
|
|
||||||
|
def _expire_session_queue(self, queue, now=None):
|
||||||
|
"""Verwirft zu alte Nachrichten und hinterlässt einen Code-99-Hinweis."""
|
||||||
|
if not queue or queue.get('code99_only') or queue.get('expired'):
|
||||||
|
return
|
||||||
|
|
||||||
|
now = now if now is not None else time.monotonic()
|
||||||
|
if now - queue.get('created_at', now) < self._session_queue_max_age_seconds():
|
||||||
|
return
|
||||||
|
|
||||||
|
queue['messages'].clear()
|
||||||
|
queue['expired'] = True
|
||||||
|
|
||||||
|
def _queue_undeliverable(self, tenant_id, account_id, message):
|
||||||
|
"""Puffert eine nicht zustellbare Nachricht für die letzte Sitzung."""
|
||||||
|
if message.code < 100 and message.code != 99:
|
||||||
|
return
|
||||||
|
|
||||||
|
session_id = self.account_sessions.get((tenant_id, account_id))
|
||||||
|
if not session_id:
|
||||||
|
return
|
||||||
|
|
||||||
|
with self.queue_lock:
|
||||||
|
queue = self._ensure_session_queue(tenant_id, account_id, session_id)
|
||||||
|
now = time.monotonic()
|
||||||
|
|
||||||
|
if message.code == 99:
|
||||||
|
# Eine nicht zustellbare Reload-Aufforderung verdrängt alle
|
||||||
|
# älteren Nachrichten. Danach wird nichts weiter gepuffert.
|
||||||
|
queue['messages'].clear()
|
||||||
|
queue['code99_only'] = True
|
||||||
|
queue['code99_message'] = message.to_json()
|
||||||
|
queue['expired'] = False
|
||||||
|
return
|
||||||
|
|
||||||
|
self._expire_session_queue(queue, now)
|
||||||
|
if queue.get('expired') or queue.get('code99_only'):
|
||||||
|
return
|
||||||
|
|
||||||
|
queue['messages'].append(message.to_json())
|
||||||
|
|
||||||
|
def cleanup_session_queues(self):
|
||||||
|
"""Markiert abgelaufene Sitzungs-Queues und verwirft deren Nachrichten."""
|
||||||
|
now = time.monotonic()
|
||||||
|
with self.queue_lock:
|
||||||
|
for queue in self.session_queues.values():
|
||||||
|
self._expire_session_queue(queue, now)
|
||||||
|
|
||||||
|
def _session_queue_timeout_message(self):
|
||||||
|
minutes = current_app.config.get('WS_QUEUE_MAX_AGE_MINUTES', 15)
|
||||||
|
return WSMessage(
|
||||||
|
sender_id=0,
|
||||||
|
code=99,
|
||||||
|
msg=(
|
||||||
|
'Die WebSocket-Verbindung war zu lange unterbrochen '
|
||||||
|
f'(mehr als {minutes} Minuten). Bitte lade die Seite neu, '
|
||||||
|
'um den aktuellen Stand zu erhalten.'
|
||||||
|
)
|
||||||
|
).to_json()
|
||||||
|
|
||||||
|
def restore_session_queue(self, tenant_id, account_id, session_id):
|
||||||
|
"""Liefert gepufferte Nachrichten einer wiedererkannten Sitzung aus.
|
||||||
|
|
||||||
|
Rückgabe: (Menge der Roh-Nachrichten aus der Queue, Late-Entry-Sperre).
|
||||||
|
Die Menge dient dazu, dieselben Nachrichten nicht zusätzlich als
|
||||||
|
Late Entry zu senden. Die Sperre ist gesetzt, wenn die Queue abgelaufen
|
||||||
|
war oder nur noch eine Code-99-Nachricht enthielt. In diesem Fall darf
|
||||||
|
keine zusätzliche Late-Entry-Historie mehr gesendet werden.
|
||||||
|
"""
|
||||||
|
key = (tenant_id, account_id, session_id)
|
||||||
|
now = time.monotonic()
|
||||||
|
|
||||||
|
with self.queue_lock:
|
||||||
|
queue = self.session_queues.get(key)
|
||||||
|
if not queue:
|
||||||
|
return set(), False
|
||||||
|
self._expire_session_queue(queue, now)
|
||||||
|
|
||||||
|
if queue.get('code99_only'):
|
||||||
|
raw_message = queue.get('code99_message') or self._session_queue_timeout_message()
|
||||||
|
self.session_queues.pop(key, None)
|
||||||
|
send_only = True
|
||||||
|
messages = []
|
||||||
|
elif queue.get('expired'):
|
||||||
|
raw_message = self._session_queue_timeout_message()
|
||||||
|
self.session_queues.pop(key, None)
|
||||||
|
send_only = True
|
||||||
|
messages = []
|
||||||
|
else:
|
||||||
|
raw_message = None
|
||||||
|
send_only = False
|
||||||
|
messages = list(queue.get('messages', []))
|
||||||
|
queue['messages'] = []
|
||||||
|
|
||||||
|
if send_only:
|
||||||
|
if raw_message and not self.send_to_connection(tenant_id, account_id, raw_message):
|
||||||
|
# Verbindung ist bereits wieder weg: Queue für den nächsten
|
||||||
|
# Versuch erhalten.
|
||||||
|
with self.queue_lock:
|
||||||
|
self.session_queues.setdefault(key, queue)
|
||||||
|
return set(), True
|
||||||
|
|
||||||
|
unsent = []
|
||||||
|
for index, raw_message in enumerate(messages):
|
||||||
|
if not self.send_to_connection(tenant_id, account_id, raw_message):
|
||||||
|
unsent = messages[index:]
|
||||||
|
break
|
||||||
|
|
||||||
|
with self.queue_lock:
|
||||||
|
current = self.session_queues.get(key)
|
||||||
|
if current is not None:
|
||||||
|
if unsent:
|
||||||
|
current['messages'] = unsent + current.get('messages', [])
|
||||||
|
if not current.get('messages'):
|
||||||
|
self.session_queues.pop(key, None)
|
||||||
|
|
||||||
|
# Auch nicht zugestellte Queue-Nachrichten von den Late Entries
|
||||||
|
# ausnehmen. Sie bleiben in der Queue und werden beim nächsten
|
||||||
|
# Reconnect erneut versucht, statt doppelt gepuffert zu werden.
|
||||||
|
return set(messages), False
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# Late Entry
|
# Late Entry
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
def send_late_entries(self, tenant_id, account_id):
|
def send_late_entries(self, tenant_id, account_id, skip_messages=None):
|
||||||
"""Sendet gespeicherte Nachrichten (Code >= 1000) der letzten 8 Stunden.
|
"""Sendet gespeicherte Nachrichten (Code >= 1000) der letzten 8 Stunden.
|
||||||
|
|
||||||
Es werden ausschließlich Nachrichten zugestellt, für die der Account
|
Es werden ausschließlich Nachrichten zugestellt, für die der Account
|
||||||
@@ -162,6 +408,7 @@ class WebSocketBroker:
|
|||||||
"""
|
"""
|
||||||
db = get_db()
|
db = get_db()
|
||||||
cutoff = self._late_entry_cutoff()
|
cutoff = self._late_entry_cutoff()
|
||||||
|
skip_messages = skip_messages or set()
|
||||||
|
|
||||||
messages = db.execute(
|
messages = db.execute(
|
||||||
'SELECT * FROM ws_messages_store WHERE tenant_id = ? AND ts >= ? '
|
'SELECT * FROM ws_messages_store WHERE tenant_id = ? AND ts >= ? '
|
||||||
@@ -184,6 +431,8 @@ class WebSocketBroker:
|
|||||||
msg=msg_row['msg'],
|
msg=msg_row['msg'],
|
||||||
ts=msg_row['ts']
|
ts=msg_row['ts']
|
||||||
)
|
)
|
||||||
|
if msg.to_json() in skip_messages:
|
||||||
|
continue
|
||||||
self._send(tenant_id, account_id, msg)
|
self._send(tenant_id, account_id, msg)
|
||||||
|
|
||||||
# Abgelaufene Nachrichten werden bei jeder Anmeldung aufgeräumt.
|
# Abgelaufene Nachrichten werden bei jeder Anmeldung aufgeräumt.
|
||||||
@@ -299,8 +548,10 @@ class WebSocketBroker:
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Code 2 ist die Antwort eines Clients auf den Heartbeat. Sie wird nur
|
# Code 2 ist die Antwort eines Clients auf den Heartbeat. Sie wird nur
|
||||||
# an Dispatcher-Views weitergeleitet und nicht gespeichert.
|
# an Dispatcher-Views weitergeleitet und nicht gespeichert. Gleichzeitig
|
||||||
|
# dient sie als Lebenszeichen der Gruppe.
|
||||||
if code == 2:
|
if code == 2:
|
||||||
|
self._record_client_pong(tenant_id, sender['id'], sender)
|
||||||
self._deliver(tenant_id, message, sender)
|
self._deliver(tenant_id, message, sender)
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -352,6 +603,122 @@ class WebSocketBroker:
|
|||||||
return self._apply_group_position_change(tenant_id, message, sender, payload)
|
return self._apply_group_position_change(tenant_id, message, sender, payload)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# Anwesenheit von Gruppen-Clients
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
def _record_client_pong(self, tenant_id, account_id, sender):
|
||||||
|
"""Wertet ein Code-2-Lebenszeichen eines Clients aus."""
|
||||||
|
conn = self._get_connection(tenant_id, account_id)
|
||||||
|
if conn:
|
||||||
|
conn['last_pong_at'] = time.monotonic()
|
||||||
|
|
||||||
|
if not sender or sender['role'] != 'Gruppe':
|
||||||
|
return
|
||||||
|
|
||||||
|
db = get_db()
|
||||||
|
group = db.execute(
|
||||||
|
'''SELECT g.id, g.state FROM groups g
|
||||||
|
JOIN group_accounts ga
|
||||||
|
ON ga.group_id = g.id AND ga.tenant_id = g.tenant_id
|
||||||
|
WHERE ga.account_id = ? AND g.tenant_id = ?''',
|
||||||
|
(account_id, tenant_id)
|
||||||
|
).fetchone()
|
||||||
|
if not group:
|
||||||
|
return
|
||||||
|
|
||||||
|
now = time.monotonic()
|
||||||
|
group_id = group['id']
|
||||||
|
self.group_last_pong[(tenant_id, group_id)] = now
|
||||||
|
|
||||||
|
if group['state'] == 'unterwegs':
|
||||||
|
self._set_group_state_internal(
|
||||||
|
tenant_id, group_id, 'online', actor_account_id=account_id
|
||||||
|
)
|
||||||
|
|
||||||
|
def _set_group_state_internal(self, tenant_id, group_id, new_state, actor_account_id=None):
|
||||||
|
"""Setzt einen automatisch abgeleiteten Gruppenstatus und informiert Clients."""
|
||||||
|
db = get_db()
|
||||||
|
group = db.execute(
|
||||||
|
'SELECT * FROM groups WHERE id = ? AND tenant_id = ?',
|
||||||
|
(group_id, tenant_id)
|
||||||
|
).fetchone()
|
||||||
|
if not group or group['state'] == new_state:
|
||||||
|
return False
|
||||||
|
|
||||||
|
old_state = group['state']
|
||||||
|
db.execute(
|
||||||
|
'UPDATE groups SET state = ?, updated_at = CURRENT_TIMESTAMP '
|
||||||
|
'WHERE id = ? AND tenant_id = ?',
|
||||||
|
(new_state, group_id, tenant_id)
|
||||||
|
)
|
||||||
|
db.execute(
|
||||||
|
'''INSERT INTO group_state_history
|
||||||
|
(tenant_id, group_id, from_state, to_state, last_lat, last_lon,
|
||||||
|
last_pos_at, actor_account_id)
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)''',
|
||||||
|
(tenant_id, group_id, old_state, new_state,
|
||||||
|
group['last_lat'], group['last_lon'], group['last_pos_at'],
|
||||||
|
actor_account_id)
|
||||||
|
)
|
||||||
|
db.commit()
|
||||||
|
GroupsService.update_cache_entry(
|
||||||
|
tenant_id, group_id, {'state': new_state}
|
||||||
|
)
|
||||||
|
|
||||||
|
if new_state == 'online':
|
||||||
|
self.group_online_since[(tenant_id, group_id)] = time.monotonic()
|
||||||
|
|
||||||
|
message = WSMessage(
|
||||||
|
sender_id=actor_account_id or 0,
|
||||||
|
code=200,
|
||||||
|
msg=json.dumps({
|
||||||
|
'group_id': group_id,
|
||||||
|
'state': new_state,
|
||||||
|
'actor': actor_account_id,
|
||||||
|
'automatic': True
|
||||||
|
}, ensure_ascii=False)
|
||||||
|
)
|
||||||
|
self._deliver(tenant_id, message, None)
|
||||||
|
return True
|
||||||
|
|
||||||
|
def check_group_presence_timeouts(self, tenant_id=None):
|
||||||
|
"""Setzt Online-Gruppen ohne Code-2-Pong auf "unterwegs" zurück."""
|
||||||
|
db = get_db()
|
||||||
|
if tenant_id is None:
|
||||||
|
rows = db.execute(
|
||||||
|
"SELECT id, tenant_id FROM groups WHERE state = 'online'"
|
||||||
|
).fetchall()
|
||||||
|
else:
|
||||||
|
rows = db.execute(
|
||||||
|
"SELECT id, tenant_id FROM groups "
|
||||||
|
"WHERE state = 'online' AND tenant_id = ?",
|
||||||
|
(tenant_id,)
|
||||||
|
).fetchall()
|
||||||
|
|
||||||
|
timeout = current_app.config.get('WS_GROUP_ONLINE_TIMEOUT_SECONDS', 120)
|
||||||
|
try:
|
||||||
|
timeout = float(timeout)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
timeout = 120.0
|
||||||
|
|
||||||
|
now = time.monotonic()
|
||||||
|
for row in rows:
|
||||||
|
key = (row['tenant_id'], row['id'])
|
||||||
|
reference = self.group_last_pong.get(key)
|
||||||
|
online_since = self.group_online_since.get(key)
|
||||||
|
if online_since is not None:
|
||||||
|
reference = max(reference, online_since) if reference else online_since
|
||||||
|
if reference is None:
|
||||||
|
# Zustand war bereits vor dem Start des Trackings "online".
|
||||||
|
# Ab jetzt läuft die Kulanzfrist.
|
||||||
|
self.group_online_since[key] = now
|
||||||
|
continue
|
||||||
|
|
||||||
|
if now - reference > timeout:
|
||||||
|
self._set_group_state_internal(
|
||||||
|
row['tenant_id'], row['id'], 'unterwegs'
|
||||||
|
)
|
||||||
|
|
||||||
def _apply_street_change(self, tenant_id, message, sender, payload):
|
def _apply_street_change(self, tenant_id, message, sender, payload):
|
||||||
"""Wendet einen Straßen-State-Wechsel aus einer Code-100-Nachricht an."""
|
"""Wendet einen Straßen-State-Wechsel aus einer Code-100-Nachricht an."""
|
||||||
if sender['role'] not in ('Dispatcher', 'Administrator'):
|
if sender['role'] not in ('Dispatcher', 'Administrator'):
|
||||||
@@ -492,6 +859,8 @@ class WebSocketBroker:
|
|||||||
)
|
)
|
||||||
db.commit()
|
db.commit()
|
||||||
GroupsService.update_cache_entry(tenant_id, group_id, {'state': new_state})
|
GroupsService.update_cache_entry(tenant_id, group_id, {'state': new_state})
|
||||||
|
if new_state == 'online':
|
||||||
|
self.group_online_since[(tenant_id, group_id)] = time.monotonic()
|
||||||
self._log_business(tenant_id, sender['id'], 'group.state_change', 'group',
|
self._log_business(tenant_id, sender['id'], 'group.state_change', 'group',
|
||||||
group_id, {'from': group['state'], 'to': new_state})
|
group_id, {'from': group['state'], 'to': new_state})
|
||||||
|
|
||||||
@@ -730,21 +1099,18 @@ class WebSocketBroker:
|
|||||||
self._send(tenant_id, recipient_id, message)
|
self._send(tenant_id, recipient_id, message)
|
||||||
|
|
||||||
def _send(self, tenant_id, account_id, message):
|
def _send(self, tenant_id, account_id, message):
|
||||||
"""Sendet eine Nachricht, falls für den Account eine Verbindung besteht."""
|
"""Sendet eine Nachricht oder puffert sie für die letzte Sitzung."""
|
||||||
# Erst nach erfolgreicher Token-Authentifizierung dürfen Nachrichten
|
# Erst nach erfolgreicher Token-Authentifizierung dürfen Nachrichten
|
||||||
# an einen Client zugestellt werden.
|
# an einen Client zugestellt werden.
|
||||||
if not self.is_authenticated(tenant_id, account_id):
|
if not self.is_authenticated(tenant_id, account_id):
|
||||||
return
|
self._queue_undeliverable(tenant_id, account_id, message)
|
||||||
conn = self._get_connection(tenant_id, account_id)
|
return False
|
||||||
if not conn:
|
|
||||||
return
|
if self.send_to_connection(tenant_id, account_id, message.to_json()):
|
||||||
try:
|
return True
|
||||||
conn['ws'].send(message.to_json())
|
|
||||||
except Exception:
|
self._queue_undeliverable(tenant_id, account_id, message)
|
||||||
# Eine fehlerhafte Verbindung darf den Versand an andere Clients
|
return False
|
||||||
# nicht verhindern. Das Aufräumen übernimmt die Route beim
|
|
||||||
# Schließen der Verbindung.
|
|
||||||
pass
|
|
||||||
|
|
||||||
def _get_recipients(self, tenant_id, message, sender):
|
def _get_recipients(self, tenant_id, message, sender):
|
||||||
"""Bestimmt den Empfängerkreis abhängig vom Nachrichtencode."""
|
"""Bestimmt den Empfängerkreis abhängig vom Nachrichtencode."""
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class HeartbeatManager:
|
|||||||
self.running = False
|
self.running = False
|
||||||
self.app = None
|
self.app = None
|
||||||
self._timer = None
|
self._timer = None
|
||||||
|
self._presence_timer = None
|
||||||
|
|
||||||
def start(self, app=None, interval=None):
|
def start(self, app=None, interval=None):
|
||||||
"""Startet die zyklische Heartbeat-Routine."""
|
"""Startet die zyklische Heartbeat-Routine."""
|
||||||
@@ -33,13 +34,34 @@ class HeartbeatManager:
|
|||||||
return
|
return
|
||||||
self.running = True
|
self.running = True
|
||||||
self._send_heartbeat()
|
self._send_heartbeat()
|
||||||
|
self._check_presence()
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
"""Stoppt die Heartbeat-Routine."""
|
"""Stoppt die Heartbeat-Routine."""
|
||||||
self.running = False
|
self.running = False
|
||||||
if self._timer is not None:
|
for timer in (self._timer, self._presence_timer):
|
||||||
self._timer.cancel()
|
if timer is not None:
|
||||||
self._timer = None
|
timer.cancel()
|
||||||
|
self._timer = None
|
||||||
|
self._presence_timer = None
|
||||||
|
|
||||||
|
def _check_presence(self):
|
||||||
|
"""Prüft die Code-2-Lebenszeichen der Gruppen unabhängig vom Heartbeat."""
|
||||||
|
if not self.running:
|
||||||
|
return
|
||||||
|
|
||||||
|
if self.app is not None:
|
||||||
|
try:
|
||||||
|
with self.app.app_context():
|
||||||
|
broker.check_group_presence_timeouts()
|
||||||
|
except Exception as exc:
|
||||||
|
print(f'Group presence check error: {exc}')
|
||||||
|
|
||||||
|
# Kürzer als das Zwei-Minuten-Fenster prüfen, damit der Status
|
||||||
|
# zeitnah auf "unterwegs" wechselt.
|
||||||
|
self._presence_timer = Timer(15, self._check_presence)
|
||||||
|
self._presence_timer.daemon = True
|
||||||
|
self._presence_timer.start()
|
||||||
|
|
||||||
def _send_heartbeat(self):
|
def _send_heartbeat(self):
|
||||||
if not self.running:
|
if not self.running:
|
||||||
@@ -49,20 +71,16 @@ class HeartbeatManager:
|
|||||||
|
|
||||||
# Nur authentifizierte Verbindungen erhalten einen Heartbeat.
|
# Nur authentifizierte Verbindungen erhalten einen Heartbeat.
|
||||||
for tenant_id, connections in list(broker.connections.items()):
|
for tenant_id, connections in list(broker.connections.items()):
|
||||||
for account_id, conn_info in list(connections.items()):
|
for account_id in list(connections):
|
||||||
if not broker.is_authenticated(tenant_id, account_id):
|
if not broker.is_authenticated(tenant_id, account_id):
|
||||||
continue
|
continue
|
||||||
try:
|
broker.send_to_connection(tenant_id, account_id, msg.to_json())
|
||||||
conn_info['ws'].send(msg.to_json())
|
|
||||||
except Exception:
|
|
||||||
# Defekte Verbindungen werden beim Schließen durch die
|
|
||||||
# WebSocket-Route entfernt.
|
|
||||||
pass
|
|
||||||
|
|
||||||
# Abgelaufene persistierte Nachrichten löschen.
|
# Abgelaufene persistierte Nachrichten und Sitzungs-Queues löschen.
|
||||||
if self.app is not None:
|
if self.app is not None:
|
||||||
try:
|
try:
|
||||||
with self.app.app_context():
|
with self.app.app_context():
|
||||||
|
broker.cleanup_session_queues()
|
||||||
broker.cleanup_old_messages()
|
broker.cleanup_old_messages()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
print(f'Heartbeat cleanup error: {exc}')
|
print(f'Heartbeat cleanup error: {exc}')
|
||||||
|
|||||||
@@ -3,16 +3,38 @@ WebSocket Routes
|
|||||||
|
|
||||||
Ablauf einer Verbindung:
|
Ablauf einer Verbindung:
|
||||||
1. Client verbindet sich mit /<tenant>/ws.
|
1. Client verbindet sich mit /<tenant>/ws.
|
||||||
2. Client sendet Code 0 mit dem zuvor über die API geholten Einmal-Token.
|
2. Client sendet Code 0 mit dem zuvor über die API geholten Einmal-Token
|
||||||
|
und seiner persistenten Sitzungs-ID.
|
||||||
3. Erst nach erfolgreicher Prüfung dürfen fachliche Nachrichten gesendet
|
3. Erst nach erfolgreicher Prüfung dürfen fachliche Nachrichten gesendet
|
||||||
werden. Vorher wird die Verbindung geschlossen.
|
werden. Vorher wird die Verbindung geschlossen.
|
||||||
"""
|
"""
|
||||||
|
import json
|
||||||
|
|
||||||
from flask import session
|
from flask import session
|
||||||
from cmbnet.extensions import sock
|
from cmbnet.extensions import sock
|
||||||
from cmbnet.ws import broker
|
from cmbnet.ws import broker
|
||||||
from cmbnet.ws.protocol import WSMessage
|
from cmbnet.ws.protocol import WSMessage
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_auth_payload(value):
|
||||||
|
"""Liefert (Token, Sitzungs-ID) aus dem Code-0-Payload."""
|
||||||
|
if isinstance(value, dict):
|
||||||
|
return value.get('token'), value.get('session_id')
|
||||||
|
|
||||||
|
if isinstance(value, str):
|
||||||
|
text = value.strip()
|
||||||
|
if text.startswith('{'):
|
||||||
|
try:
|
||||||
|
data = json.loads(text)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
return None, None
|
||||||
|
if isinstance(data, dict):
|
||||||
|
return data.get('token'), data.get('session_id')
|
||||||
|
return text, None
|
||||||
|
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
|
||||||
@sock.route('/<tenant>/ws')
|
@sock.route('/<tenant>/ws')
|
||||||
def ws(ws, tenant):
|
def ws(ws, tenant):
|
||||||
"""WebSocket Endpoint"""
|
"""WebSocket Endpoint"""
|
||||||
@@ -51,7 +73,10 @@ def ws(ws, tenant):
|
|||||||
|
|
||||||
# Code 0: Authentifizierung über den Einmal-Token.
|
# Code 0: Authentifizierung über den Einmal-Token.
|
||||||
if msg.code == 0:
|
if msg.code == 0:
|
||||||
if not broker.authenticate(tenant_id, account_id, msg.msg):
|
token, session_id = _parse_auth_payload(msg.msg)
|
||||||
|
if not token or not broker.authenticate(
|
||||||
|
tenant_id, account_id, token, session_id
|
||||||
|
):
|
||||||
ws.close()
|
ws.close()
|
||||||
break
|
break
|
||||||
continue
|
continue
|
||||||
|
|||||||
@@ -15,6 +15,15 @@ class Config:
|
|||||||
|
|
||||||
WS_HEARTBEAT_INTERVAL = int(os.environ.get('CMBNET_WS_HEARTBEAT_INTERVAL', '60'))
|
WS_HEARTBEAT_INTERVAL = int(os.environ.get('CMBNET_WS_HEARTBEAT_INTERVAL', '60'))
|
||||||
WS_HEARTBEAT_TIMEOUT = 15
|
WS_HEARTBEAT_TIMEOUT = 15
|
||||||
|
# Wartezeit, bis ein Code-2-Pong als überfällig gilt.
|
||||||
|
WS_GROUP_ONLINE_TIMEOUT_SECONDS = int(
|
||||||
|
os.environ.get('CMBNET_WS_GROUP_ONLINE_TIMEOUT_SECONDS', '120')
|
||||||
|
)
|
||||||
|
# Wie lange nicht zustellbare Nachrichten pro Client-Sitzung vorgehalten
|
||||||
|
# werden, bevor sie verworfen und durch einen Code-99-Hinweis ersetzt werden.
|
||||||
|
WS_QUEUE_MAX_AGE_MINUTES = int(
|
||||||
|
os.environ.get('CMBNET_WS_QUEUE_MAX_AGE_MINUTES', '15')
|
||||||
|
)
|
||||||
LATE_ENTRY_MAX_AGE_HOURS = int(os.environ.get('CMBNET_LATE_ENTRY_MAX_AGE_HOURS', '8'))
|
LATE_ENTRY_MAX_AGE_HOURS = int(os.environ.get('CMBNET_LATE_ENTRY_MAX_AGE_HOURS', '8'))
|
||||||
|
|
||||||
LOG_DIR = BASE_DIR / 'logs'
|
LOG_DIR = BASE_DIR / 'logs'
|
||||||
|
|||||||
@@ -125,7 +125,13 @@
|
|||||||
adminSocket = ws;
|
adminSocket = ws;
|
||||||
|
|
||||||
ws.addEventListener('open', () => {
|
ws.addEventListener('open', () => {
|
||||||
ws.send(JSON.stringify({code: 0, msg: data.token}));
|
ws.send(JSON.stringify({
|
||||||
|
code: 0,
|
||||||
|
msg: {
|
||||||
|
token: data.token,
|
||||||
|
session_id: window.CMBNET_CLIENT_SESSION_ID || ''
|
||||||
|
}
|
||||||
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
ws.addEventListener('message', event => {
|
ws.addEventListener('message', event => {
|
||||||
@@ -135,6 +141,12 @@
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (Number(message.code) === 1) {
|
||||||
|
if (ws.readyState === WebSocket.OPEN) {
|
||||||
|
ws.send(JSON.stringify({code: 2, msg: 'pong'}));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (Number(message.code) !== 99) return;
|
if (Number(message.code) !== 99) return;
|
||||||
const text = typeof message.msg === 'string'
|
const text = typeof message.msg === 'string'
|
||||||
? message.msg
|
? message.msg
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
* damit er sowohl die mobilen Views als auch die statischen Assets
|
* damit er sowohl die mobilen Views als auch die statischen Assets
|
||||||
* kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet.
|
* kontrolliert. Der Cache-Name wird pro App-Wurzel gebildet.
|
||||||
*/
|
*/
|
||||||
const VERSION = 'cmbnet-pwa-v6';
|
const VERSION = 'cmbnet-pwa-v7';
|
||||||
const BASE = new URL('./', self.location).href;
|
const BASE = new URL('./', self.location).href;
|
||||||
const SHELL_CACHE = `${VERSION}-shell`;
|
const SHELL_CACHE = `${VERSION}-shell`;
|
||||||
const TILE_CACHE = `${VERSION}-tiles`;
|
const TILE_CACHE = `${VERSION}-tiles`;
|
||||||
|
|||||||
@@ -2701,7 +2701,13 @@ async function connectWebSocket() {
|
|||||||
dispatcherState.ws = ws;
|
dispatcherState.ws = ws;
|
||||||
|
|
||||||
ws.addEventListener('open', () => {
|
ws.addEventListener('open', () => {
|
||||||
ws.send(JSON.stringify({code: 0, msg: token}));
|
ws.send(JSON.stringify({
|
||||||
|
code: 0,
|
||||||
|
msg: {
|
||||||
|
token,
|
||||||
|
session_id: window.CMBNET_CLIENT_SESSION_ID || ''
|
||||||
|
}
|
||||||
|
}));
|
||||||
dispatcherState.authenticated = true;
|
dispatcherState.authenticated = true;
|
||||||
setConnectionStatus('Verbunden', 'connected');
|
setConnectionStatus('Verbunden', 'connected');
|
||||||
dispatcherState.lastCode0ReceivedAt = Date.now();
|
dispatcherState.lastCode0ReceivedAt = Date.now();
|
||||||
|
|||||||
@@ -1105,7 +1105,13 @@ function connectWebSocket() {
|
|||||||
const ws = new WebSocket(wsUrl);
|
const ws = new WebSocket(wsUrl);
|
||||||
state.ws = ws;
|
state.ws = ws;
|
||||||
ws.addEventListener('open', () => {
|
ws.addEventListener('open', () => {
|
||||||
ws.send(JSON.stringify({code: 0, msg: token}));
|
ws.send(JSON.stringify({
|
||||||
|
code: 0,
|
||||||
|
msg: {
|
||||||
|
token,
|
||||||
|
session_id: window.CMBNET_CLIENT_SESSION_ID || ''
|
||||||
|
}
|
||||||
|
}));
|
||||||
state.authenticated = true;
|
state.authenticated = true;
|
||||||
});
|
});
|
||||||
ws.addEventListener('message', handleWs);
|
ws.addEventListener('message', handleWs);
|
||||||
|
|||||||
@@ -28,6 +28,40 @@
|
|||||||
const clean = String(path == null ? '' : path).replace(/^\/+/, '');
|
const clean = String(path == null ? '' : path).replace(/^\/+/, '');
|
||||||
return clean ? base + '/' + clean : (base || '/');
|
return clean ? base + '/' + clean : (base || '/');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Stabile ID pro Browser-Tab. Sie übersteht ein Neuladen und ordnet
|
||||||
|
// die WebSocket-Sitzung ihrer Nachrichten-Queue beim Broker zu.
|
||||||
|
(function initClientSessionId() {
|
||||||
|
const key = 'cmbnet:client-session:' + (window.CMBNET_TENANT || '');
|
||||||
|
let sessionId = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
sessionId = window.sessionStorage.getItem(key);
|
||||||
|
} catch (error) {
|
||||||
|
// sessionStorage kann in privaten Kontexten gesperrt sein.
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sessionId) {
|
||||||
|
if (window.crypto && typeof window.crypto.randomUUID === 'function') {
|
||||||
|
sessionId = window.crypto.randomUUID();
|
||||||
|
} else if (window.crypto && typeof window.crypto.getRandomValues === 'function') {
|
||||||
|
const bytes = new Uint8Array(16);
|
||||||
|
window.crypto.getRandomValues(bytes);
|
||||||
|
sessionId = Array.from(bytes, value => value.toString(16).padStart(2, '0')).join('');
|
||||||
|
} else {
|
||||||
|
sessionId = 'sess-' + Date.now().toString(36) + '-' +
|
||||||
|
Math.random().toString(36).slice(2, 12);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
window.sessionStorage.setItem(key, sessionId);
|
||||||
|
} catch (error) {
|
||||||
|
// Dann gilt die ID nur für den aktuellen Seitenaufruf.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
window.CMBNET_CLIENT_SESSION_ID = sessionId;
|
||||||
|
})();
|
||||||
</script>
|
</script>
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/pico.min.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/pico.min.css') }}">
|
||||||
<link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.css') }}">
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/leaflet.css') }}">
|
||||||
|
|||||||
Reference in new issue
Block a user