Documentation
¶
Index ¶
- func CreateSSHMenuActions(selectedDevices []string, parent fyne.Window, app fyne.App) []*fyne.MenuItem
- func OpenMultipleTabbedTerminals(connections []*SSHConnection) error
- func OpenMultipleTerminals(connections []*SSHConnection) error
- func ProbeSSHAuthMethods(host string, port int) ([]string, error)
- func ShowCredentialsDialog(parent fyne.Window, callback func(SSHCredentials, bool))
- func TestConnection(host string, port int, timeout time.Duration) error
- type ConnectionConfig
- type ConnectionProgress
- type ConnectionResult
- type SSHConnection
- func (conn *SSHConnection) Close() error
- func (conn *SSHConnection) Connect() error
- func (conn *SSHConnection) ConnectWithAllMethods() error
- func (conn *SSHConnection) CreateSession() (*ssh.Session, error)
- func (conn *SSHConnection) IsConnected() bool
- func (conn *SSHConnection) RunCommand(command string) (string, error)
- type SSHCredentials
- type SSHManager
- type SSHMultiTerminal
- func (smt *SSHMultiTerminal) Close() error
- func (smt *SSHMultiTerminal) CreateStandaloneWindow(title string) (fyne.Window, fyne.App)
- func (smt *SSHMultiTerminal) GetConnectedHosts() []string
- func (smt *SSHMultiTerminal) GetSessionCount() int
- func (smt *SSHMultiTerminal) GetWidget() *terminal.Terminal
- type SSHMultiTerminalState
- type TerminalManager
- func (tm *TerminalManager) CloseAllTerminals() error
- func (tm *TerminalManager) CloseTerminal(host string) error
- func (tm *TerminalManager) CreateMultiTerminalWidget(connections []*SSHConnection) (*terminal.Terminal, *SSHMultiTerminal, error)
- func (tm *TerminalManager) CreateMultiTerminalWindow(connections []*SSHConnection, title string) error
- func (tm *TerminalManager) CreateTerminalWidget(conn *SSHConnection, title string) (*TerminalWidget, error)
- func (tm *TerminalManager) GetTerminal(host string) (*TerminalWidget, bool)
- func (tm *TerminalManager) ListTerminals() []string
- func (tm *TerminalManager) MultiTerminalWindow(connections []*SSHConnection, title string) error
- func (tm *TerminalManager) NewSSHMultiTerminal(connections []*SSHConnection) (*SSHMultiTerminal, error)
- type TerminalWidget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateSSHMenuActions ¶
func CreateSSHMenuActions(selectedDevices []string, parent fyne.Window, app fyne.App) []*fyne.MenuItem
CreateSSHMenuActions creates menu actions for the devices table
func OpenMultipleTabbedTerminals ¶
func OpenMultipleTabbedTerminals(connections []*SSHConnection) error
OpenMultipleTabbedTerminals opens multiple terminals in a tabbed interface
func OpenMultipleTerminals ¶
func OpenMultipleTerminals(connections []*SSHConnection) error
OpenMultipleTerminals opens a single multi-device terminal for SSH connections
func ProbeSSHAuthMethods ¶
ProbeSSHAuthMethods tests what authentication methods are supported by an SSH server
func ShowCredentialsDialog ¶
func ShowCredentialsDialog(parent fyne.Window, callback func(SSHCredentials, bool))
ShowCredentialsDialog displays a dialog to collect SSH credentials
Types ¶
type ConnectionConfig ¶
type ConnectionConfig struct {
Host string
Port int
Username string
Password string
Timeout time.Duration
PrivateKey []byte // Optional: SSH private key for key-based auth
}
ConnectionConfig holds SSH connection configuration
func NewConnectionConfig ¶
func NewConnectionConfig(host string, port int, username, password string) ConnectionConfig
NewConnectionConfig creates a new connection configuration
func NewConnectionConfigForMikroTik ¶
func NewConnectionConfigForMikroTik(host, username, password string) ConnectionConfig
NewConnectionConfigForMikroTik creates a connection config optimized for MikroTik devices
func NewConnectionConfigWithKey ¶
func NewConnectionConfigWithKey(host, username string, privateKey []byte) ConnectionConfig
NewConnectionConfigWithKey creates a connection config with SSH key authentication
type ConnectionProgress ¶
type ConnectionProgress struct {
Total int
Connected int
Failed int
Progress *widget.ProgressBar
Status *widget.Label
}
ConnectionProgress represents the progress of connecting to multiple devices
func ShowConnectionProgress ¶
func ShowConnectionProgress(parent fyne.Window, deviceCount int) *ConnectionProgress
ShowConnectionProgress displays a progress dialog for connecting to multiple devices
func (*ConnectionProgress) UpdateProgress ¶
func (cp *ConnectionProgress) UpdateProgress(connected, failed int, currentHost string)
UpdateProgress updates the connection progress
type ConnectionResult ¶
type ConnectionResult struct {
Host string
Connection *SSHConnection
Error error
}
ConnectionResult holds the result of a connection attempt
type SSHConnection ¶
type SSHConnection struct {
Config ConnectionConfig
Client *ssh.Client
Session *ssh.Session
Connected bool
Error error
// contains filtered or unexported fields
}
SSHConnection represents an active SSH connection
func ConnectToMultipleDevices ¶
func ConnectToMultipleDevices(devices []string, credentials SSHCredentials, parent fyne.Window) ([]*SSHConnection, error)
ConnectToMultipleDevices connects to multiple devices and shows progress
func NewSSHConnection ¶
func NewSSHConnection(config ConnectionConfig) *SSHConnection
NewSSHConnection creates a new SSH connection with the given configuration
func (*SSHConnection) Close ¶
func (conn *SSHConnection) Close() error
Close closes the SSH connection
func (*SSHConnection) Connect ¶
func (conn *SSHConnection) Connect() error
Connect establishes an SSH connection using enhanced authentication
func (*SSHConnection) ConnectWithAllMethods ¶
func (conn *SSHConnection) ConnectWithAllMethods() error
ConnectWithAllMethods attempts connection with multiple authentication methods
func (*SSHConnection) CreateSession ¶
func (conn *SSHConnection) CreateSession() (*ssh.Session, error)
CreateSession creates a new SSH session
func (*SSHConnection) IsConnected ¶
func (conn *SSHConnection) IsConnected() bool
IsConnected returns whether the connection is active
func (*SSHConnection) RunCommand ¶
func (conn *SSHConnection) RunCommand(command string) (string, error)
RunCommand runs a command on the remote server and returns its output
type SSHCredentials ¶
SSHCredentials holds the SSH login credentials
type SSHManager ¶
type SSHManager struct {
// contains filtered or unexported fields
}
SSHManager manages multiple SSH connections
func (*SSHManager) CloseAll ¶
func (manager *SSHManager) CloseAll() error
CloseAll closes all managed connections
func (*SSHManager) ConnectMultiple ¶
func (manager *SSHManager) ConnectMultiple(configs []ConnectionConfig) <-chan ConnectionResult
ConnectMultiple connects to multiple hosts in parallel
func (*SSHManager) GetConnection ¶
func (manager *SSHManager) GetConnection(host string) (*SSHConnection, bool)
GetConnection returns a connection by host
func (*SSHManager) ListConnections ¶
func (manager *SSHManager) ListConnections() []string
ListConnections returns a list of connected hosts
type SSHMultiTerminal ¶
type SSHMultiTerminal struct {
// contains filtered or unexported fields
}
SSHMultiTerminal represents a single terminal widget handling multiple SSH sessions
func (*SSHMultiTerminal) Close ¶
func (smt *SSHMultiTerminal) Close() error
Close closes all SSH sessions and the terminal
func (*SSHMultiTerminal) CreateStandaloneWindow ¶
CreateStandaloneWindow creates a standalone window containing the multi-terminal widget
func (*SSHMultiTerminal) GetConnectedHosts ¶
func (smt *SSHMultiTerminal) GetConnectedHosts() []string
GetConnectedHosts returns a list of connected host names
func (*SSHMultiTerminal) GetSessionCount ¶
func (smt *SSHMultiTerminal) GetSessionCount() int
GetSessionCount returns the number of active SSH sessions
func (*SSHMultiTerminal) GetWidget ¶
func (smt *SSHMultiTerminal) GetWidget() *terminal.Terminal
GetWidget returns the terminal widget that can be embedded in any container
type SSHMultiTerminalState ¶
type SSHMultiTerminalState struct {
// contains filtered or unexported fields
}
SSHMultiTerminalState manages shared state for a multi-terminal session.
type TerminalManager ¶
type TerminalManager struct {
// contains filtered or unexported fields
}
TerminalManager manages multiple terminal widgets
func NewTerminalManager ¶
func NewTerminalManager() *TerminalManager
NewTerminalManager creates a new terminal manager
func (*TerminalManager) CloseAllTerminals ¶
func (tm *TerminalManager) CloseAllTerminals() error
CloseAllTerminals closes all managed terminals
func (*TerminalManager) CloseTerminal ¶
func (tm *TerminalManager) CloseTerminal(host string) error
CloseTerminal closes a specific terminal
func (*TerminalManager) CreateMultiTerminalWidget ¶
func (tm *TerminalManager) CreateMultiTerminalWidget(connections []*SSHConnection) (*terminal.Terminal, *SSHMultiTerminal, error)
CreateMultiTerminalWidget creates a multi-terminal widget that can be embedded in any container
func (*TerminalManager) CreateMultiTerminalWindow ¶
func (tm *TerminalManager) CreateMultiTerminalWindow(connections []*SSHConnection, title string) error
CreateMultiTerminalWindow creates a standalone window with multiple SSH terminals (legacy compatibility)
func (*TerminalManager) CreateTerminalWidget ¶
func (tm *TerminalManager) CreateTerminalWidget(conn *SSHConnection, title string) (*TerminalWidget, error)
CreateTerminalWidget creates a new terminal widget for an SSH connection
func (*TerminalManager) GetTerminal ¶
func (tm *TerminalManager) GetTerminal(host string) (*TerminalWidget, bool)
GetTerminal returns a terminal widget by host
func (*TerminalManager) ListTerminals ¶
func (tm *TerminalManager) ListTerminals() []string
ListTerminals returns a list of active terminal hosts
func (*TerminalManager) MultiTerminalWindow ¶
func (tm *TerminalManager) MultiTerminalWindow(connections []*SSHConnection, title string) error
MultiTerminalWindow creates a window with multiple terminals in tabs
func (*TerminalManager) NewSSHMultiTerminal ¶
func (tm *TerminalManager) NewSSHMultiTerminal(connections []*SSHConnection) (*SSHMultiTerminal, error)
NewSSHMultiTerminal creates a single terminal widget that handles multiple SSH sessions
type TerminalWidget ¶
type TerminalWidget struct {
Connection *SSHConnection
Session *ssh.Session
Terminal *terminal.Terminal
Window fyne.Window
App fyne.App
StdinPipe io.WriteCloser
StdoutPipe io.Reader
// contains filtered or unexported fields
}
TerminalWidget represents a terminal connected to an SSH session
func (*TerminalWidget) Close ¶
func (tw *TerminalWidget) Close() error
Close closes the terminal widget and SSH session
func (*TerminalWidget) ShowTerminal ¶
func (tw *TerminalWidget) ShowTerminal()
ShowTerminal displays the terminal window
func (*TerminalWidget) ShowTerminalWindow ¶
func (tw *TerminalWidget) ShowTerminalWindow()
ShowTerminalWindow displays the terminal window without running (for multiple terminals)