update:hide ip info
This commit is contained in:
@@ -117,12 +117,6 @@ var (
|
|||||||
serverRowNameActiveStyle = lipgloss.NewStyle().
|
serverRowNameActiveStyle = lipgloss.NewStyle().
|
||||||
Bold(true).
|
Bold(true).
|
||||||
Foreground(lipgloss.Color("75"))
|
Foreground(lipgloss.Color("75"))
|
||||||
|
|
||||||
serverRowDetailStyle = lipgloss.NewStyle().
|
|
||||||
Foreground(lipgloss.Color("243"))
|
|
||||||
|
|
||||||
serverRowDetailActiveStyle = lipgloss.NewStyle().
|
|
||||||
Foreground(lipgloss.Color("117"))
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func MenuItemStyle(active, disabled bool) lipgloss.Style {
|
func MenuItemStyle(active, disabled bool) lipgloss.Style {
|
||||||
@@ -156,22 +150,10 @@ func ButtonStyle(focused, enabled bool) lipgloss.Style {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerRowStyle renders a two-line server list entry: bold name on top,
|
// ServerRowStyle renders a single-line server list entry showing only the server name.
|
||||||
// dim "user@host[:port]" detail below.
|
func ServerRowStyle(active bool, name string) string {
|
||||||
func ServerRowStyle(active bool, name, detail string) string {
|
|
||||||
nameStyle := serverRowNameStyle
|
|
||||||
detailStyle := serverRowDetailStyle
|
|
||||||
base := serverRowBase
|
|
||||||
prefix := " "
|
|
||||||
if active {
|
if active {
|
||||||
nameStyle = serverRowNameActiveStyle
|
return serverRowBaseActive.Render(serverRowNameActiveStyle.Render("▸ " + name))
|
||||||
detailStyle = serverRowDetailActiveStyle
|
|
||||||
base = serverRowBaseActive
|
|
||||||
prefix = "▸ "
|
|
||||||
}
|
}
|
||||||
row := lipgloss.JoinVertical(lipgloss.Left,
|
return serverRowBase.Render(serverRowNameStyle.Render(" " + name))
|
||||||
nameStyle.Render(prefix+name),
|
|
||||||
detailStyle.Render(" "+detail),
|
|
||||||
)
|
|
||||||
return base.Render(row)
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,16 +137,12 @@ func (m TUIInterface) viewSelectServer() string {
|
|||||||
|
|
||||||
var rows []string
|
var rows []string
|
||||||
for i, name := range m.ServerNames {
|
for i, name := range m.ServerNames {
|
||||||
srv := m.Servers[name]
|
rows = append(rows, styles.ServerRowStyle(i == m.Selected, name))
|
||||||
detail := srv.User + "@" + srv.Host
|
|
||||||
if srv.Port != "" {
|
|
||||||
detail += ":" + srv.Port
|
|
||||||
}
|
|
||||||
row := styles.ServerRowStyle(i == m.Selected, name, detail)
|
|
||||||
rows = append(rows, row)
|
|
||||||
}
|
}
|
||||||
return lipgloss.JoinVertical(lipgloss.Left, rows...)
|
return lipgloss.JoinVertical(lipgloss.Left, rows...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m TUIInterface) viewAddServer() string {
|
||||||
f := m.Form
|
f := m.Form
|
||||||
labels := []string{"Name", "Host", "User", "Private Key Path", "Port"}
|
labels := []string{"Name", "Host", "User", "Private Key Path", "Port"}
|
||||||
required := []bool{true, true, true, true, false}
|
required := []bool{true, true, true, true, false}
|
||||||
|
|||||||
Reference in New Issue
Block a user