TUI: добавить endpoint в dashboard и выход по Q
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user