@page "/resources/hardware/{HardwareName}"
@using RackPeek.Domain.Persistence
@using RackPeek.Domain.Resources.AccessPoints
@using RackPeek.Domain.Resources.Connections
@using RackPeek.Domain.Resources.Desktops
@using RackPeek.Domain.Resources.Firewalls
@using RackPeek.Domain.Resources.Hardware
@using RackPeek.Domain.Resources.Laptops
@using RackPeek.Domain.Resources.Servers
@using RackPeek.Domain.Resources.Switches
@using RackPeek.Domain.Resources.SystemResources
@using RackPeek.Domain.Resources.UpsUnits
@using Shared.Rcl.AccessPoints
@using Shared.Rcl.Connections
@using Shared.Rcl.Desktops
@using Shared.Rcl.Firewalls
@using Shared.Rcl.Laptops
@using Shared.Rcl.Routers
@using Shared.Rcl.Servers
@using Shared.Rcl.Switches
@using Shared.Rcl.Ups
@using Router = RackPeek.Domain.Resources.Routers.Router
@inject IResourceCollection Repo
@inject GetHardwareSystemTreeUseCase GetHardwareSystemTreeUseCase
@inject NavigationManager Nav
Hardware Details
@if (_hardware is null && !_loading)
{
Hardware not found
}
else if (_loading)
{
loading hardware…
}
else
{
@* ================= Hardware Card ================= *@
@if (_hardware != null)
{
@if (_hardware is Server server)
{
}
else if (_hardware is Desktop desktop)
{
}
else if (_hardware is AccessPoint accessPoint)
{
}
else if (_hardware is Switch _switch)
{
}
else if (_hardware is Laptop laptop)
{
}
else if (_hardware is Firewall firewall)
{
}
else if (_hardware is Router router)
{
}
else if (_hardware is Ups ups)
{
}
else
{
No detailed view for hardware type: @_hardware.Kind
}
}
@* ================= Dependency Tree ================= *@
@if (_tree is not null && _tree.Systems.Any())
{
}
else
{
No child systems / services
}
@* ================= Ports ================= *@
@if (_hardware is IPortResource portResource && portResource.Ports?.Any() == true)
{
Ports
@for (var i = 0; i < portResource.Ports.Count; i++)
{
var portGroup = portResource.Ports[i];
@portGroup.Type — @portGroup.Speed Gbps (@portGroup.Count ports)
}
}
}