ui

package
v0.0.0-...-b82ce1f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitRows

func InitRows(m *DownloadsModel, tableWidth int) ([]table.Row, [][]string)

Types

type BoxResolution

type BoxResolution [2]int

type ColumnKeyWidthPair

type ColumnKeyWidthPair struct {
	Key      string
	Width    int
	Flexible bool
}

type DownloadsModel

type DownloadsModel struct {
	Height int
	Width  int

	// Core
	LogFunction         *func(string)
	LogsContentRef      *[][2]string
	ResourceList        *core.ResourceList
	NavigateToCtrlPanel func()
	NavigateToGuide     func(guides.Guide)

	// UI
	// 0-Downloads(topRight)
	// 1-Resources(left)
	// 2-Console(bottomRight)
	CurrentWindow  *util.StateHandler[int]
	ResourceTree   tree.Model
	InspectModel   submodels.InspectModel
	DownloadsTable table.Model
	ConsoleModel   submodels.ConsoleModel

	HelpSet []HelpSet
}

func (DownloadsModel) GetPanelDimensions

func (m DownloadsModel) GetPanelDimensions() (int, int, int, int)

func (DownloadsModel) Init

func (m DownloadsModel) Init() tea.Cmd

func (DownloadsModel) Update

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

func (DownloadsModel) View

func (m DownloadsModel) View() string

type HelpSet

type HelpSet [][2]string

func InitDownloadsHelpSet

func InitDownloadsHelpSet() []HelpSet

func InitHomeHelpSet

func InitHomeHelpSet() []HelpSet

func InitMainHelpSet

func InitMainHelpSet() HelpSet

func (HelpSet) View

func (hSet HelpSet) View(seperator string) (s string)

type HomeModel

type HomeModel struct {
	Height int
	Width  int

	CurrentWindow *util.StateHandler[int]
	TextViewer    submodels.TextViewerModel
	GuideTree     submodels.GuideTreeModel
	StatusModel   submodels.StatusModel
	HelpSet       []HelpSet // Will be used by parent model to render help
}

func (HomeModel) GetPanelDimensions

func (m HomeModel) GetPanelDimensions() (int, int, int, int, int)

func (HomeModel) Init

func (m HomeModel) Init() tea.Cmd

func (HomeModel) Update

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

func (HomeModel) View

func (m HomeModel) View() string

type MainModel

type MainModel struct {
	Application  *core.Application
	ResourceList *core.ResourceList

	CurrentState *util.StateHandler[string]
	Downloads    DownloadsModel
	NewResource  NewResourceModel
	Home         HomeModel
	HelpSet      HelpSet
	// contains filtered or unexported fields
}

func InitialTeaModel

func InitialTeaModel(Application *core.Application) MainModel

func (MainModel) Init

func (m MainModel) Init() tea.Cmd

func (*MainModel) NavigateToCtrlPanel

func (m *MainModel) NavigateToCtrlPanel()

func (*MainModel) NavigateToGuide

func (m *MainModel) NavigateToGuide(guide guides.Guide)

func (MainModel) Update

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

func (MainModel) View

func (m MainModel) View() string

type NewResourceModel

type NewResourceModel struct {
	Height int
	Width  int

	HelpSet HelpSet // Will be used by parent model to render help
}

func (NewResourceModel) Init

func (m NewResourceModel) Init() tea.Cmd

func (NewResourceModel) Update

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

func (NewResourceModel) View

func (m NewResourceModel) View() string

type ResizeMsgL1

type ResizeMsgL1 struct {
	Width  int
	Height int
}

type RowsMsg

type RowsMsg []table.Row

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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