From 4d32d53be9867fca8d90639e872c32779a0501e8 Mon Sep 17 00:00:00 2001 From: Binary Alley Date: Fri, 6 Nov 2026 21:26:01 +0200 Subject: [PATCH] Removes hardcoded SignalR url in the Web Client. --- .../Core/Views/Library/Management/Index.cshtml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Lumina.Presentation.Web/Core/Views/Library/Management/Index.cshtml b/src/Lumina.Presentation.Web/Core/Views/Library/Management/Index.cshtml index d656fd66..8221bcea 100644 --- a/src/Lumina.Presentation.Web/Core/Views/Library/Management/Index.cshtml +++ b/src/Lumina.Presentation.Web/Core/Views/Library/Management/Index.cshtml @@ -2,9 +2,11 @@ /library/manage *@ +@using Lumina.Presentation.Web.Common.DTO.Configuration @using Lumina.Presentation.Web.Common.DTO.Libraries @using Lumina.Presentation.Web.Common.Services @using Microsoft.AspNetCore.Mvc.Localization +@using Microsoft.Extensions.Options @using System.Collections.Generic @using System.Security.Claims @using System.Text.Json @@ -13,10 +15,13 @@ @{ // Generate a unique id for the scripts section of this view, so it can be dynamically loaded/unloaded by the global AJAX navigator handler. var scriptId = ScriptIdentifierHelper.GenerateScriptId(); + var serverConfiguration = _serverConfigurationOptions.Value; + string scanProgressHubUrl = $"{serverConfiguration.BaseAddress}:{serverConfiguration.Port}/scanProgressHub"; } @inject IUrlService _urlService @inject IViewLocalizer _localizer +@inject IOptionsSnapshot _serverConfigurationOptions @Html.AntiForgeryToken() @@ -258,7 +263,7 @@ // SignalR. const accessTokenUrl = '@_urlService.GetAbsoluteUrl(WebRoutes.Authentication.GET_API_ACCESS_TOKEN)'; const signalRConnection = new signalR.HubConnectionBuilder() - .withUrl('http://localhost:5214/scanProgressHub', { + .withUrl('@scanProgressHubUrl', { accessTokenFactory: async () => { const tokenResponse = await callApiGetAsync(accessTokenUrl); return tokenResponse ? tokenResponse.token : null;