Documentation
¶
Index ¶
- Variables
- func ASCIIBanner(frame int) string
- func CategoryTag(emoji, label string) string
- func CycleTheme() string
- func DetailTabs(snap core.UsageSnapshot) []string
- func MetaTag(icon, text string) string
- func MetaTagHighlight(icon, text string) string
- func ModelColor(idx int) lipgloss.Color
- func ProviderColor(providerID string) lipgloss.Color
- func PulseChar(bright, dim string, frame int) string
- func RenderBrailleChart(title string, series []BrailleSeries, w, h int, yFmt func(float64) string) string
- func RenderBudgetGauge(label string, used, limit float64, barW, labelW int, color lipgloss.Color, ...) string
- func RenderDetailContent(snap core.UsageSnapshot, w int, warnThresh, critThresh float64, activeTab int) string
- func RenderFixedGrid(rows []PanelRow, totalW, totalH int) string
- func RenderGauge(percent float64, width int, warnThresh, critThresh float64) string
- func RenderGradientGauge(percent float64, width int, colors []lipgloss.Color) string
- func RenderGradientText(text string, frame int) string
- func RenderHBarChart(items []chartItem, maxBarW, labelW int) string
- func RenderHeatmap(spec HeatmapSpec, w int) string
- func RenderInlineGauge(pct float64, w int) string
- func RenderMiniGauge(usedPercent float64, width int) string
- func RenderShimmerGauge(width, frame int) string
- func RenderSparkline(values []float64, w int, color lipgloss.Color) string
- func RenderStackedUsageGauge(segments []GaugeSegment, totalPercent float64, width int) string
- func RenderSubTabBar(labels []string, active int, w int) string
- func RenderTimeChart(spec TimeChartSpec, w int) string
- func RenderTokenBreakdown(input, output float64, w int) string
- func RenderUsageGauge(usedPercent float64, width int, warnThresh, critThresh float64) string
- func SetThemeByName(name string) bool
- func StatusBadge(s core.Status) string
- func StatusBorderColor(s core.Status) lipgloss.Color
- func StatusColor(s core.Status) lipgloss.Color
- func StatusIcon(s core.Status) string
- func StatusPill(s core.Status) string
- func ThemeName() string
- type BrailleSeries
- type DaemonStatus
- type DaemonStatusMsg
- type DetailTab
- type GaugeSegment
- type HeatmapSpec
- type Model
- func (m Model) Init() tea.Cmd
- func (m *Model) SetOnAddAccount(fn func(core.AccountConfig))
- func (m *Model) SetOnInstallDaemon(fn func() error)
- func (m *Model) SetOnRefresh(fn func())
- func (m *Model) SetOnTimeWindowChange(fn func(string))
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type Panel
- type PanelRow
- type SnapshotsMsg
- type Theme
- type TimeChartMode
- type TimeChartSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var ActiveThemeIdx int
View Source
var BrandGradient []lipgloss.Color
View Source
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
View Source
var Themes = []Theme{
gruvbox,
catppuccinMocha,
dracula,
nord,
tokyoNight,
synthwave,
oneDark,
solarizedDark,
monokai,
everforest,
kanagawa,
rosePine,
ayuDark,
nightfox,
}
Functions ¶
func ASCIIBanner ¶
func CategoryTag ¶
func CycleTheme ¶
func CycleTheme() string
func DetailTabs ¶
func DetailTabs(snap core.UsageSnapshot) []string
func MetaTagHighlight ¶
func ModelColor ¶
func ProviderColor ¶
func RenderBrailleChart ¶
func RenderBudgetGauge ¶
func RenderDetailContent ¶
func RenderFixedGrid ¶
func RenderGauge ¶
func RenderGradientGauge ¶
func RenderGradientText ¶
func RenderHBarChart ¶
func RenderHeatmap ¶ added in v0.5.0
func RenderHeatmap(spec HeatmapSpec, w int) string
func RenderInlineGauge ¶
func RenderMiniGauge ¶
func RenderShimmerGauge ¶ added in v0.5.5
RenderShimmerGauge draws an animated empty gauge track with a moving bright spot, used as a loading placeholder before real data arrives.
func RenderStackedUsageGauge ¶ added in v0.5.5
func RenderStackedUsageGauge(segments []GaugeSegment, totalPercent float64, width int) string
RenderStackedUsageGauge draws a multi-segment usage gauge bar. Each segment occupies a proportional share of the filled area. totalPercent is the overall usage percentage shown in the label.
func RenderTimeChart ¶ added in v0.5.0
func RenderTimeChart(spec TimeChartSpec, w int) string
func RenderTokenBreakdown ¶
func RenderUsageGauge ¶
func SetThemeByName ¶
func StatusBadge ¶
func StatusIcon ¶
func StatusPill ¶
Types ¶
type BrailleSeries ¶
type DaemonStatus ¶ added in v0.5.0
type DaemonStatus string
const ( DaemonConnecting DaemonStatus = "connecting" DaemonNotInstalled DaemonStatus = "not_installed" DaemonStarting DaemonStatus = "starting" DaemonRunning DaemonStatus = "running" DaemonOutdated DaemonStatus = "outdated" DaemonError DaemonStatus = "error" )
type DaemonStatusMsg ¶ added in v0.5.0
type DaemonStatusMsg struct {
Status DaemonStatus
Message string
InstallHint string
}
type GaugeSegment ¶ added in v0.5.5
GaugeSegment represents one colored segment of a stacked gauge bar.
type HeatmapSpec ¶ added in v0.5.0
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel( warnThresh, critThresh float64, experimentalAnalytics bool, dashboardCfg config.DashboardConfig, accounts []core.AccountConfig, timeWindow core.TimeWindow, ) Model
func (*Model) SetOnAddAccount ¶ added in v0.2.0
func (m *Model) SetOnAddAccount(fn func(core.AccountConfig))
SetOnAddAccount sets a callback invoked when a new provider account is added via the API Keys tab.
func (*Model) SetOnInstallDaemon ¶ added in v0.5.0
func (*Model) SetOnRefresh ¶ added in v0.4.0
func (m *Model) SetOnRefresh(fn func())
SetOnRefresh sets a callback invoked when the user requests a manual refresh.
func (*Model) SetOnTimeWindowChange ¶ added in v0.5.2
SetOnTimeWindowChange sets a callback invoked when the user changes the time window.
type SnapshotsMsg ¶
type SnapshotsMsg map[string]core.UsageSnapshot
type Theme ¶
type Theme struct {
Name string
Icon string // emoji identifier
Base, Mantle lipgloss.Color
Surface0, Surface1, Surface2, Overlay lipgloss.Color
Text, Subtext, Dim lipgloss.Color
Accent, Blue, Sapphire lipgloss.Color
Green, Yellow, Red lipgloss.Color
Peach, Teal, Flamingo lipgloss.Color
Rosewater, Lavender, Sky, Maroon lipgloss.Color
}
type TimeChartMode ¶ added in v0.5.0
type TimeChartMode int
const ( TimeChartLine TimeChartMode = iota TimeChartStacked TimeChartBars )
type TimeChartSpec ¶ added in v0.5.0
type TimeChartSpec struct {
Title string
Mode TimeChartMode
Series []BrailleSeries
Height int
MaxSeries int
WindowDays int
YFmt func(float64) string
}
Click to show internal directories.
Click to hide internal directories.