templates

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AllNamespace = "All"

AllNamespace is the constant value representing "all namespaces" in the UI. This is the single source of truth for the "all namespaces" identifier.

Usage:

  • Backend Go code: Import this package and use templates.AllNamespace
  • Frontend JavaScript: The value is automatically injected as ALL_NAMESPACE constant
  • Templates: Use { AllNamespace } in templ files

This constant is referenced by:

  • ui/internal/http/kube.go - List methods use this to determine namespace filtering
  • ui/templates/layout.templ - Namespace selector UI
  • ui/templates/scripts.templ - JavaScript namespace logic

Variables

This section is empty.

Functions

func AnnotationChips

func AnnotationChips(annotations map[string]string) templ.Component

AnnotationChips - Display annotations as inline chips

func BMCDropdown

func BMCDropdown(baseURL string) templ.Component

BMCDropdown renders the BMC navigation dropdown menu. baseURL is the URL prefix for all routes (e.g., "/ui").

func BMCJobContentArea

func BMCJobContentArea(jobData BMCJobPageData) templ.Component

func BMCJobDetailContent

func BMCJobDetailContent(job BMCJobDetail, baseURL string) templ.Component

func BMCJobDetailPage

func BMCJobDetailPage(cfg PageConfig, job BMCJobDetail) templ.Component

BMCJobDetailPage shows details for a specific Job.

func BMCJobMainContent

func BMCJobMainContent(jobData BMCJobPageData, baseURL string) templ.Component

func BMCJobPage

func BMCJobPage(cfg PageConfig, jobData BMCJobPageData) templ.Component

BMCJobPage is the Jobs listing page.

func BMCJobTableContent

func BMCJobTableContent(jobData BMCJobPageData) templ.Component

func BMCMachineContentArea

func BMCMachineContentArea(machineData BMCMachinePageData) templ.Component

func BMCMachineDetailContent

func BMCMachineDetailContent(machine BMCMachineDetail, baseURL string) templ.Component

func BMCMachineDetailPage

func BMCMachineDetailPage(cfg PageConfig, machine BMCMachineDetail) templ.Component

BMCMachineDetailPage shows details for a specific Machine.

func BMCMachineMainContent

func BMCMachineMainContent(machineData BMCMachinePageData, baseURL string) templ.Component

func BMCMachinePage

func BMCMachinePage(cfg PageConfig, machineData BMCMachinePageData) templ.Component

BMCMachinePage is the Machines listing page.

func BMCMachineTableContent

func BMCMachineTableContent(machineData BMCMachinePageData) templ.Component

func BMCTaskContentArea

func BMCTaskContentArea(taskData BMCTaskPageData) templ.Component

func BMCTaskDetailContent

func BMCTaskDetailContent(task BMCTaskDetail, baseURL string) templ.Component

func BMCTaskDetailPage

func BMCTaskDetailPage(cfg PageConfig, task BMCTaskDetail) templ.Component

BMCTaskDetailPage shows details for a specific Task.

func BMCTaskMainContent

func BMCTaskMainContent(taskData BMCTaskPageData, baseURL string) templ.Component

func BMCTaskPage

func BMCTaskPage(cfg PageConfig, taskData BMCTaskPageData) templ.Component

BMCTaskPage is the Tasks listing page.

func BMCTaskTableContent

func BMCTaskTableContent(taskData BMCTaskPageData) templ.Component
func BackLink(resourceType, backLink string) templ.Component

func CRDCard

func CRDCard(crdInfo CRDInfo) templ.Component

CRDCard renders a single CRD as a collapsible card.

func CRDKindIcon

func CRDKindIcon(kind string) templ.Component

CRDKindIcon renders an icon based on the CRD kind, matching navigation icons.

func CodeBlock

func CodeBlock(code string) templ.Component

CodeBlock - Styled code/YAML display

func CodeBlockWithCopy

func CodeBlockWithCopy(code, id string) templ.Component

CodeBlockWithCopy - Code block with copy button

func CodeBlockYAML

func CodeBlockYAML(code string) templ.Component

CodeBlockYAML - Code block with YAML syntax highlighting

func CodeBlockYAMLWithCopy

func CodeBlockYAMLWithCopy(code, id string) templ.Component

CodeBlockYAMLWithCopy - Code block with YAML syntax highlighting and copy button

func ContentArea

func ContentArea(hardwareData HardwarePageData) templ.Component

