From d60aad7d2f55bc6fde904dbba7d597e87ac93b3f Mon Sep 17 00:00:00 2001 From: Acentech Dev Date: Thu, 13 Aug 2026 09:13:56 +0300 Subject: [PATCH] Load the log viewer script from the path it is actually served on The admin panel sets StaticWebAssetBasePath to _content/, so the colocated module is served as /_content/MUnique.OpenMU.Web.AdminPanel/Pages/LogFiles.razor.js. The import asked for "./Pages/LogFiles.razor.js", which resolves against the page url /logfiles and answers 404. The failure is caught and logged, so the viewer still renders - it just never scrolls itself. Build the path from the assembly name the way ThemeSelector and MapEditor already do. --- src/Web/AdminPanel/Pages/LogFiles.razor | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Web/AdminPanel/Pages/LogFiles.razor b/src/Web/AdminPanel/Pages/LogFiles.razor index 49ecc4a..3fc58d4 100644 --- a/src/Web/AdminPanel/Pages/LogFiles.razor +++ b/src/Web/AdminPanel/Pages/LogFiles.razor @@ -143,6 +143,11 @@ private const int LiveUpdateIntervalMs = 2000; private const string TerminalElementId = "log-terminal"; + // The admin panel publishes its static web assets under _content/, so a path relative + // to the page url ("./Pages/...") does not resolve. Mirrors ThemeSelector and MapEditor. + private static readonly string JsModulePath = + $"./_content/{typeof(LogFiles).Assembly.GetName().Name}/Pages/{nameof(LogFiles)}.razor.js"; + private readonly List _files = new(); private FileInfo? _selectedFile; private long _lastFileLength; @@ -187,7 +192,7 @@ { try { - this._jsModule = await this.JSRuntime.InvokeAsync("import", "./Pages/LogFiles.razor.js"); + this._jsModule = await this.JSRuntime.InvokeAsync("import", JsModulePath); } catch (JSException ex) {