Skip to content

Commit da4ac48

Browse files
committed
Update UI if web socket is closed when service is not reachable
1 parent 565860f commit da4ac48

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/logbook/olog/ui/src/main/java/org/phoebus/logbook/olog/ui/LogbookSearchController.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ private void cancelPeriodSearch() {
172172
public abstract void setLogs(List<LogEntry> logs);
173173

174174
/**
175-
* Utility method to cancel any ongoing periodic search jobs.
175+
* Utility method to cancel any ongoing periodic search jobs or close web socket.
176176
*/
177177
public void shutdown() {
178178
if (webSocketClientService != null) {
@@ -193,11 +193,13 @@ protected void connectWebSocket() {
193193
webSocketClientService = new WebSocketClientService(() -> {
194194
logger.log(Level.INFO, "Connected to web socket on " + webSocketConnectUrl);
195195
webSocketConnected.setValue(true);
196+
viewSearchPane.visibleProperty().set(true);
196197
errorPane.visibleProperty().set(false);
197198
search();
198199
}, () -> {
199200
logger.log(Level.INFO, "Disconnected from web socket on " + webSocketConnectUrl);
200201
webSocketConnected.set(false);
202+
viewSearchPane.visibleProperty().set(false);
201203
errorPane.visibleProperty().set(true);
202204
}, webSocketConnectUrl, subscriptionEndpoint, null);
203205
webSocketClientService.addWebSocketMessageHandler(this);

0 commit comments

Comments
 (0)