ContentArea Templates for each resource type

func CubeIcon

func CubeIcon() templ.Component

CubeIcon renders a cube icon for the group header.

func DarkModeToggle

func DarkModeToggle() templ.Component

DarkModeToggle renders the dark/light mode toggle button.

func DashboardCRDContent added in v0.24.0

func DashboardCRDContent(data DashboardData) templ.Component

DashboardCRDContent renders the CRD groups content area (used for HTMX partial updates).

func DashboardMainContent

func DashboardMainContent(data DashboardData, baseURL string) templ.Component

DashboardMainContent renders the main content area for the dashboard/landing page.

func DashboardPage

func DashboardPage(cfg PageConfig, data DashboardData) templ.Component

DashboardPage is the landing page showing all CRDs.

func DetailMainContent

func DetailMainContent(resourceType, name, namespace, backLink string, content templ.Component) templ.Component

Reusable detail components - UI

func Footer() templ.Component

Footer renders the CNCF trademark and copyright information.

func HardwareDetailContent

func HardwareDetailContent(hw HardwareDetail, baseURL string) templ.Component

Resource-specific detail content components

func HardwareDetailPage

func HardwareDetailPage(cfg PageConfig, hw HardwareDetail) templ.Component

HardwareDetailPage shows details for a specific hardware resource.

func HardwareTableContent

func HardwareTableContent(hardwareData HardwarePageData) templ.Component

Table content templates for HTMX partial updates

func Header() templ.Component

Header renders the top header bar.

func Homepage

func Homepage(cfg PageConfig, hardwareData HardwarePageData) templ.Component

Homepage is the main hardware listing page.

func LabelChips

func LabelChips(labels map[string]string) templ.Component

LabelChips - Display labels as inline chips

func Layout

func Layout(title string, baseURL string) templ.Component

Layout is the base HTML layout for all pages. baseURL is the URL prefix for all routes (e.g., "/ui").

func LoginPage

func LoginPage(baseURL string) templ.Component

LoginPage is the service token login page.

func Logo(baseURL string) templ.Component

Logo renders the Tinkerbell logo. baseURL is the URL prefix for all routes (e.g., "/ui").

func MainContent

func MainContent(hardwareData HardwarePageData, baseURL string) templ.Component

MainContent templates for each resource type

func MainInfoHeader

func MainInfoHeader(name, status string) templ.Component

MainInfoHeader - Large title with status badge

func MetadataTable

func MetadataTable(name, namespace, createdAt string, labels, annotations map[string]string) templ.Component

MetadataTable - metadata display

func MobileMenuButton

func MobileMenuButton() templ.Component

MobileMenuButton renders the hamburger menu button for mobile.

func MobileMenuOverlay

func MobileMenuOverlay() templ.Component

MobileMenuOverlay renders the mobile menu background overlay.

func NameValueTable

func NameValueTable(rows []InfoRow) templ.Component

NameValueTable - key-value table

func NamespaceSelector

func NamespaceSelector(namespaces []string) templ.Component

NamespaceSelector renders the namespace dropdown selector.

func NavLink(item NavItem) templ.Component

NavLink renders a single navigation link.

func Navigation(baseURL string) templ.Component

Navigation renders the main navigation menu. baseURL is the URL prefix for all routes (e.g., "/ui").

func NotFoundPage

func NotFoundPage(cfg PageConfig, resourceType, resourceName, resourceNamespace, backLink, backLinkLabel, message string) templ.Component

NotFoundPage shows a styled 404 page for missing resources.

func PaginationNav

func PaginationNav(pagination PaginationData) templ.Component

PaginationNav renders the pagination controls

func PermissionRow

func PermissionRow(perm Permission) templ.Component

PermissionRow shows the loaded permission status for a resource.

func PermissionRowError

func PermissionRowError(resource, apiGroup string) templ.Component

PermissionRowError shows an error state for a permission row.

func PermissionRowLoading

func PermissionRowLoading(resource, apiGroup, baseURL string) templ.Component

PermissionRowLoading shows a loading state for a permission row, which will be replaced via HTMX.

func PermissionsPage

func PermissionsPage(cfg PageConfig, resources []ResourceInfo) templ.Component

PermissionsPage shows the user's Tinkerbell RBAC permissions. It loads immediately with loading indicators, then fetches each resource's permissions via HTMX.

func SchemaFieldList

