From 2e4b44c575946676f33804811219c6b27a222b6e Mon Sep 17 00:00:00 2001 From: Aaron Chong Date: Wed, 7 Aug 2024 11:56:35 +0800 Subject: [PATCH] Minor dashboard fixes (#989) * Fix icon path Signed-off-by: Aaron Chong * Turn off minify for debugging Signed-off-by: Aaron Chong * Make trajectory server connection optional Signed-off-by: Aaron Chong * Remove minify:false block Signed-off-by: Aaron Chong * Use BASE_URL Signed-off-by: Aaron Chong --------- Signed-off-by: Aaron Chong --- packages/dashboard/index.html | 4 ++-- .../src/components/rmf-app/rmf-ingress.ts | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/dashboard/index.html b/packages/dashboard/index.html index 48f3e651a..d78460273 100644 --- a/packages/dashboard/index.html +++ b/packages/dashboard/index.html @@ -2,13 +2,13 @@ - + - + RMF Dashboard diff --git a/packages/dashboard/src/components/rmf-app/rmf-ingress.ts b/packages/dashboard/src/components/rmf-app/rmf-ingress.ts index 7db691cd4..313386c54 100644 --- a/packages/dashboard/src/components/rmf-app/rmf-ingress.ts +++ b/packages/dashboard/src/components/rmf-app/rmf-ingress.ts @@ -59,8 +59,8 @@ export class RmfIngress { alertsApi: AlertsApi; adminApi: AdminApi; deliveryAlertsApi: DeliveryAlertsApi; - negotiationStatusManager: NegotiationStatusManager; - trajectoryManager: RobotTrajectoryManager; + negotiationStatusManager?: NegotiationStatusManager; + trajectoryManager?: RobotTrajectoryManager; constructor(appConfig: AppConfig, authenticator: Authenticator) { if (!authenticator.user) { @@ -128,9 +128,17 @@ export class RmfIngress { this.adminApi = new AdminApi(apiConfig, undefined, axiosInst); this.deliveryAlertsApi = new DeliveryAlertsApi(apiConfig, undefined, axiosInst); - const ws = new WebSocket(appConfig.trajectoryServerUrl); - this.trajectoryManager = new DefaultTrajectoryManager(ws, authenticator); - this.negotiationStatusManager = new NegotiationStatusManager(ws, authenticator); + try { + const ws = new WebSocket(appConfig.trajectoryServerUrl); + this.trajectoryManager = new DefaultTrajectoryManager(ws, authenticator); + this.negotiationStatusManager = new NegotiationStatusManager(ws, authenticator); + } catch (e) { + const errorMessage = `Failed to connect to trajectory server at [${appConfig.trajectoryServerUrl}], ${ + (e as Error).message + }`; + console.error(errorMessage); + return; + } } private _convertSioToRxObs(