From 6e46e96078af32bc80a4ad360153f240f5f9a7dd Mon Sep 17 00:00:00 2001 From: dcore94 Date: Thu, 28 Jul 2022 14:36:23 +0200 Subject: [PATCH] improved service and broadcast urls --- ccp/js/executionmonitorcontroller.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ccp/js/executionmonitorcontroller.js b/ccp/js/executionmonitorcontroller.js index bb3bd62..123e7bd 100644 --- a/ccp/js/executionmonitorcontroller.js +++ b/ccp/js/executionmonitorcontroller.js @@ -2,14 +2,21 @@ class CCPExecutionMonitor extends HTMLElement { #boot = null; #rootdoc = null; - #broadcasturl = "wss://nubis1.int.d4science.net:8080/ws/notification"; + #serviceurl = null; + #broadcasturl = null; #executions = []; #socket = null; constructor(){ super() this.#boot = document.querySelector("d4s-boot-2") - this.#rootdoc = this.attachShadow({ "mode" : "open"}) + this.#rootdoc = this.attachShadow({ "mode" : "open"}) + this.#serviceurl = this.getAttribute("serviceurl") + this.#broadcasturl = this.getAttribute("broadcasturl") + if(!this.#broadcasturl){ + this.#broadcasturl = this.#serviceurl.replace(/^http/, "ws") + } + this.#broadcasturl = this.#broadcasturl + "/ws/notification" this.connectBroadcast() }