func SchemaFieldList(fields []SchemaField, depth int) templ.Component

SchemaFieldList renders a list of schema fields.

func SchemaFieldView

func SchemaFieldView(field SchemaField, depth int) templ.Component

SchemaFieldView renders a single schema field with optional nested children.

func Scripts

func Scripts(baseURL string) templ.Component

Scripts renders the application JavaScript from an external file. The JavaScript is served from /js/app.js (embedded in the binary). baseURL is the URL prefix for all routes (e.g., "/ui").

func SearchBar() templ.Component

SearchBar renders the global search input.

func SectionBox

func SectionBox(title string) templ.Component

SectionBox - card container with title

func SectionBoxCollapsible

func SectionBoxCollapsible(title string, defaultOpen bool) templ.Component

SectionBoxCollapsible - Collapsible version of SectionBox

func Sidebar(namespaces []string, baseURL string) templ.Component

Sidebar renders the main navigation sidebar. baseURL is the URL prefix for all routes (e.g., "/ui").

func SidebarFooter

func SidebarFooter() templ.Component

SidebarFooter renders the footer section of the sidebar with version and links.

func SpecIcon

func SpecIcon() templ.Component

SpecIcon renders an icon for the spec section.

func StatusBadge

func StatusBadge(status string) templ.Component

func StatusIcon

func StatusIcon() templ.Component

StatusIcon renders an icon for the status section.

func TableCard

func TableCard() templ.Component

TableCard wraps table content with consistent card styling

func TableCardFooter

func TableCardFooter(pagination PaginationData) templ.Component

TableCardFooter renders the pagination footer

func TableCardHeader

func TableCardHeader(count int, resourceName string) templ.Component

TableCardHeader renders the card header with count and search input

func TemplateContentArea

func TemplateContentArea(templateData TemplatePageData) templ.Component

func TemplateDetailContent

func TemplateDetailContent(tpl TemplateDetail, baseURL string) templ.Component

func TemplateDetailPage

func TemplateDetailPage(cfg PageConfig, tpl TemplateDetail) templ.Component

TemplateDetailPage shows details for a specific template.

func TemplateMainContent

func TemplateMainContent(templateData TemplatePageData, baseURL string) templ.Component

func TemplatePage

func TemplatePage(cfg PageConfig, templateData TemplatePageData) templ.Component

TemplatePage is the templates listing page.

func TemplateTableContent

func TemplateTableContent(templateData TemplatePageData) templ.Component

func TypeBadge

func TypeBadge(fieldType string) templ.Component

TypeBadge renders a colored badge for the field type.

func UserProfileDropdown

func UserProfileDropdown() templ.Component

UserProfileDropdown renders the user profile dropdown with API server info and logout.

func VerbBadge

func VerbBadge(verb string) templ.Component

VerbBadge renders a colored badge for RBAC verbs.

func WorkflowContentArea

func WorkflowContentArea(workflowData WorkflowPageData) templ.Component

func WorkflowDetailContent

func WorkflowDetailContent(wf WorkflowDetail, baseURL string) templ.Component

func WorkflowDetailPage

func WorkflowDetailPage(cfg PageConfig, wf WorkflowDetail) templ.Component

WorkflowDetailPage shows details for a specific workflow.

func WorkflowDisabledControl added in v0.26.0

func WorkflowDisabledControl(wf WorkflowDetail) templ.Component

WorkflowDisabledControl renders the current spec.disabled state of a Workflow. Only an "Enable" action is offered, and the backend endpoint it posts to only ever sets spec.disabled to false: a Workflow left enabled leaves State == "" almost immediately on its own, so a "Disable" action would only ever win a narrow race against the controller and isn't offered.

If the user lacks update permission, the Enable button is rendered non-actionable (aria-disabled + tooltip, not the native disabled attribute, so it stays keyboard-focusable and screen readers announce why) instead of letting the click fail with a 403.

func WorkflowMainContent

func WorkflowMainContent(workflowData WorkflowPageData, baseURL string) templ.Component

func WorkflowPage

func WorkflowPage(cfg PageConfig, workflowData WorkflowPageData) templ.Component

WorkflowPage is the workflows listing page.

func WorkflowRuleSetContentArea

func WorkflowRuleSetContentArea(rulesetData WorkflowRuleSetPageData) templ.Component

func WorkflowRuleSetDetailContent

func WorkflowRuleSetDetailContent(rs WorkflowRuleSetDetail, baseURL string) templ.Component

