33 lines
658 B
Go
33 lines
658 B
Go
package ui
|
|
|
|
import (
|
|
"git.zervo.org/zervo/bytesock/internal/types"
|
|
tea "github.com/charmbracelet/bubbletea"
|
|
)
|
|
|
|
type model struct {
|
|
input string
|
|
inputMode types.InputMode
|
|
logs []string
|
|
width int
|
|
height int
|
|
omode types.MessageMode
|
|
imode types.MessageMode
|
|
conn types.ConnType
|
|
address string
|
|
}
|
|
|
|
func initialModel() model {
|
|
return model{
|
|
input: "",
|
|
logs: []string{msgInfoStyle.Render("Welcome to ByteSock! Use Ctrl+H for help.")},
|
|
omode: types.MODE_HEX_BINARY,
|
|
imode: types.MODE_HEX_BINARY,
|
|
conn: types.CONN_WS,
|
|
address: "ws://localhost:8080",
|
|
}
|
|
}
|
|
|
|
func (m model) Init() tea.Cmd {
|
|
return nil
|
|
}
|