fix(web): support runId in Detail page from both route parameters and query strings
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 24s
Prepare Release / Build & Create Release (push) Successful in 56s
Prepare Release / Release Notification (push) Successful in 1s
Validators (Pushes and Pull Requests) / validate-core (push) Successful in 2m8s
Validators (Pushes and Pull Requests) / validate-ui-and-storage (push) Successful in 24s
Prepare Release / Build & Create Release (push) Successful in 56s
Prepare Release / Release Notification (push) Successful in 1s
Validators (Pushes and Pull Requests) / validate-core (push) Successful in 2m8s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
@page "{runId}"
|
@page "{runId?}"
|
||||||
@model QuantEngine.Web.Pages.Admin.Collection.DetailModel
|
@model QuantEngine.Web.Pages.Admin.Collection.DetailModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "수집 실행 상세";
|
ViewData["Title"] = "수집 실행 상세";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||||
using QuantEngine.Core.Interfaces;
|
using QuantEngine.Core.Interfaces;
|
||||||
using QuantEngine.Web.Services;
|
using QuantEngine.Web.Services;
|
||||||
@@ -19,16 +20,31 @@ public class DetailModel : PageModel
|
|||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task OnGetAsync(string runId)
|
public async Task OnGetAsync([FromQuery] string? runId, [FromRoute] string? routeRunId)
|
||||||
{
|
{
|
||||||
|
var targetRunId = runId ?? routeRunId;
|
||||||
|
if (string.IsNullOrEmpty(targetRunId))
|
||||||
|
{
|
||||||
|
if (RouteData.Values.TryGetValue("runId", out var routeVal))
|
||||||
|
{
|
||||||
|
targetRunId = routeVal?.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(targetRunId))
|
||||||
|
{
|
||||||
|
_logger.LogWarning("Detail page loaded without a runId");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var runs = await _collectionRepository.GetRecentRunsAsync(limit: 100);
|
var runs = await _collectionRepository.GetRecentRunsAsync(limit: 100);
|
||||||
Run = runs.FirstOrDefault(r => r.RunId == runId);
|
Run = runs.FirstOrDefault(r => r.RunId == targetRunId);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Failed to load collection run detail");
|
_logger.LogError(ex, "Failed to load collection run detail for runId: {RunId}", targetRunId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user