tui

package
v0.2.0-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CText   = lipgloss.AdaptiveColor{Light: "#1f2937", Dark: "#c0caf5"}
	CDim    = lipgloss.AdaptiveColor{Light: "#667085", Dark: "#7f849c"}
	CBorder = lipgloss.AdaptiveColor{Light: "#cbd5e1", Dark: "#3b4261"}

	CCyan   = lipgloss.AdaptiveColor{Light: "#0e7490", Dark: "#7dcfff"}
	CGreen  = lipgloss.AdaptiveColor{Light: "#15803d", Dark: "#9ece6a"}
	CYellow = lipgloss.AdaptiveColor{Light: "#a16207", Dark: "#e0af68"}
	CRed    = lipgloss.AdaptiveColor{Light: "#b42318", Dark: "#f7768e"}
	CPurple = lipgloss.AdaptiveColor{Light: "#7e22ce", Dark: "#bb9af7"}
	CBlue   = lipgloss.AdaptiveColor{Light: "#1d4ed8", Dark: "#7aa2f7"}
	COrange = lipgloss.AdaptiveColor{Light: "#c2410c", Dark: "#ff9e64"}
	CTeal   = lipgloss.AdaptiveColor{Light: "#0f766e", Dark: "#73daca"}

	// Upload / Download accent
	CUpload   = lipgloss.AdaptiveColor{Light: "#be185d", Dark: "#ff79c6"}
	CDownload = lipgloss.AdaptiveColor{Light: "#047857", Dark: "#00ff87"}

	// 4-tier threshold
	COk       = lipgloss.AdaptiveColor{Light: "#15803d", Dark: "#00ff87"}
	CWarn     = lipgloss.AdaptiveColor{Light: "#a16207", Dark: "#ffd700"}
	CAlert    = lipgloss.AdaptiveColor{Light: "#c2410c", Dark: "#ffaf5f"}
	CCritical = lipgloss.AdaptiveColor{Light: "#b42318", Dark: "#ff5555"}

	CMuted = lipgloss.AdaptiveColor{Light: "#6b7280", Dark: "#6c6c6c"}
	CInfo  = lipgloss.AdaptiveColor{Light: "#2563eb", Dark: "#5fafff"}

	// Row background alternating
	CRowA = lipgloss.AdaptiveColor{Light: "#f8fafc", Dark: "#1a1b26"}
	CRowB = lipgloss.AdaptiveColor{Light: "#eef2f7", Dark: "#1f2335"}
	CSel  = lipgloss.AdaptiveColor{Light: "#dbeafe", Dark: "#283457"}
)
View Source
var PanelIcons = map[string]string{
	"System":  "◈",
	"Traffic": "◆",
	"Rules":   "☰",
	"Detail":  "◉",
	"Help":    "?",
}

Functions

func Run

func Run(ctx context.Context, stdout io.Writer, addr, token string, httpClient *http.Client, headers http.Header) error

func ThresholdColor

func ThresholdColor(pct float64) lipgloss.TerminalColor

Types

type APIError added in v0.3.0

type APIError = controlapi.APIError

type ApplyResponse added in v0.3.0

type ApplyResponse = controlapi.ApplyResponse

type BotConfigRequest added in v0.3.0

type BotConfigRequest = controlapi.BotConfigRequest

type BotConfigResponse added in v0.3.0

type BotConfigResponse = controlapi.BotConfigResponse

type Client

type Client = controlapi.Client

func NewClient

func NewClient(baseURL string, token ...string) *Client

NewClient wraps controlapi.NewClient for the TUI's variadic token signature.

type ConfigRuleDiff added in v0.3.0

type ConfigRuleDiff = controlapi.ConfigRuleDiff

type ConfigRulesRequest added in v0.3.0

type ConfigRulesRequest = controlapi.ConfigRulesRequest

type ConfigRulesResponse added in v0.3.0

type ConfigRulesResponse = controlapi.ConfigRulesResponse

type Model

type Model struct {
	// contains filtered or unexported fields
}

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Model) View

func (m Model) View() string

type PrecheckResponse added in v0.3.0

type PrecheckResponse = controlapi.PrecheckResponse

type ReloadResponse

type ReloadResponse = controlapi.ReloadResponse

type RuleInfo

type RuleInfo = engine.Rule

RuleInfo is engine.Rule, kept for TUI-internal readability.

type RulesResponse

type RulesResponse = controlapi.RulesResponse

type SessionCapabilities added in v0.3.0

type SessionCapabilities = controlapi.SessionCapabilities

type SessionResponse added in v0.3.0

type SessionResponse = controlapi.SessionResponse

type StatsResponse

type StatsResponse = controlapi.StatsResponse

type TrafficSnapshot

type TrafficSnapshot = controlapi.TrafficSnapshot

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL