package home import "gitlab.unjx.de/flohoss/godash/services" import "gitlab.unjx.de/flohoss/godash/views/layout" import "gitlab.unjx.de/flohoss/godash/components/system" import "gitlab.unjx.de/flohoss/godash/components/uptime" import "gitlab.unjx.de/flohoss/godash/components/application" import "gitlab.unjx.de/flohoss/godash/components/link" import "fmt" templ Home(title string, bookmarks *services.Bookmarks, static *services.StaticInformation, live *services.LiveInformation) {
@system.System("icon-[bi--cpu]",static.CPU.Name,"",static.CPU.Threads,"systemCpuPercentage","",live.CPU) @system.System("icon-[bi--nvme]",live.Disk.Value,fmt.Sprintf(" | %s", static.Disk.Total),static.Disk.Partitions,"systemDiskPercentage","systemDiskValue",live.Disk.Percentage) @system.System("icon-[bi--memory]",live.Ram.Value,fmt.Sprintf(" | %s", static.Ram.Total),static.Ram.Swap,"systemRamPercentage","systemRamValue",live.Ram.Percentage) @uptime.Uptime(static.Host.Architecture,"systemUptimePercentage",live.Uptime)
for _, a := range bookmarks.Applications {
if a.Category != "" {
{ a.Category }
}
for _, entry := range a.Entries { @application.Application(entry) }
}
for _, l := range bookmarks.Links {
if l.Category != "" {
{ l.Category }
} for _, entry := range l.Entries { @link.Link(entry) }
}
} templ HomeIndex( title, version string, bookmarks *services.Bookmarks, static *services.StaticInformation, live *services.LiveInformation, cmp templ.Component, ) { @layout.Base(title, version) { @cmp } }