func WorkflowRuleSetDetailPage

func WorkflowRuleSetDetailPage(cfg PageConfig, rs WorkflowRuleSetDetail) templ.Component

WorkflowRuleSetDetailPage shows details for a specific workflowruleset.

func WorkflowRuleSetMainContent

func WorkflowRuleSetMainContent(rulesetData WorkflowRuleSetPageData, baseURL string) templ.Component

func WorkflowRuleSetPage

func WorkflowRuleSetPage(cfg PageConfig, rulesetData WorkflowRuleSetPageData) templ.Component

WorkflowRuleSetPage is the workflowrulesets listing page.

func WorkflowRuleSetTableContent

func WorkflowRuleSetTableContent(rulesetData WorkflowRuleSetPageData) templ.Component

func WorkflowTableContent

func WorkflowTableContent(workflowData WorkflowPageData) templ.Component

func WorkflowTableRow added in v0.26.0

func WorkflowTableRow(wf Workflow) templ.Component

WorkflowTableRow renders a single row of the Workflow list table. It's also returned standalone as an htmx swap target after the Play action enables a disabled Workflow, so its root element must stay a single <tr>.

func WorkflowsDropdown

func WorkflowsDropdown(baseURL string) templ.Component

WorkflowsDropdown renders the Workflows navigation dropdown menu. baseURL is the URL prefix for all routes (e.g., "/ui").

Types

type AgentAttributes

type AgentAttributes struct {
	CPU               AgentCPU                `json:"cpu"`
	Memory            AgentMemory             `json:"memory"`
	BlockDevices      []AgentBlockDevice      `json:"blockDevices"`
	NetworkInterfaces []AgentNetworkInterface `json:"networkInterfaces"`
	PCIDevices        []AgentPCIDevice        `json:"pciDevices"`
	GPUDevices        []AgentGPUDevice        `json:"gpuDevices"`
	Chassis           AgentChassis            `json:"chassis"`
	BIOS              AgentBIOS               `json:"bios"`
	Baseboard         AgentBaseboard          `json:"baseboard"`
	Product           AgentProduct            `json:"product"`
}

AgentAttributes is the shape the "In-Band Attributes" section of the Hardware detail page renders, built from Hardware.status.attributes.inBand by AgentAttributesFromInBand.

func AgentAttributesFromData added in v0.26.0

func AgentAttributesFromData(attrs *data.AgentAttributes) *AgentAttributes

AgentAttributesFromData converts the Agent-reported attributes (as sent over gRPC and stored verbatim as the tinkerbell.org/agent-attributes annotation) into the shape this page renders. Byte counts and link speeds are collected as exact numbers precisely so formatting them for display happens only here, not at collection time.

func AgentAttributesFromInBand added in v0.26.0

func AgentAttributesFromInBand(attrs *tinkv1alpha1.Attributes) *AgentAttributes

AgentAttributesFromInBand converts the shared Attributes schema, as reported by the Tink Agent and stored at Hardware.status.attributes.inBand, into the shape the "In-Band Attributes" section of the Hardware detail page renders.

type AgentBIOS

type AgentBIOS struct {
	Vendor      string `json:"vendor"`
	Version     string `json:"version"`
	ReleaseDate string `json:"releaseDate"`
}

AgentBIOS represents BIOS information from agent attributes.

type AgentBaseboard

type AgentBaseboard struct {
	Vendor       string `json:"vendor"`
	Product      string `json:"product"`
	Version      string `json:"version"`
	SerialNumber string `json:"serialNumber"`
}

AgentBaseboard represents baseboard information from agent attributes.

type AgentBlockDevice

type AgentBlockDevice struct {
	Name              string `json:"name"`
	Size              string `json:"size"`
	ControllerType    string `json:"controllerType"`
	DriveType         string `json:"driveType"`
	PhysicalBlockSize string `json:"physicalBlockSize"`
	Vendor            string `json:"vendor"`
	Model             string `json:"model"`
	WWN               string `json:"wwn"`
	SerialNumber      string `json:"serialNumber"`
	Path              string `json:"path"`
}

AgentBlockDevice represents a block device from agent attributes.

type AgentCPU

type AgentCPU struct {
	TotalCores   int              `json:"totalCores"`
	TotalThreads int              `json:"totalThreads"`
	Processors   []AgentProcessor `json:"processors"`
}

