clustvirt/view/components/hostinfo.templ

22 lines
547 B
Plaintext
Raw Normal View History

2024-03-16 17:09:58 +00:00
package components
import (
"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>
<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>
}