This commit is contained in:
47
components/views/snapshots.templ
Normal file
47
components/views/snapshots.templ
Normal file
@@ -0,0 +1,47 @@
|
||||
package views
|
||||
|
||||
import (
|
||||
"vctp/components/core"
|
||||
)
|
||||
|
||||
type SnapshotEntry struct {
|
||||
Label string
|
||||
Link string
|
||||
}
|
||||
|
||||
templ SnapshotHourlyList(entries []SnapshotEntry) {
|
||||
@SnapshotListPage("Hourly Inventory Snapshots", "inventory snapshots captured hourly", entries)
|
||||
}
|
||||
|
||||
templ SnapshotDailyList(entries []SnapshotEntry) {
|
||||
@SnapshotListPage("Daily Inventory Snapshots", "daily summaries of hourly inventory snapshots", entries)
|
||||
}
|
||||
|
||||
templ SnapshotMonthlyList(entries []SnapshotEntry) {
|
||||
@SnapshotListPage("Monthly Inventory Snapshots", "monthly summary aggregated from daily snapshots", entries)
|
||||
}
|
||||
|
||||
templ SnapshotListPage(title string, subtitle string, entries []SnapshotEntry) {
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@core.Header()
|
||||
<body class="flex flex-col min-h-screen">
|
||||
<main class="flex-grow">
|
||||
<div>
|
||||
<h1 class="text-4xl font-bold">{title}</h1>
|
||||
<p class="mt-2 text-gray-600">{subtitle}</p>
|
||||
<ul class="mt-6 space-y-2">
|
||||
for _, entry := range entries {
|
||||
<li>
|
||||
<a class="text-blue-600 hover:underline" href={entry.Link}>
|
||||
{entry.Label}
|
||||
</a>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
@core.Footer()
|
||||
</html>
|
||||
}
|
||||
Reference in New Issue
Block a user