AgentCPU represents CPU information from agent attributes.

type AgentChassis

type AgentChassis struct {
	Serial string `json:"serial"`
	Vendor string `json:"vendor"`
}

AgentChassis represents chassis information from agent attributes.

type AgentGPUDevice

type AgentGPUDevice struct {
	Vendor  string `json:"vendor"`
	Product string `json:"product"`
	Class   string `json:"class"`
	Driver  string `json:"driver"`
}

AgentGPUDevice represents a GPU device from agent attributes.

type AgentLLDPNeighbor added in v0.26.0

type AgentLLDPNeighbor struct {
	ChassisID       string `json:"chassisID"`
	SystemName      string `json:"systemName"`
	PortID          string `json:"portID"`
	PortDescription string `json:"portDescription"`
}

AgentLLDPNeighbor represents a switch (or other LLDP-speaking device) discovered via LLDP on a network port.

type AgentMemory

type AgentMemory struct {
	Total  string `json:"total"`
	Usable string `json:"usable"`
}

AgentMemory represents memory information from agent attributes.

type AgentNetworkInterface

type AgentNetworkInterface struct {
	Name                string              `json:"name"`
	MAC                 string              `json:"mac"`
	Speed               string              `json:"speed"`
	EnabledCapabilities []string            `json:"enabledCapabilities"`
	LLDPNeighbors       []AgentLLDPNeighbor `json:"lldpNeighbors"`
}

AgentNetworkInterface represents a network interface from agent attributes.

type AgentPCIDevice

type AgentPCIDevice struct {
	Vendor  string `json:"vendor"`
	Product string `json:"product"`
	Class   string `json:"class"`
	Driver  string `json:"driver"`
}

AgentPCIDevice represents a PCI device from agent attributes.

type AgentProcessor

type AgentProcessor struct {
	ID           int      `json:"id"`
	Cores        int      `json:"cores"`
	Threads      int      `json:"threads"`
	Vendor       string   `json:"vendor"`
	Model        string   `json:"model"`
	Capabilities []string `json:"capabilities"`
}

AgentProcessor represents a processor from agent attributes.

type AgentProduct

type AgentProduct struct {
	Name         string `json:"name"`
	Vendor       string `json:"vendor"`
	SerialNumber string `json:"serialNumber"`
}

AgentProduct represents product information from agent attributes.

type BMCJob

type BMCJob struct {
	Name        string
	Namespace   string
	MachineRef  string
	Status      string
	CompletedAt string
	CreatedAt   string
}

BMCJob represents a BMC job resource in the list view.

type BMCJobDetail

type BMCJobDetail struct {
	Name        string
	Namespace   string
	MachineRef  string
	Status      string
	CompletedAt string
	CreatedAt   string
	Labels      map[string]string
	Annotations map[string]string
	SpecYAML    string
	StatusYAML  string
	YAML        string
}

BMCJobDetail is the data for the BMC job detail page.

type BMCJobPageData

type BMCJobPageData struct {
	Jobs       []BMCJob
	Pagination PaginationData
}

BMCJobPageData is the data for the BMC job list page.

type BMCMachine

type BMCMachine struct {
	Name        string
	Namespace   string
	PowerState  string
	Contactable string
	Endpoint    string
	CreatedAt   string
}

BMCMachine represents a BMC machine resource in the list view.

type BMCMachineDetail

type BMCMachineDetail struct {
	Name        string
	Namespace   string
	PowerState  string
	Contactable string
	Endpoint    string
	CreatedAt   string
	Labels      map[string]string
	Annotations map[string]string
	SpecYAML    string
	StatusYAML  string
	YAML        string
}

BMCMachineDetail is the data for the BMC machine detail page.

type BMCMachinePageData

type BMCMachinePageData struct {
	Machines   []BMCMachine
	Pagination PaginationData
}

BMCMachinePageData is the data for the BMC machine list page.

type BMCTask

type BMCTask struct {
	Name        string
	Namespace   string
	JobRef      string
	TaskType    string
	Status      string
	CompletedAt string
	CreatedAt   string
}

BMCTask represents a BMC task resource in the list view.

type BMCTaskDetail

type BMCTaskDetail struct {
	Name        string
	Namespace   string
	JobRef      string
	TaskType    string
	Status      string
	CompletedAt string
	CreatedAt   string
	Labels      map[string]string
	Annotations map[string]string
	SpecYAML    string
	StatusYAML  string
	YAML        string
}

