feat: refactor TUI with read-only info view and optimized layout

- Add new 'i' command for read-only host information display
- Implement info view with option to switch to edit mode (e/Enter)
- Hide User and Port columns to optimize table space usage
- Improve table height calculation for better host visibility
- Add proper message handling for info view navigation
- Interface optimization
This commit is contained in:
2025-09-04 16:47:07 +02:00
parent 2ade315ddc
commit 1cea3795e4
8 changed files with 469 additions and 52 deletions

View File

@@ -61,8 +61,8 @@ func NewModel(hosts []config.SSHHost, configFile string) Model {
columns := []table.Column{
{Title: "Name", Width: nameWidth},
{Title: "Hostname", Width: 25},
{Title: "User", Width: 12},
{Title: "Port", Width: 6},
// {Title: "User", Width: 12}, // Commented to save space
// {Title: "Port", Width: 6}, // Commented to save space
{Title: "Tags", Width: tagsWidth},
{Title: "Last Login", Width: lastLoginWidth},
}
@@ -92,8 +92,8 @@ func NewModel(hosts []config.SSHHost, configFile string) Model {
rows = append(rows, table.Row{
host.Name,
host.Hostname,
host.User,
host.Port,
// host.User, // Commented to save space
// host.Port, // Commented to save space
tagsStr,
lastLoginStr,
})