fix(overview): distinguish paused view from connection failure
This commit is contained in:
@@ -23,12 +23,17 @@
|
||||
<h1>Fleet Overview</h1>
|
||||
<span class="page-meta">@Meta</span>
|
||||
<span class="spacer"></span>
|
||||
<span class="conn-pill" data-state="@(_paused ? "disconnected" : "connected")">
|
||||
<span class="dot"></span>@(_paused ? "Paused" : "Polling")
|
||||
<span class="conn-pill" data-state="@(_paused ? "paused" : "connected")">
|
||||
<span class="dot" aria-hidden="true"></span>@(_paused ? "View paused" : "View updating")
|
||||
</span>
|
||||
<button class="rail-btn" type="button" data-testid="pause-toggle" @onclick="TogglePause">
|
||||
@(_paused ? "Resume auto-refresh" : "Pause auto-refresh")
|
||||
<button class="rail-btn" type="button" data-testid="pause-toggle" aria-pressed="@(_paused ? "true" : "false")" @onclick="TogglePause">
|
||||
@(_paused ? "Resume view updates" : "Pause view updates")
|
||||
</button>
|
||||
@if (_paused)
|
||||
{
|
||||
<span class="page-meta">Background polling continues.</span>
|
||||
}
|
||||
<span class="visually-hidden" role="status">@_viewOutcome</span>
|
||||
</div>
|
||||
|
||||
@if (_snapshot.Applications.Count == 0)
|
||||
@@ -128,6 +133,7 @@ else
|
||||
private OverviewSnapshot _snapshot = OverviewSnapshot.Empty;
|
||||
private IReadOnlyList<InstanceSnapshot> _instances = [];
|
||||
private bool _paused;
|
||||
private string _viewOutcome = string.Empty;
|
||||
private ITimer? _timer;
|
||||
|
||||
protected override void OnInitialized()
|
||||
@@ -161,6 +167,9 @@ else
|
||||
private void TogglePause()
|
||||
{
|
||||
_paused = !_paused;
|
||||
_viewOutcome = _paused
|
||||
? "View paused. Background polling continues."
|
||||
: "View updates resumed.";
|
||||
|
||||
if (!_paused)
|
||||
Adopt(Store.Current);
|
||||
|
||||
Reference in New Issue
Block a user