BMCTaskDetail is the data for the BMC task detail page.

type BMCTaskPageData

type BMCTaskPageData struct {
	Tasks      []BMCTask
	Pagination PaginationData
}

BMCTaskPageData is the data for the BMC task list page.

type CRDGroup

type CRDGroup struct {
	Name string    // Group name (e.g., "tinkerbell.org")
	CRDs []CRDInfo // CRDs in this group
}

CRDGroup represents a group of CRDs for display.

type CRDInfo

type CRDInfo struct {
	Kind         string        // Resource kind (e.g., "Hardware")
	Plural       string        // Plural name (e.g., "hardware")
	Group        string        // API group (e.g., "tinkerbell.org")
	Version      string        // API version (e.g., "v1alpha1")
	Description  string        // CRD description
	Route        string        // Web UI route (empty if no UI exists)
	SpecFields   []SchemaField // Top-level spec fields
	StatusFields []SchemaField // Top-level status fields
}

CRDInfo represents a Custom Resource Definition for display on the dashboard.

type DashboardData

type DashboardData struct {
	Groups            []CRDGroup // CRDs grouped by API group
	SelectedVersion   string     // Currently selected API version (e.g., "v1alpha1")
	AvailableVersions []string   // All available API versions (e.g., ["v1alpha1", "v1alpha2"])
	BaseURL           string     // URL prefix for HTMX requests
}

DashboardData is the data for the landing page/dashboard.

type Hardware

type Hardware struct {
	Name        string
	Namespace   string
	Description string
	MAC         string
	IPv4Address string
	Status      string
	CreatedAt   string
}

Hardware represents a hardware resource in the list view.

type HardwareDetail

type HardwareDetail struct {
	Name            string
	Namespace       string
	Interfaces      []HardwareInterface
	Status          string
	CreatedAt       string
	Labels          map[string]string
	Annotations     map[string]string
	AgentAttributes *AgentAttributes
	OutOfBand       *OutOfBandAttributes
	SpecYAML        string
	StatusYAML      string
	YAML            string
}

HardwareDetail is the data for the hardware detail page.

type HardwareInterface

type HardwareInterface struct {
	MAC string
	IP  string
}

HardwareInterface represents a single network interface.

type HardwarePageData

type HardwarePageData struct {
	Hardware   []Hardware
	Pagination PaginationData
}

HardwarePageData is the data for the hardware list page.

type InfoRow

type InfoRow struct {
	Name  string
	Value string
	Link  string // If set, Value is rendered as a hyperlink to this URL.
	Hide  bool
}

InfoRow represents a single row in a NameValueTable.

type NavItem struct {
	Name string
	Icon string
	Href string
}

NavItem represents a navigation menu item.

type OOBBIOS added in v0.26.0

type OOBBIOS struct {
	Vendor          string
	Model           string
	SerialNumber    string
	FirmwareVersion string
	ReleaseDate     string
	Status          OOBStatus
}

OOBBIOS describes the system BIOS firmware as reported out-of-band.

type OOBBMC added in v0.26.0

type OOBBMC struct {
	Vendor          string
	Model           string
	SerialNumber    string
	FirmwareVersion string
	NIC             *OOBNetworkInterface
	Status          OOBStatus
}

OOBBMC describes the BMC's own firmware and management NIC.

type OOBBlockDevice added in v0.26.0

type OOBBlockDevice struct {
	ControllerType  string
	DriveType       string
	Vendor          string
	Model           string
	SerialNumber    string
	WWN             string
	SizeBytes       int64
	SmartStatus     string
	FirmwareVersion string
	Status          OOBStatus
}

OOBBlockDevice describes a storage drive as reported out-of-band.

type OOBCPUSocket added in v0.26.0

type OOBCPUSocket struct {
	Slot            string
	Vendor          string
	Model           string
	Cores           uint32
	Threads         uint32
	ClockSpeedMHz   uint32
	SerialNumber    string
	FirmwareVersion string
}

OOBCPUSocket describes a single physical CPU as reported out-of-band.

type OOBComponent added in v0.26.0

type OOBComponent struct {
	Vendor          string
	Model           string
	SerialNumber    string
	Description     string
	FirmwareVersion string
	Status          OOBStatus
}

OOBComponent is a basic hardware component without specialized fields, e.g. a baseboard, chassis, or storage controller.

