TUI: переработать shell и адаптацию layout
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
<Rows>
|
||||
<Markup Content="@Loc.OverviewTitle" Foreground="@UiPalette.Text" Decoration="@Spectre.Console.Decoration.Bold" />
|
||||
<Markup Content="@Loc.OverviewHint" Foreground="@UiPalette.TextMuted" />
|
||||
<Markup Content=" " />
|
||||
<Markup Content="@($"{Loc.DashboardEndpointLabel}: {Endpoint}")" Foreground="@UiPalette.Accent" />
|
||||
<Markup Content=" " />
|
||||
|
||||
@if (Rows.Count == 0)
|
||||
@@ -32,7 +29,6 @@
|
||||
[Parameter] public int SelectedIndex { get; set; }
|
||||
[Parameter] public EventCallback<int> SelectedIndexChanged { get; set; }
|
||||
[Parameter] public int ViewportRows { get; set; } = 3;
|
||||
[Parameter] public string Endpoint { get; set; } = "";
|
||||
[Parameter] public TuiResources Loc { get; set; } = TuiResources.En;
|
||||
|
||||
private int[] GetOptions() => Enumerable.Range(0, Rows.Count).ToArray();
|
||||
@@ -56,7 +52,7 @@
|
||||
var row = Rows[index];
|
||||
var status = row.IsModuleEnabled ? $"[{Loc.StateOn}] " : $"[{Loc.StateOff}]";
|
||||
var text = $"{row.ModuleName,-12} {status} {row.ConfiguredTools,2}/{row.TotalTools,-2} {row.Description}";
|
||||
return Fit(text, Math.Max(Console.WindowWidth - 12, 32));
|
||||
return Fit(text, Math.Max(UiMetrics.ConsoleWidth - 12, 32));
|
||||
}
|
||||
|
||||
private static string Fit(string text, int width)
|
||||
|
||||
Reference in New Issue
Block a user