enhance vm trace page
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-01-16 14:52:15 +11:00
parent d55916766b
commit 7273961cfc
4 changed files with 152 additions and 57 deletions

View File

@@ -35,7 +35,7 @@ type VmTraceChart struct {
YTicks []ChartTick
}
templ VmTracePage(query string, display_query string, vm_id string, vm_uuid string, vm_name string, entries []VmTraceEntry, chart VmTraceChart) {
templ VmTracePage(query string, display_query string, vm_id string, vm_uuid string, vm_name string, creationLabel string, deletionLabel string, entries []VmTraceEntry, chart VmTraceChart) {
<!DOCTYPE html>
<html lang="en">
@core.Header()
@@ -120,6 +120,16 @@ templ VmTracePage(query string, display_query string, vm_id string, vm_uuid stri
</svg>
</div>
}
<div class="grid gap-3 md:grid-cols-2 mb-4">
<div class="web2-card">
<p class="text-xs uppercase tracking-[0.15em] text-slate-500">Creation time</p>
<p class="mt-2 text-base font-semibold text-slate-800">{creationLabel}</p>
</div>
<div class="web2-card">
<p class="text-xs uppercase tracking-[0.15em] text-slate-500">Deletion time</p>
<p class="mt-2 text-base font-semibold text-slate-800">{deletionLabel}</p>
</div>
</div>
<div class="overflow-hidden border border-slate-200 rounded">
<table class="web2-table">
<thead>
@@ -133,8 +143,6 @@ templ VmTracePage(query string, display_query string, vm_id string, vm_uuid stri
<th class="text-right">vCPUs</th>
<th class="text-right">RAM (GB)</th>
<th class="text-right">Disk</th>
<th>Creation</th>
<th>Deletion</th>
</tr>
</thead>
<tbody>
@@ -149,8 +157,6 @@ templ VmTracePage(query string, display_query string, vm_id string, vm_uuid stri
<td class="text-right">{e.VcpuCount}</td>
<td class="text-right">{e.RamGB}</td>
<td class="text-right">{fmt.Sprintf("%.1f", e.ProvisionedDisk)}</td>
<td>{e.CreationTime}</td>
<td>{e.DeletionTime}</td>
</tr>
}
</tbody>