Documentation
¶
Index ¶
- Variables
- func ASCIIBanner(frame int) string
- func ActiveThemeIndex() int
- func CycleTheme() string
- func DetailTabs(snap core.UsageSnapshot) []string
- func LoadThemes(configDir string) error
- 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 RenderGauge(percent float64, width int, warnThresh, critThresh float64) string
- func RenderGradientText(text string, frame int) string
- func RenderHBarChart(items []chartItem, maxBarW, labelW int) string
- func RenderHeatmap(spec HeatmapSpec, 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 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 ThemeName() string
- type AppUpdateMsg
- 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(core.TimeWindow))
- func (m *Model) SetOnTimeWindowChange(fn func(core.TimeWindow))
- func (m *Model) SetServices(services Services)
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- type Services
- type SnapshotsMsg
- type TelemetryUnmappedDetail
- type Theme
- type TimeChartMode
- type TimeChartSpec
Constants ¶
This section is empty.
Variables ¶
var BrandGradient []lipgloss.Color
var SpinnerFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
Functions ¶
func ASCIIBanner ¶
func ActiveThemeIndex ¶ added in v0.6.0
func ActiveThemeIndex() int
func CycleTheme ¶
func CycleTheme() string
func DetailTabs ¶
func DetailTabs(snap core.UsageSnapshot) []string
func LoadThemes ¶ added in v0.6.0
LoadThemes reloads the theme catalog from the default theme, bundled themes, plus external theme files.
External files are loaded from:
- <configDir>/themes
- each path in OPENUSAGE_THEME_DIR (path-list separated)
Invalid theme files are skipped. The function returns an aggregated error when one or more files fail to load, while still keeping valid themes available.
func ProviderColor ¶
func RenderBrailleChart ¶
func RenderBudgetGauge ¶
func RenderDetailContent ¶
func RenderDetailContent(snap core.UsageSnapshot, w int, warnThresh, critThresh float64, activeTab int, timeWindow core.TimeWindow) string
func RenderGauge ¶
func RenderGradientText ¶
func RenderHBarChart ¶
func RenderHeatmap ¶ added in v0.5.0
func RenderHeatmap(spec HeatmapSpec, w int) string
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 ¶
Types ¶
type AppUpdateMsg ¶ added in v0.5.7
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(core.TimeWindow))
func (*Model) SetOnTimeWindowChange ¶ added in v0.5.2
func (m *Model) SetOnTimeWindowChange(fn func(core.TimeWindow))
func (*Model) SetServices ¶ added in v0.6.12
type Services ¶ added in v0.6.12
type Services interface {
SaveTheme(themeName string) error
SaveDashboardProviders(providers []config.DashboardProviderConfig) error
SaveDashboardView(view string) error
SaveDashboardWidgetSections(sections []config.DashboardWidgetSection) error
SaveDetailWidgetSections(sections []config.DetailWidgetSection) error
SaveDashboardHideSectionsWithNoData(hide bool) error
SaveTimeWindow(window string) error
SaveProviderLink(source, target string) error
DeleteProviderLink(source string) error
ValidateAPIKey(accountID, providerID, apiKey string) (bool, string)
SaveCredential(accountID, apiKey string) error
DeleteCredential(accountID string) error
InstallIntegration(id integrations.ID) ([]integrations.Status, error)
}
type SnapshotsMsg ¶
type SnapshotsMsg struct {
Snapshots map[string]core.UsageSnapshot
TimeWindow core.TimeWindow
RequestID uint64
}
type TelemetryUnmappedDetail ¶ added in v0.9.6
type TelemetryUnmappedDetail struct {
Source string
Category telemetryUnmappedCategory
Suggestion string
}
TelemetryUnmappedDetail is the parsed view of one entry in telemetry_unmapped_meta. Suggestion is empty when no candidate target exists.
type Theme ¶
type Theme struct {
Name string `json:"name"`
Icon string `json:"icon"`
Base lipgloss.Color `json:"base"`
Mantle lipgloss.Color `json:"mantle"`
Surface0 lipgloss.Color `json:"surface0"`
Surface1 lipgloss.Color `json:"surface1"`
Surface2 lipgloss.Color `json:"surface2"`
Overlay lipgloss.Color `json:"overlay"`
Text lipgloss.Color `json:"text"`
Subtext lipgloss.Color `json:"subtext"`
Dim lipgloss.Color `json:"dim"`
Accent lipgloss.Color `json:"accent"`
Blue lipgloss.Color `json:"blue"`
Sapphire lipgloss.Color `json:"sapphire"`
Green lipgloss.Color `json:"green"`
Yellow lipgloss.Color `json:"yellow"`
Red lipgloss.Color `json:"red"`
Peach lipgloss.Color `json:"peach"`
Teal lipgloss.Color `json:"teal"`
Flamingo lipgloss.Color `json:"flamingo"`
Rosewater lipgloss.Color `json:"rosewater"`
Lavender lipgloss.Color `json:"lavender"`
Sky lipgloss.Color `json:"sky"`
Maroon lipgloss.Color `json:"maroon"`
}
Theme represents the full visual token set used by the TUI.
External themes can be defined as JSON files with matching snake_case fields, for example: {"name":"My Theme","base":"#111111",...}.
func ActiveTheme ¶ added in v0.6.0
func ActiveTheme() Theme
func AvailableThemes ¶ added in v0.6.0
func AvailableThemes() []Theme
type TimeChartMode ¶ added in v0.5.0
type TimeChartMode int
const ( TimeChartLine TimeChartMode = iota TimeChartStacked TimeChartBars )
type TimeChartSpec ¶ added in v0.5.0
Source Files
¶
- analytics.go
- analytics_cache.go
- analytics_data.go
- analytics_redesign.go
- analytics_redesign_helpers.go
- analytics_redesign_panels.go
- charts.go
- charts_ntcharts.go
- dashboard_views.go
- detail.go
- detail_analytics_sections.go
- detail_format.go
- detail_info.go
- detail_metrics.go
- detail_sections.go
- detail_trends.go
- gauge.go
- help.go
- model.go
- model_commands.go
- model_display_info.go
- model_input.go
- model_panels.go
- model_view.go
- provider_widget.go
- render_cache.go
- scrollbar.go
- settings_modal.go
- settings_modal_input.go
- settings_modal_layout.go
- settings_modal_preferences.go
- settings_modal_preview.go
- settings_modal_sections.go
- snapshot_meta.go
- styles.go
- themes.go
- tiles.go
- tiles_cache.go
- tiles_composition.go
- tiles_composition_clients.go
- tiles_composition_providers.go
- tiles_composition_tools.go
- tiles_gauge.go
- tiles_header.go
- tiles_metrics.go