ui

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HelpView

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

HelpView represents the help bar at the bottom of the UI

func NewHelpView

func NewHelpView() *HelpView

NewHelpView creates a new help view

func (*HelpView) Clear

func (h *HelpView) Clear()

Clear clears the help text

func (*HelpView) SetText

func (h *HelpView) SetText(text string)

SetText sets the help text

func (*HelpView) Update

func (h *HelpView) Update(context string)

Update updates the help text based on context

type InstancesView

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

InstancesView represents the instances table view

func NewInstancesView

func NewInstancesView(ui *UI) *InstancesView

NewInstancesView creates a new instances view

func (*InstancesView) GetSelectedInstance

func (v *InstancesView) GetSelectedInstance() *model.Instance

GetSelectedInstance returns the currently selected instance

func (*InstancesView) ShowInstanceDetails

func (v *InstancesView) ShowInstanceDetails(instance model.Instance)

ShowInstanceDetails displays a detailed view of an instance

func (*InstancesView) UpdateInstances

func (v *InstancesView) UpdateInstances(instances []model.Instance)

UpdateInstances updates the instances table with new data

type OverviewPanel

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

OverviewPanel represents the overview panel at the top of the UI

func NewOverviewPanel

func NewOverviewPanel(ui *UI) *OverviewPanel

NewOverviewPanel creates a new overview panel

func (*OverviewPanel) Update

func (p *OverviewPanel) Update(total, running, stopped int, region string)

Update updates the overview panel content

func (*OverviewPanel) UpdateRegion

func (p *OverviewPanel) UpdateRegion(region string)

UpdateRegion updates just the region information

func (*OverviewPanel) UpdateStats

func (p *OverviewPanel) UpdateStats(total, running, stopped int)

UpdateStats updates just the instance statistics

func (*OverviewPanel) UpdateTheme

func (p *OverviewPanel) UpdateTheme()

UpdateTheme updates the theme colors

type StatusBar

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

StatusBar represents the status bar at the bottom of the UI

func NewStatusBar

func NewStatusBar(ui *UI) *StatusBar

NewStatusBar creates a new status bar

func (*StatusBar) Clear

func (b *StatusBar) Clear()

Clear clears the status message

func (*StatusBar) SetError

func (b *StatusBar) SetError(err string)

SetError sets an error message in the status bar

func (*StatusBar) SetMode

func (b *StatusBar) SetMode(mode string)

SetMode sets the current UI mode

func (*StatusBar) SetRegion

func (b *StatusBar) SetRegion(region string)

SetRegion sets the current region

func (*StatusBar) SetStatus

func (b *StatusBar) SetStatus(status string)

SetStatus sets the status message

func (*StatusBar) UpdateTheme

func (b *StatusBar) UpdateTheme()

UpdateTheme updates the status bar theme

type UI

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

UI manages the terminal UI for e2c

func NewUI

func NewUI(log *slog.Logger, ec2Client *aws.EC2Client, cfg *config.Config) *UI

NewUI creates a new UI instance

func (*UI) GetColors

func (ui *UI) GetColors() color.Colors

GetColors returns the application colors

func (*UI) RefreshInstances

func (ui *UI) RefreshInstances()

RefreshInstances refreshes the instances list

func (*UI) SetFilter

func (ui *UI) SetFilter(filter string)

SetFilter sets the instance filter

func (*UI) ShowConfirmDialog

func (ui *UI) ShowConfirmDialog(title, message string, onConfirm func())

ShowConfirmDialog shows a confirmation dialog

func (*UI) ShowFilterDialog

func (ui *UI) ShowFilterDialog()

ShowFilterDialog displays the filter dialog

func (*UI) ShowHelpDialog

func (ui *UI) ShowHelpDialog()

func (*UI) ShowInfoDialog

func (ui *UI) ShowInfoDialog(title, message string)

ShowInfoDialog shows an information dialog

func (*UI) Start

func (ui *UI) Start() error

Start starts the UI

func (*UI) Stop

func (ui *UI) Stop()

Stop stops the UI

Jump to

Keyboard shortcuts

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