popup

package
v0.99.4 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package popup holds cdnscli UI elements for editing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CancelMsg

type CancelMsg struct{}

CancelMsg is a tea.Msg signaling that editing was canceled.

type ConfirmDeleteMsg

type ConfirmDeleteMsg struct{}

ConfirmDeleteMsg is a tea.Msg signaling that deletion was confirmed.

type Model

type Model struct {
	ColumnNames []string               // Названия столбцов
	Fields      []string               // Поля для редактирования
	Cursor      int                    // Текущий индекс поля
	CharPos     int                    // Позиция курсора в текущем поле
	IsActive    bool                   // Активно ли окно
	Title       string                 // Заголовок окна
	SaveAction  func([]string) tea.Msg // Действие при сохранении
	CancelMsg   tea.Msg                // Сообщение при отмене

	// Mode-specific state: NameServers list editor
	Mode       string   // "default" | "nslist" | "confirm"
	ListValues []string // values for list mode
	ListCursor int      // cursor for list mode
	// Confirm dialog state
	ConfirmIndex int // 0 => Yes, 1 => No
	// contains filtered or unexported fields
}

Model implements tea.Model and represents the popup editor state.

func New

func New(columnNames []string, fields []string, title string, saveAction func([]string) tea.Msg, cancelMsg tea.Msg) *Model

New constructs a popup editor Model.

func NewConfirmDialog

func NewConfirmDialog(title string) *Model

NewConfirmDialog constructs popup Model in confirmation mode.

func NewNameServersEditor

func NewNameServersEditor(initial []string, title string) *Model

NewNameServersEditor constructs popup Model in list-edit mode for NS values.

func (*Model) Init

func (m *Model) Init() tea.Cmd

Init implements tea.Model.

func (*Model) Update

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

Update implements tea.Model.

func (*Model) View

func (m *Model) View() string

View implements tea.Model.

type SaveActionMsg

type SaveActionMsg struct {
	Fields []string // Поля, которые были отредактированы
}

SaveActionMsg is a tea.Msg signaling that edited fields should be saved.

type SaveNameServersMsg

type SaveNameServersMsg struct {
	Servers []string
}

SaveNameServersMsg is a tea.Msg signaling that NS list should be saved.

Jump to

Keyboard shortcuts

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