58 lines
1.2 KiB
Plaintext
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>
|
||
|
}
|
||
|
}
|