Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 74 additions & 1 deletion docs/development/staff-inventory-ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,9 @@ picture of the device and a dense table of its components. Top to bottom:
component's name or id puts its MAC address in a **MAC address** column,
shown only when some row has one (`interfaceAddresses()` in
`lib/device-connections.ts`). Interfaces that match no component are listed
in Hardware & management.
in Hardware & management. Once BMC discovery has read the host NICs, a
recorded MAC that no host NIC reports is amber, with "No host NIC reports
this MAC address" as its tooltip and accessible text.

**Highlight.** Hovering or focusing a row outlines that component in the
picture, and hovering or focusing a picture port (or hovering a drawn
Expand Down Expand Up @@ -755,6 +757,77 @@ for **Internal paths** and **Service references** when recorded. Empty
facts and sections are hidden. The model is stated once, in the header
strip.

### Device page: BMC discovery status

BMC discovery is the only writer of `Device.status` (see
[BMC discovery](../operations/bmc-discovery.md)). The UI reads it from the
same Device list as spec; it has no other request. `lib/device-discovery.ts`
derives what the page shows and mirrors the comparisons in
`internal/bmcdiscovery/status.go`; `components/device-discovery.tsx` draws
it. Red is a disagreement or failure, amber needs checking, and OK stays
plain: there is no green. Every reason is a tooltip and accessible text.

- **Header chip.** One chip ends the identity strip once status exists:
"BMC ✓" when all five conditions are True; else the first False condition
in discovery order, red ("BMC unreachable", "BMC key not approved", "BMC
key changed", "BMC auth failed", "BMC not read", "Identity mismatch",
"BMC key shared"); else "BMC ?" in amber.
- **Hardware: expected next to observed.** When discovery has read a
System, a Field | Expected | Observed table replaces the reported model
and system UUID facts: Serial, Model, Manufacturer, System UUID, SKU and
Power (Redfish `powerState` as a short word). Expected is `spec.identity`
and is blank where spec does not record the field. The compared System is
the one reporting the spec system UUID, else the spec serial (as serial
number or SKU), else the only System; with several candidates the table is
hidden and the IdentityMatched chip carries the reason. An observed value
is red when IdentityMatched is False with SerialMismatch, ModelMismatch or
SystemUUIDMismatch for that field (the condition message is the tooltip),
or when it differs by discovery's rule (a vendor prefix on the model is
allowed). Manufacturer is shown but, as in discovery, not compared. The
page never calls identity verified.
- **Observation from another endpoint.** When the retained inventory was
read from an endpoint other than `spec.bmc.endpoint` (or spec records no
endpoint), discovery reports
IdentityMatched Unknown with StaleObservation, so the page compares
nothing: observed values are amber with "Read from … ; spec.bmc.endpoint
is …" as the tooltip, no spec MAC is marked unobserved, and a TLS key
read from another endpoint is amber before anyone approves it.
- **Host NICs.** `systems[].networkInterfaces` of the compared System, one
row each: NIC, MAC address, Link, and Speed when reported. A link that is
not up (LinkDown, NoLink or not reported) is amber with the raw
`linkStatus` as its tooltip. An observed MAC that `spec.interfaces`
records is followed by that interface's name; matching is by MAC address
only, never by name. When spec interfaces match no component, their table
sits beside the host NICs, with a spec MAC no NIC reports in amber.
Interfaces that match a component keep their MAC in the component table,
so no MAC is listed twice.
- **Management.** The five conditions as one line of chips (Reachable, Auth,
Inventory, Identity, Key unique), each with type, status, reason and
message as its tooltip: red ✕ for False, amber ? for Unknown or absent,
plain for True. Then **Last attempt** (relative, absolute time as the
tooltip; the attempt endpoint is added in amber only when it differs from
`spec.bmc.endpoint`), **TLS key** (the SHA-256 shortened, full value as
the tooltip, with Copy), **Key expiry** (amber within 30 days, red once
expired), and **Key approval**: Approved when Authenticated is True, "Not
approved" in amber for PinNotApproved, red for PinMismatch, and hidden for
other reasons. Then a BMC table (Manager, Model, Firmware, and the service
root's Redfish version, Vendor and Product; empty columns hidden) and the
manager NICs in the same NIC table form.
- **Before discovery.** A Device with a BMC endpoint and no status adds one
muted "Not discovered" fact under Management and nothing else.
- **Unreadable Devices.** Status arrives only inside a readable Device. A
denied or redacted Device collection shows the access state, never a
Device or its status.

The preview fixtures carry discovery status on three servers: a01-01
(matched, powered on, NICs up, key approved), a01-02 (serial mismatch, a
spec MAC not observed, an interface outside the component list) and a01-05
(key not approved, certificate expiring in 12 days, one host NIC down).
`device-discovery.test.ts` and `device-discovery.test.tsx` cover the
comparison and mismatch marking, condition chips and tooltips,
PinNotApproved, expiry tones, link states, MAC matching without name
mapping, the no-status case and denied Devices.

`device-connections.test.tsx` covers the picture with no toggle, the table
columns and rows (unmatched lanes included), conditional serial and asset
columns, the single count line, the absence of a legend and a diagram
Expand Down
5 changes: 5 additions & 0 deletions ui/provider/scripts/screenshot-pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export const PAGES: CapturePage[] = [
{ name: 'server-detail', path: record('Device', 'example-srv-a01-01'), ready: '.inventory-connections' },
// The secondary tab and the Record section that closes every record page.
{ name: 'device-hardware', path: record('Device', 'example-srv-a01-01', '&tab=hardware'), ready: '[data-tab="hardware"] .inventory-fact-section', element: '.inventory-record-tabs', viewports: ['desktop-light', 'desktop-dark', 'phone'] },
// BMC discovery in the Hardware & management tab: matched, identity mismatch, key not approved.
{ name: 'device-discovery-matched', path: record('Device', 'example-srv-a01-01', '&tab=hardware'), ready: '[data-tab="hardware"] .inventory-discovery-chips', viewports: ['desktop-light', 'desktop-dark', 'phone'] },
{ name: 'device-discovery-mismatch', path: record('Device', 'example-srv-a01-02', '&tab=hardware'), ready: '[data-tab="hardware"] .inventory-discovery-chips', element: '.inventory-record-tabs', viewports: ['desktop-light', 'phone'] },
{ name: 'device-discovery-pin', path: record('Device', 'example-srv-a01-05', '&tab=hardware'), ready: '[data-tab="hardware"] .inventory-discovery-chips', viewports: ['desktop-light', 'phone'] },
{ name: 'device-discovery-none', path: record('Device', 'example-srv-a02-02', '&tab=hardware'), ready: '[data-tab="hardware"] .inventory-fact-section', element: '.inventory-record-tabs', viewports: ['desktop-light', 'phone'] },
{ name: 'device-location', path: record('Device', 'example-srv-a01-01', '&tab=location'), ready: '[data-tab="location"] .inventory-fields', element: '.inventory-record-tabs', viewports: ['desktop-light', 'phone'] },
{ name: 'record-footer', path: record('Device', 'example-srv-a01-01'), ready: '.inventory-record-footer', element: '.inventory-record-footer', viewports: ['desktop-light', 'phone'] },
// Device detail for a model without a layout (grouped tiles), and the one component table.
Expand Down
7 changes: 6 additions & 1 deletion ui/provider/src/components/device-connections.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
type ConnectionGroup, type ConnectionLink, type DeviceConnections as JoinResult, type LinkState, type TraceHop, type ViewNames,
} from '../lib/device-connections';
import { faceplate } from '../lib/device-faceplate';
import { unobservedMacs } from '../lib/device-discovery';
import { componentChassisFace, componentRackFace, deviceMountedFace } from '../lib/rack-faces';
import { cableText, peerDetail, PeerTarget, peerText, portsWord, StateText, TileSummary, type Href } from './connection-parts';
import { PortFaceplate, type ComponentHighlight } from './device-faceplate';
Expand Down Expand Up @@ -41,6 +42,8 @@ interface ComponentRow {
assetTag?: string;
/** The recorded interface MAC address for a port of the same name. */
mac?: string;
/** Why the MAC needs checking: discovery read the host NICs and none reports it. */
macNote?: string;
/** The position the Cable names, for a lane end that matches no recorded position. */
unmatched?: { position?: number };
}
Expand All @@ -56,6 +59,7 @@ const GROUP_ORDER = connectionGroups.map(item => item.group);
function componentRows(device: Device, inventory: Inventory, join: JoinResult, unmatched: ConnectionLink[]): ComponentRow[] {
const tiles = new Map(portTiles(join.links).map(tile => [tile.key, tile]));
const macs = interfaceAddresses(device).byComponent;
const unobserved = unobservedMacs(device);
const mounted = deviceMountedFace(device, inventory);
const used = new Set<string>();
const rows: (ComponentRow & { group: ConnectionGroup })[] = (device.spec.components ?? []).map((component, index) => {
Expand All @@ -67,6 +71,7 @@ function componentRows(device: Device, inventory: Inventory, join: JoinResult, u
key: `component/${index}`, group, name: component.name, id: component.id, type: component.type, connector: component.connector,
chassisFace, rackFace: componentRackFace(mounted, chassisFace), positions: component.positions ?? 1,
state: tile?.state, links: tile?.links ?? [], serial: component.serial, assetTag: component.assetTag, mac: macs.get(component.id),
macNote: (device.spec.interfaces ?? []).filter(iface => iface.name === component.name || iface.name === component.id).map(iface => unobserved.get(iface.name)).find(Boolean),
};
});
for (const tile of tiles.values()) {
Expand Down Expand Up @@ -192,7 +197,7 @@ function ComponentTable({ rows, cablesDenied, namespace, href, names, highlight,
<TableCell><StateCell row={row} /></TableCell>
<TableCell><ConnectedCell row={row} namespace={namespace} href={href} names={names} /></TableCell>
</>}
{macs && <TableCell className="inventory-numeric">{row.mac}</TableCell>}
{macs && <TableCell className="inventory-numeric">{row.macNote ? <span data-tone="warning" title={row.macNote}>{row.mac}<span className="inventory-visually-hidden">. Check: {row.macNote}</span></span> : row.mac}</TableCell>}
{serials && <TableCell className="inventory-numeric">{row.serial}</TableCell>}
{tags && <TableCell className="inventory-numeric">{row.assetTag}</TableCell>}
</TableRow>
Expand Down
Loading
Loading