tui

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config) error

Run starts the TUI application

Types

type CPUStatus

type CPUStatus struct {
	UsagePercent float64 `json:"usage_percent"`
}

type Config

type Config struct {
	ServerURL       string
	RefreshInterval time.Duration
	User            string
	Password        string
}

Config holds TUI configuration

type DiskStatus

type DiskStatus struct {
	TotalBytes uint64  `json:"total_bytes"`
	FreeBytes  uint64  `json:"free_bytes"`
	UsedBytes  uint64  `json:"used_bytes"`
	UsedPct    float64 `json:"used_percent"`
}

type GPUStatus

type GPUStatus struct {
	Index          int     `json:"index"`
	Name           string  `json:"name"`
	UsagePercent   float64 `json:"usage_percent"`
	VRAMTotalBytes uint64  `json:"vram_total_bytes"`
	VRAMUsedBytes  uint64  `json:"vram_used_bytes"`
}

type MemoryStatus

type MemoryStatus struct {
	UsagePercent float64 `json:"usage_percent"`
	TotalBytes   uint64  `json:"total_bytes"`
	UsedBytes    uint64  `json:"used_bytes"`
}

type Model

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

Model represents the TUI state

func NewModel

func NewModel(cfg Config) Model

NewModel creates a new TUI model

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) Update

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

Update handles messages

func (Model) View

func (m Model) View() string

View renders the TUI

type ProcessStatus

type ProcessStatus struct {
	TotalProcesses int `json:"total_processes"`
	TotalThreads   int `json:"total_threads"`
}

type StatsData

type StatsData struct {
	Tasks      map[string]*TaskStats `json:"tasks"`
	TotalTasks int64                 `json:"total_tasks"`
}

StatsData represents task statistics from /stats endpoint

type StatusData

type StatusData struct {
	CPU     CPUStatus     `json:"cpu"`
	Memory  MemoryStatus  `json:"memory"`
	GPUs    []GPUStatus   `json:"gpus"`
	Storage StorageStatus `json:"storage"`
	Process ProcessStatus `json:"process"`
}

StatusData represents system status from /status endpoint

type StorageStatus

type StorageStatus map[string]DiskStatus

type TaskStats

type TaskStats struct {
	Task         string  `json:"task"`
	Count        int64   `json:"count"`
	AvgCPUDelta  float64 `json:"avg_cpu_delta"`
	AvgMemDelta  float64 `json:"avg_mem_delta"`
	AvgGPUDelta  float64 `json:"avg_gpu_delta,omitempty"`
	AvgVRAMDelta float64 `json:"avg_vram_delta,omitempty"`
}

Jump to

Keyboard shortcuts

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