From cf5ce4ecaed2112fa1b92df13fede087090b3698 Mon Sep 17 00:00:00 2001 From: Lukasz Mitusinski Date: Tue, 26 Jun 2018 12:34:06 +0200 Subject: [PATCH] #7568 handle spark status toolbar on multiple notebooks --- beakerx/beakerx/handlers.py | 7 +++++-- js/notebook/src/SparkUI.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/beakerx/beakerx/handlers.py b/beakerx/beakerx/handlers.py index 19e43c80e9..72cb23fe6d 100644 --- a/beakerx/beakerx/handlers.py +++ b/beakerx/beakerx/handlers.py @@ -29,12 +29,15 @@ def data_received(self, chunk): @web.authenticated @tornado.web.asynchronous - def get(self, id): + def get(self, params): def handle_response(response): self.finish(response.body) - url = "http://localhost:4040/api/v1/applications/" + id + "/allexecutors" + addr_port = params.split('/')[2] + app_id = params.split('/')[3] + + url = "http://" + addr_port + "/api/v1/applications/" + app_id + "/allexecutors" req = tornado.httpclient.HTTPRequest( url=url, method=self.request.method, diff --git a/js/notebook/src/SparkUI.ts b/js/notebook/src/SparkUI.ts index e95265a8d1..d20877d91d 100644 --- a/js/notebook/src/SparkUI.ts +++ b/js/notebook/src/SparkUI.ts @@ -290,9 +290,9 @@ export class SparkUIView extends widgets.VBoxView { } private setApiCallInterval(api: BeakerXApi): void { - const sparkUrl = `${api.getApiUrl('sparkmetrics/executors')}/${this.sparkAppId}`; const getMetrict = async () => { try { + let sparkUrl = `${api.getApiUrl('sparkmetrics/executors')}/${this.sparkUiWebUrl}/${this.sparkAppId}`; const response = await fetch(sparkUrl, { method: 'GET', credentials: 'include' }); if (!response.ok) {