2024-03-16 17:09:58 +00:00
|
|
|
package components
|
|
|
|
|
|
|
|
import (
|
2024-03-16 17:34:17 +00:00
|
|
|
"fmt"
|
2024-03-16 17:09:58 +00:00
|
|
|
"git.staur.ca/stobbsm/clustvirt/lib/host"
|
|
|
|
)
|
|
|
|
|
|
|
|
// HostInfo is meant to be an HTMX response
|
|
|
|
templ HostInfo(h *host.Host) {
|
|
|
|
<body>
|
2024-03-16 17:34:17 +00:00
|
|
|
<div class={ "size-64" }>
|
|
|
|
@templ.Raw(h.ChartMemory())
|
|
|
|
</div>
|
|
|
|
<ul>
|
|
|
|
<li>Free: { fmt.Sprintf("%d MB", h.NodeMemory.Free / 1024) }</li>
|
|
|
|
<li>Cached: { fmt.Sprintf("%d MB", h.NodeMemory.Cached / 1024) }</li>
|
|
|
|
<li>Buffers: { fmt.Sprintf("%d MB", h.NodeMemory.Buffers / 1024) }</li>
|
|
|
|
<li>Total: { fmt.Sprintf("%d MB", h.NodeMemory.Total / 1024) }</li>
|
|
|
|
</ul>
|
2024-03-16 17:09:58 +00:00
|
|
|
</body>
|
|
|
|
}
|