TUI: добавить endpoint в dashboard и выход по Q

This commit is contained in:
2026-04-14 00:02:45 +03:00
parent 01565b32d9
commit a7e912cac7
4 changed files with 44 additions and 26 deletions

View File

@@ -4,6 +4,7 @@
@inject InMemoryLogSink LogSink
@inject GlobalKeyboardService KeyboardService
@inject LocalizationService Localization
@inject IHostApplicationLifetime AppLifetime
@implements IDisposable
@@ -38,6 +39,7 @@
SelectedIndex="@_overviewSelection"
SelectedIndexChanged="@OnOverviewSelectionChanged"
ViewportRows="@GetOverviewViewportRows()"
Endpoint="@_mcpEndpoint"
Loc="@Localization.Current" />
}
else if (_activeTab == Tab.Logs)
@@ -81,6 +83,9 @@
private int _settingsSelection;
private bool _logsStickToBottom = true;
private static readonly string _mcpEndpoint =
Environment.GetEnvironmentVariable("ASPNETCORE_URLS") ?? "http://localhost:5000";
private static int GetPanelHeight() => Math.Max(Console.WindowHeight - 2, 10);
private static int GetOverviewViewportRows() => Math.Max(Console.WindowHeight - 11, 3);
private static int GetLogsViewportRows() => Math.Max(Console.WindowHeight - 16, 5);
@@ -152,6 +157,12 @@
return; // StateHasChanged вызовет OnLocaleChanged
}
if (args.Key is "q" or "Q")
{
AppLifetime.StopApplication();
return;
}
switch (_activeTab)
{
case Tab.Overview: