86 lines
4.4 KiB
Plaintext
86 lines
4.4 KiB
Plaintext
@page "/"
|
|
@inherits DashboardPageBase
|
|
|
|
<PageTitle>MXAccess Gateway — Overview</PageTitle>
|
|
|
|
@if (Snapshot is null)
|
|
{
|
|
<div class="empty-state">Loading dashboard snapshot.</div>
|
|
}
|
|
else
|
|
{
|
|
<div class="dashboard-page-header">
|
|
<div>
|
|
<h1>Overview</h1>
|
|
<div class="text-secondary">Sampled @DashboardDisplay.DateTime(Snapshot.GeneratedAt)</div>
|
|
</div>
|
|
<StatusBadge Text="@Snapshot.GatewayStatus" />
|
|
</div>
|
|
|
|
<section class="dashboard-section overview-faults" aria-labelledby="recent-faults-title">
|
|
<div class="section-heading d-flex align-items-center gap-2 flex-wrap">
|
|
<h2 id="recent-faults-title">Recent faults</h2>
|
|
<NavLink class="ms-auto small" href="sessions">View sessions →</NavLink>
|
|
</div>
|
|
<FaultList Faults="@Snapshot.Faults" Compact="true" />
|
|
</section>
|
|
|
|
<section class="metric-grid" aria-label="Session, worker and queue context">
|
|
<MetricCard Label="Open sessions" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.sessions.open"))" />
|
|
<MetricCard Label="Workers running" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.workers.running"))" />
|
|
<MetricCard Label="Event queue depth" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.events.worker_queue.depth"))" />
|
|
</section>
|
|
|
|
<details class="dashboard-section supporting-counters" data-testid="supporting-counters">
|
|
<summary>Supporting counters and repository details</summary>
|
|
<h2 class="h6 mt-3">Uptime and cumulative counters</h2>
|
|
<div class="metric-grid compact">
|
|
<MetricCard Label="Uptime" Value="@DashboardDisplay.Duration(Snapshot.GatewayUptime)" Detail="@Snapshot.GatewayVersion" />
|
|
<MetricCard Label="Commands failed" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.commands.failed"))" />
|
|
<MetricCard Label="Events received" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.events.received"))" />
|
|
<MetricCard Label="Faults" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.faults"))" />
|
|
<MetricCard Label="Queue overflows" Value="@DashboardDisplay.Count(DashboardDisplay.MetricValue(Snapshot, "mxgateway.queues.overflows"))" />
|
|
</div>
|
|
<section class="mt-3">
|
|
<div class="section-heading d-flex align-items-center gap-2 flex-wrap">
|
|
<h2>Galaxy Repository</h2>
|
|
<StatusBadge Text="@Snapshot.Galaxy.Status.ToString()" />
|
|
<NavLink class="ms-auto small" href="galaxy">Repository status →</NavLink>
|
|
<NavLink class="small" href="browse">Browse attributes →</NavLink>
|
|
</div>
|
|
<div class="metric-grid compact">
|
|
<MetricCard Label="Last deploy" Value="@DashboardDisplay.DateTime(Snapshot.Galaxy.LastDeployTime)" />
|
|
<MetricCard Label="Objects" Value="@DashboardDisplay.Count(Snapshot.Galaxy.ObjectCount)" Detail="@($"{Snapshot.Galaxy.AreaCount:N0} areas")" />
|
|
<MetricCard Label="Attributes" Value="@DashboardDisplay.Count(Snapshot.Galaxy.AttributeCount)" />
|
|
<MetricCard Label="Historized" Value="@DashboardDisplay.Count(Snapshot.Galaxy.HistorizedAttributeCount)" />
|
|
<MetricCard Label="Alarms" Value="@DashboardDisplay.Count(Snapshot.Galaxy.AlarmAttributeCount)" />
|
|
<MetricCard Label="Last refresh" Value="@DashboardDisplay.DateTime(Snapshot.Galaxy.LastSuccessAt)" Detail="@GalaxyRefreshDetail()" />
|
|
</div>
|
|
@if (!string.IsNullOrWhiteSpace(Snapshot.Galaxy.LastError))
|
|
{
|
|
<div class="empty-state mt-2">@DashboardDisplay.Abbreviate(Snapshot.Galaxy.LastError, 160) Open Repository status for complete diagnostics.</div>
|
|
}
|
|
</section>
|
|
</details>
|
|
}
|
|
|
|
@code {
|
|
private string? GalaxyRefreshDetail()
|
|
{
|
|
DashboardGalaxySummary galaxy = Snapshot!.Galaxy;
|
|
if (galaxy.LastQueriedAt is null)
|
|
{
|
|
return "never queried";
|
|
}
|
|
|
|
if (galaxy.LastSuccessAt is null)
|
|
{
|
|
return "no successful refresh yet";
|
|
}
|
|
|
|
return galaxy.LastQueriedAt > galaxy.LastSuccessAt
|
|
? $"last attempt {DashboardDisplay.DateTime(galaxy.LastQueriedAt)}"
|
|
: null;
|
|
}
|
|
}
|