type OOBGPU added in v0.26.0

type OOBGPU struct {
	Vendor          string
	Model           string
	SerialNumber    string
	Description     string
	FirmwareVersion string
	Status          OOBStatus
}

OOBGPU describes a GPU or accelerator device as reported out-of-band.

type OOBMemoryModule added in v0.26.0

type OOBMemoryModule struct {
	Slot            string
	Vendor          string
	Model           string
	SerialNumber    string
	PartNumber      string
	SizeBytes       int64
	SpeedMHz        uint32
	FormFactor      string
	FirmwareVersion string
}

OOBMemoryModule describes a single memory module as reported out-of-band.

type OOBNetworkInterface added in v0.26.0

type OOBNetworkInterface struct {
	Vendor          string
	Model           string
	SerialNumber    string
	FirmwareVersion string
	Ports           []OOBNetworkPort
}

OOBNetworkInterface describes a network adapter as reported out-of-band.

func (OOBNetworkInterface) MACAddresses added in v0.26.0

func (n OOBNetworkInterface) MACAddresses() string

MACAddresses joins every port's MAC address for display in a single table cell, since a NIC can have multiple physical ports.

func (OOBNetworkInterface) PortSpeeds added in v0.26.0

func (n OOBNetworkInterface) PortSpeeds() string

PortSpeeds joins every port's speed (e.g. "25000 Mbps") for display in a single table cell, since a NIC can have multiple physical ports.

type OOBNetworkPort added in v0.26.0

type OOBNetworkPort struct {
	PortID     string
	MAC        string
	LinkStatus string
	SpeedMbps  uint32
	MTU        uint32
}

OOBNetworkPort describes a single physical port on a network adapter.

type OOBPSU added in v0.26.0

type OOBPSU struct {
	Vendor             string
	Model              string
	SerialNumber       string
	Description        string
	FirmwareVersion    string
	PowerCapacityWatts int64
	Status             OOBStatus
}

OOBPSU describes a power supply unit as reported out-of-band.

type OOBProduct added in v0.26.0

type OOBProduct struct {
	Name         string
	Vendor       string
	Model        string
	SerialNumber string
	Status       OOBStatus
}

OOBProduct describes the overall system identity as reported out-of-band — the machine's own asset details, distinct from any individual component.

type OOBStatus added in v0.26.0

type OOBStatus struct {
	Health string
	State  string
	// PostCode is a pointer because 0 is a meaningful POST code (success).
	// Only meaningful on BIOS.
	PostCode       *int32
	PostCodeStatus string
}

OOBStatus is health/state info for a component, as reported out-of-band. Mirrors api/v1alpha1/tinkerbell.ComponentStatus, flattened to a value type for template convenience.

type OOBTPM added in v0.26.0

type OOBTPM struct {
	Vendor          string
	Model           string
	SerialNumber    string
	InterfaceType   string
	FirmwareVersion string
	Status          OOBStatus
}

OOBTPM describes a trusted platform module as reported out-of-band.

type OutOfBandAttributes added in v0.26.0

type OutOfBandAttributes struct {
	LastUpdated        string // pre-formatted, same convention as HardwareDetail.CreatedAt
	CollectionMethod   string
	TotalCores         uint32
	TotalThreads       uint32
	CPUs               []OOBCPUSocket
	TotalMemoryBytes   int64
	MemoryModules      []OOBMemoryModule
	Drives             []OOBBlockDevice
	NICs               []OOBNetworkInterface
	GPUs               []OOBGPU
	Chassis            OOBComponent
	Baseboard          OOBComponent
	BIOS               OOBBIOS
	Product            OOBProduct
	BMC                OOBBMC
	PSUs               []OOBPSU
	TPMs               []OOBTPM
	StorageControllers []OOBComponent
}

OutOfBandAttributes is hardware data collected out-of-band via the BMC, mirroring api/v1alpha1/tinkerbell.Attributes (the status.attributes.outOfBand subtree). Every field is optional: BMC vendors/protocols vary widely in what they report, so an empty field here reflects what the BMC/collection driver reports, not an error.

func OutOfBandAttributesFromStatus added in v0.26.0

func OutOfBandAttributesFromStatus(attrs *tinkv1alpha1.Attributes) *OutOfBandAttributes

OutOfBandAttributesFromStatus converts the typed Hardware.status.attributes.outOfBand field into the template's flattened OutOfBandAttributes type. Unlike AgentAttributes, which is parsed from a JSON annotation, this is a plain Go-to-Go mapping.

