From 42bff7a2f7e2efe1e9eb4f815faaf209e1923be4 Mon Sep 17 00:00:00 2001 From: walesch-yan Date: Tue, 12 Nov 2024 16:59:48 +0100 Subject: [PATCH] change to new camera websockets for argus --- demo/mxcube-web/server.yaml | 17 +++++++++-------- .../BeamlineCamera/BeamlineCamera.jsx | 4 ++-- ui/src/components/BeamlineCamera/CameraCard.jsx | 1 + 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/demo/mxcube-web/server.yaml b/demo/mxcube-web/server.yaml index d556a843..733a3c9f 100644 --- a/demo/mxcube-web/server.yaml +++ b/demo/mxcube-web/server.yaml @@ -9,14 +9,15 @@ server: DEBUG: false ALLOWED_CORS_ORIGINS: - - http://localhost:8081 - - http://127.0.0.1:8081 - - http://localhost:5173 - - http://127.0.0.1:5173 - - ws://localhost:8000 - - ws://127.0.0.1:8000 - - "ws://localhost:9090" - - "http://localhost:9090" + - "http://localhost:8081" + - "http://127.0.0.1:8081" + - "http://localhost:5173" + - "http://127.0.0.1:5173" + - "ws://localhost:8000" + - "ws://127.0.0.1:8000" + - "ws://localhost:7000" + - "ws://127.0.0.1:7000" + - "http://localhost:7000" sso: USE_SSO: false diff --git a/ui/src/components/BeamlineCamera/BeamlineCamera.jsx b/ui/src/components/BeamlineCamera/BeamlineCamera.jsx index 7836786a..663ffb2d 100644 --- a/ui/src/components/BeamlineCamera/BeamlineCamera.jsx +++ b/ui/src/components/BeamlineCamera/BeamlineCamera.jsx @@ -32,14 +32,14 @@ function BeamlineCamera(props) { useEffect(() => { if (argusStreams) { - const argusCameras = Object.entries(argusStreams).map(([key, value]) => { + const argusCameras = Object.keys(argusStreams).map((key) => { return { description: null, format: null, height: 1280, width: 960, label: key, - url: value, + url: `ws://localhost:7000/ws/${key}`, }; }); if (cameraSetup && cameraSetup.components.length > 0) { diff --git a/ui/src/components/BeamlineCamera/CameraCard.jsx b/ui/src/components/BeamlineCamera/CameraCard.jsx index 0c0a6ccc..6d66d55b 100644 --- a/ui/src/components/BeamlineCamera/CameraCard.jsx +++ b/ui/src/components/BeamlineCamera/CameraCard.jsx @@ -32,6 +32,7 @@ export default function CameraCard(props) { preserveDrawingBuffer: false, protocols: [], autoplay: true, + displayGl: false, }); }