package uptime import "gitlab.unjx.de/flohoss/godash/services" import "gitlab.unjx.de/flohoss/godash/components/system" import "fmt" import "html/template" var countDownTemplate = template.Must(template.New("countdown").Parse("")) type Countdown struct { Id string Value uint16 } templ Uptime(extraInfo string, id string, uptime services.Uptime) {
{ extraInfo }
{ fmt.Sprintf("%d",uptime.Days) } days @templ.FromGoHTML(countDownTemplate, Countdown{Id:"uptimeHours", Value:uptime.Hours}) hours @templ.FromGoHTML(countDownTemplate, Countdown{Id:"uptimeMinutes", Value:uptime.Minutes}) min @templ.FromGoHTML(countDownTemplate, Countdown{Id:"uptimeSeconds", Value:uptime.Seconds}) sec
@templ.FromGoHTML(system.BarTemplate, system.Bar{Id:id, Percentage:float64(uptime.Percentage)})
}