hosts

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package hosts provides the hosts list component displaying Zabbix hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	*listview.State
	// contains filtered or unexported fields
}

Model represents the hosts list component.

func New

func New(styles *theme.Styles) Model

New creates a new hosts list model.

func (Model) FilteredCount

func (m Model) FilteredCount() int

FilteredCount returns the number of filtered items.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model.

func (Model) ItemCount added in v0.7.0

func (m Model) ItemCount() (total, filtered int)

ItemCount returns the total and filtered host counts.

func (Model) Selected

func (m Model) Selected() *zabbix.Host

Selected returns the currently selected host. Returns a pointer to the element in the filtered slice. The pointer remains valid until the next call to SetHosts or filter changes. Callers should not store this pointer long-term.

func (Model) SelectedIndex

func (m Model) SelectedIndex() int

SelectedIndex returns the index of the selected host in the original list.

func (*Model) SetHosts

func (m *Model) SetHosts(hosts []zabbix.Host)

SetHosts updates the hosts list.

func (*Model) SetStyles added in v0.5.0

func (m *Model) SetStyles(styles *theme.Styles)

SetStyles updates the component's styles (for runtime theme changes).

func (*Model) SetTextFilter

func (m *Model) SetTextFilter(filter string)

SetTextFilter sets the text filter.

func (Model) Update

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

Update implements tea.Model.

func (Model) View

func (m Model) View() string

View implements tea.Model.

Jump to

Keyboard shortcuts

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