mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-07-06 18:01:34 +02:00
Changes include:
Features Neighbour details modal with full info and map view WebSocket support with heartbeat and automatic reconnection Improved signal quality calculations (SNR-based RSSI) Route-based pagination for faster initial loads UI Mobile sidebar tweaks (logout, version info, lazy-loaded charts) Sorting added to the neighbour table Packet view now shows multi-hop paths CAD calibration charts respect light/dark themes Statistics charts now show the full requested time range Performance Reduced polling when WebSocket is active Lazy loading for heavier components Noise floor data capped to keep charts responsive Technical Improved type safety across API responses Contrast improvements for accessibility Cleaner WebSocket and MQTT reconnection handling Additional metrics added to heartbeat stats Bug fixes Corrected noise floor history query Fixed authentication for CAD calibration streams Nothing major required from users — just update and carry on. As always, shout if something looks off.
This commit is contained in:
@@ -20,6 +20,15 @@ from .auth.jwt_handler import JWTHandler
|
||||
from .auth.api_tokens import APITokenManager
|
||||
from .auth import cherrypy_tool # Import to register the tool
|
||||
|
||||
# WebSocket support
|
||||
try:
|
||||
from repeater.data_acquisition.websocket_handler import PacketWebSocket, init_websocket, broadcast_packet
|
||||
WEBSOCKET_AVAILABLE = True
|
||||
except ImportError:
|
||||
WEBSOCKET_AVAILABLE = False
|
||||
logger = logging.getLogger("HTTPServer")
|
||||
logger.warning("ws4py not available - WebSocket support disabled")
|
||||
|
||||
logger = logging.getLogger("HTTPServer")
|
||||
|
||||
|
||||
@@ -426,6 +435,27 @@ class HTTPStatsServer:
|
||||
|
||||
cherrypy.tree.mount(self.doc_app, "/doc", doc_config)
|
||||
|
||||
# Initialize WebSocket if available
|
||||
if WEBSOCKET_AVAILABLE:
|
||||
try:
|
||||
init_websocket()
|
||||
|
||||
# Create WebSocket app
|
||||
class WSApp:
|
||||
@cherrypy.expose
|
||||
def index(self):
|
||||
pass # WebSocket tool handles the actual upgrade
|
||||
|
||||
cherrypy.tree.mount(WSApp(), '/ws/packets', {
|
||||
'/': {
|
||||
'tools.websocket.on': True,
|
||||
'tools.websocket.handler_cls': PacketWebSocket,
|
||||
}
|
||||
})
|
||||
logger.info("WebSocket endpoint mounted at /ws/packets")
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to initialize WebSocket: {e}")
|
||||
|
||||
# Store auth handlers in cherrypy config for middleware access
|
||||
cherrypy.config.update({
|
||||
"jwt_handler": self.jwt_handler,
|
||||
|
||||
Reference in New Issue
Block a user