feat: add port forwarding support

This commit is contained in:
2025-09-04 10:34:54 +02:00
parent 21c5d41977
commit 2deec405f7
6 changed files with 690 additions and 8 deletions

View File

@@ -35,8 +35,31 @@ const (
ViewList ViewMode = iota
ViewAdd
ViewEdit
ViewPortForward
)
// PortForwardType defines the type of port forwarding
type PortForwardType int
const (
LocalForward PortForwardType = iota
RemoteForward
DynamicForward
)
func (p PortForwardType) String() string {
switch p {
case LocalForward:
return "Local (-L)"
case RemoteForward:
return "Remote (-R)"
case DynamicForward:
return "Dynamic (-D)"
default:
return "Local (-L)"
}
}
// Model represents the state of the user interface
type Model struct {
table table.Model
@@ -51,9 +74,10 @@ type Model struct {
configFile string // Path to the SSH config file
// View management
viewMode ViewMode
addForm *addFormModel
editForm *editFormModel
viewMode ViewMode
addForm *addFormModel
editForm *editFormModel
portForwardForm *portForwardModel
// Terminal size and styles
width int