ui

package
v0.0.0-...-249e08f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Title styles
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("12")).
				MarginBottom(1)

	SubtitleStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("8")).
					Italic(true)

	// Verdict styles
	VerdictCanRun = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("10")) // green

	VerdictDegraded = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("11")) // yellow

	VerdictCannotRun = lipgloss.NewStyle().
						Bold(true).
						Foreground(lipgloss.Color("9")) // red

	// Table styles
	HeaderStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("15")).
				Background(lipgloss.Color("8")).
				Padding(0, 1)

	CellStyle = lipgloss.NewStyle().
				Padding(0, 1)

	// Info labels
	LabelStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(lipgloss.Color("14")) // cyan

	ValueStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("15")) // white

	// Warning/Error
	WarningStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("11")) // yellow

	ErrorStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("9")) // red

	SuccessStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("10")) // green

	DimStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("8")) // dim gray

	// TUI tab styles
	TabActiveStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(lipgloss.Color("15")).
					Background(lipgloss.Color("12")).
					Padding(0, 2)

	TabInactiveStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("7")).
						Background(lipgloss.Color("0")).
						Padding(0, 2)

	StatusBarStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("7")).
					Background(lipgloss.Color("0")).
					Padding(0, 1).
					Width(80)
)

Functions

func Legend

func Legend() string

Legend renders the color legend.

func RenderCompatJSON

func RenderCompatJSON(results []models.CompatResult) []map[string]interface{}

RenderCompatJSON renders results as JSON-friendly output.

func RenderCompatTable

func RenderCompatTable(results []models.CompatResult) string

RenderCompatTable renders the compatibility results as a colored table.

func RenderHardwareInfo

func RenderHardwareInfo(info hardware.SystemInfo) string

RenderHardwareInfo renders the hardware detection results.

func RenderModelList

func RenderModelList(modelNames []string, descriptions []string) string

RenderModelList renders a list of models.

func RunTUI

func RunTUI(cfg config.Config) error

RunTUI starts the interactive TUI.

Types

type CompatTab

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

CompatTab holds state for the compatibility check tab.

func NewCompatTab

func NewCompatTab(overheadPercent, gpuMemFraction float64) CompatTab

func (*CompatTab) CycleQuant

func (t *CompatTab) CycleQuant()

func (*CompatTab) MoveDown

func (t *CompatTab) MoveDown()

func (*CompatTab) MoveUp

func (t *CompatTab) MoveUp()

func (*CompatTab) SetHardware

func (t *CompatTab) SetHardware(hw hardware.SystemInfo)

func (*CompatTab) SetRemoteModels

func (t *CompatTab) SetRemoteModels(remote []ollama.RemoteModel)

func (*CompatTab) SetSearchQuery

func (t *CompatTab) SetSearchQuery(q string)

func (*CompatTab) StartSearch

func (t *CompatTab) StartSearch()

func (*CompatTab) StopSearch

func (t *CompatTab) StopSearch()

func (CompatTab) View

func (t CompatTab) View(width, height int) string

type HardwareTab

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

HardwareTab holds state for the hardware detection tab.

func NewHardwareTab

func NewHardwareTab() HardwareTab

func (*HardwareTab) SetError

func (t *HardwareTab) SetError(err error)

func (*HardwareTab) SetHardware

func (t *HardwareTab) SetHardware(hw hardware.SystemInfo)

func (HardwareTab) View

func (t HardwareTab) View(width, height int) string

type ModelsTab

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

ModelsTab holds state for the models listing tab.

func NewModelsTab

func NewModelsTab(ollamaHost string) ModelsTab

func (*ModelsTab) MoveDown

func (t *ModelsTab) MoveDown()

func (*ModelsTab) MoveUp

func (t *ModelsTab) MoveUp()

func (*ModelsTab) SelectedModelName

func (t *ModelsTab) SelectedModelName() string

SelectedModelName returns the name of the currently selected model.

func (*ModelsTab) SetError

func (t *ModelsTab) SetError(err error)

func (*ModelsTab) SetLocal

func (t *ModelsTab) SetLocal(models []ollama.LocalModel)

func (*ModelsTab) SetRemote

func (t *ModelsTab) SetRemote(models []ollama.RemoteModel)

func (*ModelsTab) SetSearchQuery

func (t *ModelsTab) SetSearchQuery(q string)

func (*ModelsTab) StartSearch

func (t *ModelsTab) StartSearch()

func (*ModelsTab) StopSearch

func (t *ModelsTab) StopSearch()

func (*ModelsTab) ToggleLocal

func (t *ModelsTab) ToggleLocal()

func (ModelsTab) View

func (t ModelsTab) View(width, height int) string

type PullDoneMsg

type PullDoneMsg struct {
	Err error
}

PullDoneMsg signals the pull is complete.

type PullProgress

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

PullProgress tracks download progress for model pulling.

func NewPullProgress

func NewPullProgress() PullProgress

func (PullProgress) Init

func (m PullProgress) Init() tea.Cmd

func (PullProgress) Update

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

func (PullProgress) View

func (m PullProgress) View() string

type PullProgressMsg

type PullProgressMsg struct {
	Status    string
	Total     int64
	Completed int64
}

PullProgressMsg is sent to update the progress bar.

type PullTab

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

PullTab holds state for the pull/download tab.

func NewPullTab

func NewPullTab(overheadPercent, gpuMemFraction float64, ollamaHost string) PullTab

func (*PullTab) CheckCompat

func (t *PullTab) CheckCompat()

func (*PullTab) FinishPull

func (t *PullTab) FinishPull(err error)

func (*PullTab) Reset

func (t *PullTab) Reset()

func (*PullTab) SetHardware

func (t *PullTab) SetHardware(hw hardware.SystemInfo)

func (*PullTab) SetInput

func (t *PullTab) SetInput(s string)

func (*PullTab) StartPull

func (t *PullTab) StartPull()

func (*PullTab) UpdateProgress

func (t *PullTab) UpdateProgress(status string, total, completed int64)

func (PullTab) View

func (t PullTab) View(width, height int) string

type TUIModel

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

TUIModel is the top-level bubbletea model for the interactive TUI.

func NewTUIModel

func NewTUIModel(cfg config.Config) TUIModel

NewTUIModel creates a new TUI model with the given config.

func (TUIModel) Init

func (m TUIModel) Init() tea.Cmd

func (TUIModel) Update

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

func (TUIModel) View

func (m TUIModel) View() string

Jump to

Keyboard shortcuts

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