@page "/galaxy"
@page "/dashboard/galaxy"
@inherits DashboardPageBase
Dashboard Galaxy
@if (Snapshot is null)
{
Loading Galaxy summary.
}
else
{
@if (Snapshot.Galaxy.Status == DashboardGalaxyStatus.Unknown)
{
Galaxy summary has not been collected yet. The dashboard refreshes the
summary every @RefreshIntervalSeconds() seconds via the
GalaxyRepository service.
}
@if (!string.IsNullOrWhiteSpace(Snapshot.Galaxy.LastError))
{
Last Error
@Snapshot.Galaxy.LastError
}
Object Categories
@if (Snapshot.Galaxy.ObjectCategories.Count == 0)
{
No deployed objects observed.
}
else
{
| Category |
Category ID |
Objects |
@foreach (DashboardGalaxyCategoryCount row in Snapshot.Galaxy.ObjectCategories)
{
| @row.CategoryName |
@row.CategoryId |
@DashboardDisplay.Count(row.ObjectCount) |
}
}
Top Templates
@if (Snapshot.Galaxy.TopTemplates.Count == 0)
{
No template usage observed.
}
else
{
| Template |
Instances |
@foreach (DashboardGalaxyTemplateUsage row in Snapshot.Galaxy.TopTemplates)
{
@row.TemplateName |
@DashboardDisplay.Count(row.InstanceCount) |
}
}
Sync Info
| Status | |
| Last successful refresh | @DashboardDisplay.DateTime(Snapshot.Galaxy.LastSuccessAt) |
| Last attempt | @DashboardDisplay.DateTime(Snapshot.Galaxy.LastQueriedAt) |
Galaxy time_of_last_deploy | @DashboardDisplay.DateTime(Snapshot.Galaxy.LastDeployTime) |
| Refresh interval | @RefreshIntervalSeconds() seconds |
| Connection string | @DashboardDisplay.Text(GalaxyConnectionStringDisplay()) |
| Command timeout | @CommandTimeoutSeconds() seconds |
Browse data is served by the galaxy_repository.v1.GalaxyRepository gRPC
service. Clients call DiscoverHierarchy for the full tree and
GetLastDeployTime to detect redeployments.
}
@code {
[Inject]
private IOptions GalaxyOptions { get; set; } = null!;
private string RefreshHeading()
{
DashboardGalaxySummary galaxy = Snapshot!.Galaxy;
return galaxy.LastSuccessAt is null
? "Awaiting first successful refresh"
: $"Refreshed {DashboardDisplay.DateTime(galaxy.LastSuccessAt)}";
}
private string? DeployAge()
{
DashboardGalaxySummary galaxy = Snapshot!.Galaxy;
if (galaxy.LastDeployTime is null || galaxy.LastSuccessAt is null)
{
return null;
}
TimeSpan age = galaxy.LastSuccessAt.Value - galaxy.LastDeployTime.Value;
if (age < TimeSpan.Zero)
{
return null;
}
return $"{DashboardDisplay.Duration(age)} ago";
}
private string? LastAttemptDetail()
{
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;
}
private int RefreshIntervalSeconds() => Math.Max(1, GalaxyOptions.Value.DashboardRefreshIntervalSeconds);
private int CommandTimeoutSeconds() => GalaxyOptions.Value.CommandTimeoutSeconds;
private string GalaxyConnectionStringDisplay()
{
return DashboardConnectionStringDisplay.GalaxyRepositoryConnectionString(GalaxyOptions.Value.ConnectionString);
}
}