From 14f5f7c65ca99c4a97dd31188f234dc28ffad1e7 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 8 Nov 2024 16:35:17 +0100 Subject: [PATCH] wip #7179 @4.5 --- js/libs/fluidbook/fluidbook.loader.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index 3d26a7c5..61af6fce 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -36,8 +36,17 @@ FluidbookLoader.prototype = { $this.fluidbook.cache.set('_loadbalancingServerURL', $this._loadbalancingServerURL); }, 15000); - $.ajax("https://toolbox.fluidbook.com/lb.json").done(function (data) { - $this.loadbalancing = data; + $.ajax("https://toolbox.fluidbook.com/lbw.json").done(function (data) { + $this.loadbalancing = []; + $.each(data, function (i, server) { + $.ajax('https://' + server.h + '/status.txt', {dataType: 'text'}).done(function (data) { + if (data == '1') { + for (let i = 0; i < server.w; i++) { + $this.loadbalancing.push(server.h); + } + } + }); + }); $this.loadShades(callback); }).fail(function () { $this.loadbalancing = false; @@ -897,7 +906,7 @@ FluidbookLoader.prototype = { }, getURL(url) { - if (!this.loadbalancing || this.checkExcludedFromLoadBalancing(url)) { + if (!this.loadbalancing || this.loadbalancing.length === 0 || this.checkExcludedFromLoadBalancing(url)) { return url; } -- 2.39.5