type PageConfig

type PageConfig struct {
	BaseURL    string   // URL prefix for all routes (e.g., "/ui")
	Namespaces []string // Available namespaces
}

PageConfig holds common page configuration.

type PaginationData

type PaginationData struct {
	CurrentPage  int
	TotalPages   int
	TotalItems   int
	ItemsPerPage int
	StartItem    int
	EndItem      int
	ResourcePath string // e.g., "/hardware", "/workflows", "/templates"
	TargetID     string // e.g., "#hardware-content", "#workflow-content"
}

PaginationData holds pagination state for list views.

type Permission

type Permission struct {
	Resource  string
	APIGroup  string
	Namespace string   // Namespace scope (empty means cluster-wide)
	Verbs     []string // Allowed verbs for this resource
}

Permission represents a Kubernetes RBAC permission for a Tinkerbell resource.

type ResourceInfo

type ResourceInfo struct {
	Resource string
	APIGroup string
}

ResourceInfo represents a Tinkerbell resource for the permissions loading page.

type SchemaField

type SchemaField struct {
	Name        string        // Field name
	Type        string        // Field type (string, integer, boolean, object, array)
	Description string        // Field description from CRD
	Required    bool          // Whether the field is required
	Deprecated  bool          // Whether the field is deprecated
	Children    []SchemaField // Nested fields for objects/arrays
	Pattern     string        // Regex pattern for validation (if any)
	Enum        []string      // Allowed enum values (if any)
	Default     string        // Default value (if any)
	Format      string        // Format hint (date-time, int64, uri, etc.)
}

SchemaField represents a field in a CRD schema for display.

type Template

type Template struct {
	Name      string
	Namespace string
	State     string
	Data      string
	CreatedAt string
}

Template represents a template resource in the list view.

type TemplateDetail

type TemplateDetail struct {
	Name        string
	Namespace   string
	State       string
	Data        string
	CreatedAt   string
	Labels      map[string]string
	Annotations map[string]string
	SpecYAML    string
	StatusYAML  string
	YAML        string
}

TemplateDetail is the data for the template detail page.

type TemplatePageData

type TemplatePageData struct {
	Templates  []Template
	Pagination PaginationData
}

TemplatePageData is the data for the template list page.

type Workflow

type Workflow struct {
	Name        string
	Namespace   string
	TemplateRef string
	State       string
	Disabled    bool
	// CanUpdate reports whether the current user has permission to enable
	// this Workflow. Checked once per list render, not per row.
	CanUpdate bool
	Task      string
	Action    string
	Agent     string
	CreatedAt string
}

Workflow represents a workflow resource in the list view.

type WorkflowDetail

type WorkflowDetail struct {
	Name        string
	Namespace   string
	TemplateRef string
	HardwareRef string
	State       string
	Disabled    bool
	// CanUpdate reports whether the current user has permission to enable
	// this Workflow.
	CanUpdate         bool
	Task              string
	Action            string
	Agent             string
	TemplateRendering string
	CreatedAt         string
	Labels            map[string]string
	Annotations       map[string]string
	SpecYAML          string
	StatusYAML        string
	YAML              string
}

WorkflowDetail is the data for the workflow detail page.

type WorkflowPageData

type WorkflowPageData struct {
	Workflows  []Workflow
	Pagination PaginationData
}

WorkflowPageData is the data for the workflow list page.

type WorkflowRuleSet

type WorkflowRuleSet struct {
	Name        string
	Namespace   string
	Rules       string
	TemplateRef string
	CreatedAt   string
}

WorkflowRuleSet represents a workflowruleset resource in the list view.

type WorkflowRuleSetDetail

type WorkflowRuleSetDetail struct {
	Name              string
	Namespace         string
	YAMLData          string
	CreatedAt         string
	Labels            map[string]string
	Annotations       map[string]string
	Rules             []string
	TemplateRef       string
	WorkflowNamespace string
	WorkflowDisabled  bool
	AddAttributes     bool
	AgentValue        string
}

WorkflowRuleSetDetail is the data for the workflowruleset detail page.

type WorkflowRuleSetPageData

type WorkflowRuleSetPageData struct {
	RuleSets   []WorkflowRuleSet
	Pagination PaginationData
}

WorkflowRuleSetPageData is the data for the workflowruleset list page.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL