package views import ( "fmt" "vctp/components/core" ) type VmTraceEntry struct { Snapshot string RawTime int64 Name string VmId string VmUuid string Vcenter string ResourcePool string VcpuCount int64 RamGB int64 ProvisionedDisk float64 CreationTime string DeletionTime string } type VmTraceChart struct { PointsVcpu string PointsRam string PointsTin string PointsBronze string PointsSilver string PointsGold string Width int Height int GridX []float64 GridY []float64 XTicks []ChartTick YTicks []ChartTick } templ VmTracePage(query string, display_query string, vm_id string, vm_uuid string, vm_name string, creationLabel string, deletionLabel string, creationApprox bool, entries []VmTraceEntry, chart VmTraceChart) { @core.Header()
VM Trace

Snapshot history{display_query}

Timeline of vCPU, RAM, and resource pool changes across snapshots.

Clear

Snapshot Timeline

{len(entries)} samples
if chart.PointsVcpu != "" {
for _, y := range chart.GridY { } for _, x := range chart.GridX { } for _, tick := range chart.YTicks { {tick.Label} } for _, tick := range chart.XTicks { {tick.Label} } vCPU RAM (GB) Tin Bronze Silver Gold Resources / Pool Snapshots (oldest left, newest right)
}

Creation time

{creationLabel}

if creationApprox {

Approximate (earliest snapshot)

}

Deletion time

{deletionLabel}

for _, e := range entries { }
Snapshot VM Name VmId VmUuid Vcenter Resource Pool vCPUs RAM (GB) Disk
{e.Snapshot} {e.Name} {e.VmId} {e.VmUuid} {e.Vcenter} {e.ResourcePool} {e.VcpuCount} {e.RamGB} {fmt.Sprintf("%.1f", e.ProvisionedDisk)}
@core.Footer() }