admin

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminView added in v1.5.0

type AdminView int
const (
	MenuView AdminView = iota
	UsersView
	InfoBoxesView
	ServerMessageView
	TermsAndConditionsView
	BansView
)

type Model

type Model struct {
	AdminId      uuid.UUID
	CurrentView  AdminView
	MenuSelected int // Which menu item is selected

	// User management
	Users    []domain.Account
	Selected int
	Offset   int

	// Info boxes management
	InfoBoxes     []domain.InfoBox
	BoxSelected   int
	BoxOffset     int
	Editing       bool
	EditBox       *domain.InfoBox
	EditField     int            // 0=Title, 1=Content, 2=Order
	TitleInput    textarea.Model // Textarea for title
	ContentInput  textarea.Model // Textarea for content
	OrderInput    textarea.Model // Textarea for order number
	ConfirmDelete bool           // True when confirming deletion
	DeleteBoxId   uuid.UUID      // ID of box to delete

	// Server message management
	ServerMessage    *domain.ServerMessage
	EditingServerMsg bool
	ServerMsgInput   textarea.Model // Textarea for server message

	// Terms and Conditions management
	TermsAndConditions *domain.TermsAndConditions
	EditingTerms       bool
	TermsInput         textarea.Model // Textarea for terms and conditions

	// Ban management
	Bans        []domain.Ban
	BanSelected int
	BanOffset   int

	Width  int
	Height int
	Status string
	Error  string
}

func InitialModel

func InitialModel(adminId uuid.UUID, width, height int) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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