15407: Adds user visible warning when websocket url is not set.
[arvados-workbench2.git] / src / websocket / websocket.ts
index 4fd7cc2c6c6d961d17bd5df4790af653fa02fca7..e7ea3016c9a50038d4dcb8a5d3e832d93a02daf7 100644 (file)
@@ -13,6 +13,7 @@ import { loadContainers } from '~/store/processes/processes-actions';
 import { LogEventType } from '~/models/log';
 import { addProcessLogsPanelItem } from '../store/process-logs-panel/process-logs-panel-actions';
 import { FilterBuilder } from "~/services/api/filter-builder";
+import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions";
 
 export const initWebSocket = (config: Config, authService: AuthService, store: RootStore) => {
     if (config.websocketUrl) {
@@ -20,7 +21,8 @@ export const initWebSocket = (config: Config, authService: AuthService, store: R
         webSocketService.setMessageListener(messageListener(store));
         webSocketService.connect();
     } else {
-        console.warn("WARNING: webSocketUrl is not configured on the API Server");
+        console.warn("WARNING: Websocket ExternalURL is not set on the API Server");
+        store.dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Websocket URL missing on cluster config", kind: SnackbarKind.WARNING }));
     }
 };