You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TODO: add check for !port.exposed.url.isNullOrEmpty()
266
+
267
+
portsStatus[port.localPort] = port
268
+
269
+
if (shouldSendNotification) {
270
+
if (port.exposed.onExposed.number ==OnPortExposedAction.ignore_VALUE) {
271
+
continue
272
+
}
273
+
274
+
if (port.exposed.onExposed.number ==OnPortExposedAction.open_browser_VALUE) {
275
+
BrowserUtil.browse(port.exposed.url)
276
+
continue
277
+
}
278
+
279
+
if (port.exposed.onExposed.number ==OnPortExposedAction.open_preview_VALUE) {
280
+
BrowserUtil.browse(port.exposed.url)
281
+
continue
282
+
}
283
+
284
+
val message ="A service is available on port ${port.localPort}"
285
+
val notification = notificationGroup.createNotification(message, NotificationType.INFORMATION)
286
+
// TODO(andreafalzetti): add analytics event similar to https://github.com/gitpod-io/openvscode-server/blob/7c912399c70799e4e4452a63cf3c0f7cc8f5832c/extensions/gitpod-web/src/extension.ts#L582
287
+
val lambda = { BrowserUtil.browse(port.exposed.url) }
288
+
val action =NotificationAction.createSimpleExpiring("Open in browser", lambda)
289
+
notification.addAction(action)
290
+
notification.notify(null)
291
+
}
292
+
}
293
+
}
294
+
295
+
overridefunonError(t:Throwable) {
296
+
f.completeExceptionally(t)
297
+
}
298
+
299
+
overridefunonCompleted() {
300
+
f.complete(null)
301
+
}
302
+
})
303
+
f.await()
304
+
} catch (t:Throwable) {
305
+
if (t isCancellationException) {
306
+
throw t
307
+
}
308
+
thisLogger().error("gitpod: failed to stream ports status: ", t)
309
+
}
310
+
delay(1000L)
311
+
}
312
+
}
313
+
init {
314
+
lifetime.onTerminationOrNow {
315
+
portsObserveJob.cancel()
316
+
}
317
+
}
318
+
202
319
val pendingInfo =CompletableFuture<WorkspaceInfoResponse>()
0 commit comments