Documentation
¶
Overview ¶
templ: version: v0.3.977
templ: version: v0.3.977
templ: version: v0.3.977
Package templates contains view model types for templating. These types mirror the analytics types to avoid import cycles.
Index ¶
- func Bar(label string, value int, max int) templ.Component
- func BotStatsFragment(stats *BotStatsViewModel, periodDays int, hourly bool, monthly bool) templ.Component
- func BotStatsFragmentOnly(stats *BotStatsViewModel, days int, hourly bool, monthly bool) templ.Component
- func BotStatsGrid(stats *BotStatsViewModel) templ.Component
- func BotTopPagesSection(pages []PageStatViewModel) templ.Component
- func BotViewsChartSection(dailyVisits []DailyViewViewModel, hourly bool, monthly bool) templ.Component
- func Chart(data []DailyViewViewModel) templ.Component
- func ChartBar(item DailyViewViewModel, maxViews int) templ.Component
- func ContentContainer() templ.Component
- func Dashboard() templ.Component
- func DimensionRow(stat DimensionStatViewModel, maxCount int) templ.Component
- func DimensionSection(title string, stats []DimensionStatViewModel) templ.Component
- func DimensionStatsSections(browsers, os, devices, referrers []DimensionStatViewModel) templ.Component
- func LatestPageRow(page LatestPageVisitViewModel) templ.Component
- func LatestPagesSection(pages []LatestPageVisitViewModel) templ.Component
- func Layout(title string, activeTab string) templ.Component
- func PageRow(page PageStatViewModel, maxViews int) templ.Component
- func PeriodSelector(activePeriod string) templ.Component
- func PeriodSelectorWithBotStats(period string, stats *BotStatsViewModel, days int, hourly bool, monthly bool) templ.Component
- func PeriodSelectorWithStats(period string, stats *StatsViewModel, realtime int, days int, hourly bool, ...) templ.Component
- func SetupContent(origin string) templ.Component
- func SetupFragment(origin string) templ.Component
- func StatsFragment(stats *StatsViewModel, realtime int, periodDays int, hourly bool, monthly bool) templ.Component
- func StatsFragmentOnly(stats *StatsViewModel, realtime int, days int, hourly bool, monthly bool) templ.Component
- func StatsGridStats(stats *StatsViewModel, realtime int) templ.Component
- func TabSelector(activeTab string) templ.Component
- func TopBotsSection(bots []DimensionStatViewModel) templ.Component
- func TopPagesSection(pages []PageStatViewModel) templ.Component
- func ViewsChartSection(dailyViews []DailyViewViewModel, hourly bool, monthly bool) templ.Component
- type BotStatsViewModel
- type DailyViewViewModel
- type DimensionStatViewModel
- type LatestPageVisitViewModel
- type PageStatViewModel
- type StatsViewModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BotStatsFragment ¶
func BotStatsFragment(stats *BotStatsViewModel, periodDays int, hourly bool, monthly bool) templ.Component
BotStatsFragment renders the complete bot stats view as HTML fragment
func BotStatsFragmentOnly ¶
func BotStatsFragmentOnly(stats *BotStatsViewModel, days int, hourly bool, monthly bool) templ.Component
BotStatsFragmentOnly renders only the bot stats content without period selector (for talkdom updates)
func BotStatsGrid ¶
func BotStatsGrid(stats *BotStatsViewModel) templ.Component
BotStatsGrid renders the bot stats grid
func BotTopPagesSection ¶
func BotTopPagesSection(pages []PageStatViewModel) templ.Component
BotTopPagesSection renders the top pages for bots
func BotViewsChartSection ¶
func BotViewsChartSection(dailyVisits []DailyViewViewModel, hourly bool, monthly bool) templ.Component
BotViewsChartSection renders the bot views over time chart
func ChartBar ¶
func ChartBar(item DailyViewViewModel, maxViews int) templ.Component
ChartBar renders a single bar in the chart
func ContentContainer ¶
ContentContainer renders the main content area
func DimensionRow ¶
func DimensionRow(stat DimensionStatViewModel, maxCount int) templ.Component
DimensionRow renders a single dimension row with bar
func DimensionSection ¶
func DimensionSection(title string, stats []DimensionStatViewModel) templ.Component
DimensionSection renders a dimension stats section
func DimensionStatsSections ¶
func DimensionStatsSections(browsers, os, devices, referrers []DimensionStatViewModel) templ.Component
DimensionStatsSections renders all dimension stats (browsers, OS, devices, referrers)
func LatestPageRow ¶
func LatestPageRow(page LatestPageVisitViewModel) templ.Component
LatestPageRow renders a single latest page row
func LatestPagesSection ¶
func LatestPagesSection(pages []LatestPageVisitViewModel) templ.Component
LatestPagesSection renders the latest visited pages
func PageRow ¶
func PageRow(page PageStatViewModel, maxViews int) templ.Component
PageRow renders a single page row with bar
func PeriodSelector ¶
PeriodSelector renders the period buttons
func PeriodSelectorWithBotStats ¶
func PeriodSelectorWithBotStats(period string, stats *BotStatsViewModel, days int, hourly bool, monthly bool) templ.Component
PeriodSelectorWithBotStats renders the period selector with bot stats content
func PeriodSelectorWithStats ¶
func PeriodSelectorWithStats(period string, stats *StatsViewModel, realtime int, days int, hourly bool, monthly bool) templ.Component
PeriodSelectorWithStats renders the period selector with visitor stats content
func SetupContent ¶
SetupContent renders the setup tab content
func SetupFragment ¶
SetupFragment renders the setup tab content
func StatsFragment ¶
func StatsFragment(stats *StatsViewModel, realtime int, periodDays int, hourly bool, monthly bool) templ.Component
StatsFragment renders the complete stats view as HTML fragment
func StatsFragmentOnly ¶
func StatsFragmentOnly(stats *StatsViewModel, realtime int, days int, hourly bool, monthly bool) templ.Component
StatsFragmentOnly renders only the stats content without period selector (for talkdom updates)
func StatsGridStats ¶
func StatsGridStats(stats *StatsViewModel, realtime int) templ.Component
StatsGridStats renders the main stat cards
func TabSelector ¶
TabSelector renders the tab navigation
func TopBotsSection ¶
func TopBotsSection(bots []DimensionStatViewModel) templ.Component
TopBotsSection renders the top bots table
func TopPagesSection ¶
func TopPagesSection(pages []PageStatViewModel) templ.Component
TopPagesSection renders the top pages table
func ViewsChartSection ¶
func ViewsChartSection(dailyViews []DailyViewViewModel, hourly bool, monthly bool) templ.Component
ViewsChartSection renders the views over time chart
Types ¶
type BotStatsViewModel ¶
type BotStatsViewModel struct {
Period string
TotalVisits int
TopBots []DimensionStatViewModel
TopPages []PageStatViewModel
DailyVisits []DailyViewViewModel
}
BotStatsViewModel represents bot analytics statistics for templating.
type DailyViewViewModel ¶
DailyViewViewModel represents views per day.
type DimensionStatViewModel ¶
DimensionStatViewModel represents a dimension breakdown.
type LatestPageVisitViewModel ¶
LatestPageVisitViewModel represents a single recent page visit.
type PageStatViewModel ¶
PageStatViewModel represents page view statistics.
type StatsViewModel ¶
type StatsViewModel struct {
Period string
UniqueVisitors int
TotalViews int
AvgDuration int
TopPages []PageStatViewModel
LatestPages []LatestPageVisitViewModel
BrowserStats []DimensionStatViewModel
OSStats []DimensionStatViewModel
DeviceStats []DimensionStatViewModel
ReferrerStats []DimensionStatViewModel
DailyViews []DailyViewViewModel
}
StatsViewModel represents analytics statistics for templating.