clustvirt/view/cluster.templ
Matthew Stobbs 48bdc94351 merge barnch switch_to_templ
- Moved to templ for templating
- Started adding cluster statistics
2024-03-19 09:13:44 -06:00

58 lines
1.2 KiB
Plaintext

package view
import (
"fmt"
"git.staur.ca/stobbsm/clustvirt/cluster"
"git.staur.ca/stobbsm/clustvirt/view/components"
"git.staur.ca/stobbsm/clustvirt/view/layouts"
)
templ ClusterInfo(cs *cluster.ClusterStats, diff cluster.StatDiff, navbar []components.NavItem) {
@layouts.Manager("ClustVirt", "Cluster Manager", navbar) {
<h3>Cluster Stats</h3>
<table class={ "table-auto", "w-full" }>
<caption class={ "caption-top" }>
CPU stats
</caption>
<thead>
<tr>
<th>Sockets</th>
<th>Cores</th>
<th>Threads</th>
<th>Allocated</th>
</tr>
</thead>
<tbody>
<tr>
<td>
{ fmt.Sprint(cs.CPU.Sockets) }
</td>
<td>
{ fmt.Sprint(cs.CPU.Cores) }
</td>
<td>
{ fmt.Sprint(cs.CPU.Threads) }
</td>
<td>
{ fmt.Sprint(cs.CPU.Allocated) }
</td>
</tr>
<tr>
<td>
{ fmt.Sprint(diff.CPU.Sockets) }
</td>
<td>
{ fmt.Sprint(diff.CPU.Cores) }
</td>
<td>
{ fmt.Sprint(diff.CPU.Threads) }
</td>
<td>
{ fmt.Sprint(diff.CPU.Allocated) }
</td>
</tr>
</tbody>
</table>
}
}