Paralleles WebGUI mit Kestrel, Token-Sicherung und SSE-Logs implementiert

This commit is contained in:
Richard
2026-09-07 21:55:51 +02:00
parent 28b3aedec7
commit 10f928eb4e
36 changed files with 3114 additions and 266 deletions
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using PolyTrader.Core.Modularity;
namespace PolyTrader.Web.Endpoints
{
public static class ModulesEndpoints
{
public static IEndpointRouteBuilder MapModulesEndpoints(this IEndpointRouteBuilder routes)
{
var group = routes.MapGroup("/api/modules");
group.MapGet("/", (IServiceProvider sp) =>
{
var activeModules = sp.GetServices<IPolyTraderModule>().ToList();
var activeNames = activeModules.Select(m => m.Name).ToHashSet(StringComparer.OrdinalIgnoreCase);
var knownModules = new[]
{
"CopyTrading",
"ResolutionFarming",
"Supervisor",
"Accounting"
};
var list = knownModules.Select(name => new
{
name,
isActive = activeNames.Contains(name)
}).ToList();
return Results.Ok(list);
});
return routes;
}
}
}