package tea

import "github.com/Kajmany/rapidrule/src/tea"

Index

Types

type Model

type Model struct {
	Width       int
	Height      int
	StatusData  table.Model
	Mode        inputMode
	Ports       []structs.Port
	Alerts      []structs.Alert
	AIsummary   string
	Strats      []structs.Strat
	StratCursor int
	// Track whether a strategy has been applied
	AppliedStrats map[int]bool
	// Error message when strategy application fails
	StrategyApplyError string
}

Model represents the application state

func NewModel

func NewModel(t table.Model) Model

NewModel creates a new model with the given table

func (*Model) ApplyAllStagedStrategies

func (m *Model) ApplyAllStagedStrategies() bool

ApplyAllStagedStrategies applies all the strategies that have been staged This is a placeholder for the backend team to implement

func (*Model) ApplyStrategy

func (m *Model) ApplyStrategy(stratIndex int) bool

ApplyStrategy is a placeholder function for applying a strategy Backend team can hook into this function to implement actual rule application

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) Update

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

Update handles events and updates the model

func (Model) View

func (m Model) View() string

View renders the UI

Directories

styles