mirror of
https://github.com/Adembc/lazyssh.git
synced 2026-07-14 12:13:34 +02:00
remove help model
This commit is contained in:
@@ -72,9 +72,6 @@ func (t *tui) handleGlobalKeys(event *tcell.EventKey) *tcell.EventKey {
|
|||||||
case 't':
|
case 't':
|
||||||
t.handleTagsEdit()
|
t.handleTagsEdit()
|
||||||
return nil
|
return nil
|
||||||
case '?':
|
|
||||||
t.handleHelpShow()
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.Key() == tcell.KeyEnter {
|
if event.Key() == tcell.KeyEnter {
|
||||||
@@ -200,10 +197,6 @@ func (t *tui) handleFormCancel() {
|
|||||||
t.returnToMain()
|
t.returnToMain()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tui) handleHelpShow() {
|
|
||||||
t.showHelpModal()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *tui) handlePingSelected() {
|
func (t *tui) handlePingSelected() {
|
||||||
if server, ok := t.serverList.GetSelectedServer(); ok {
|
if server, ok := t.serverList.GetSelectedServer(); ok {
|
||||||
alias := server.Alias
|
alias := server.Alias
|
||||||
@@ -287,7 +280,17 @@ func (t *tui) showConnectModal(server domain.Server) {
|
|||||||
if buttonIndex == 0 {
|
if buttonIndex == 0 {
|
||||||
// Suspend the TUI while running the external ssh command.
|
// Suspend the TUI while running the external ssh command.
|
||||||
t.app.Suspend(func() {
|
t.app.Suspend(func() {
|
||||||
_ = t.serverService.SSH(server.Alias)
|
err := t.serverService.SSH(server.Alias)
|
||||||
|
if err != nil {
|
||||||
|
// Show a brief status after we resume
|
||||||
|
t.app.QueueUpdateDraw(func() {
|
||||||
|
if strings.Contains(strings.ToLower(err.Error()), "timeout") {
|
||||||
|
t.showStatusTempColor("SSH timeout, returning to list", "#FF6B6B")
|
||||||
|
} else {
|
||||||
|
t.showStatusTempColor("SSH failed: "+err.Error(), "#FF6B6B")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
// Refresh to reflect updated last seen and ssh count
|
// Refresh to reflect updated last seen and ssh count
|
||||||
t.refreshServerList()
|
t.refreshServerList()
|
||||||
@@ -350,34 +353,6 @@ func (t *tui) showEditTagsForm(server domain.Server) {
|
|||||||
t.app.SetFocus(form)
|
t.app.SetFocus(form)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *tui) showHelpModal() {
|
|
||||||
text := "Keyboard shortcuts:\n\n" +
|
|
||||||
" ↑/↓ Navigate\n" +
|
|
||||||
" Enter SSH connect \n" +
|
|
||||||
" c Copy SSH command \n" +
|
|
||||||
" g Ping server (TCP to SSH port)\n" +
|
|
||||||
" r Refresh list (background)\n" +
|
|
||||||
" a Add server \n" +
|
|
||||||
" e Edit server \n" +
|
|
||||||
" t Edit tags (quick)\n" +
|
|
||||||
" d Delete entry \n" +
|
|
||||||
" p Pin/Unpin server \n" +
|
|
||||||
" s Switch sort field (Alias ↔ Last SSH), keep direction\n" +
|
|
||||||
" Shift+S Toggle sort direction (↑/↓) for current field\n" +
|
|
||||||
" / Focus search\n" +
|
|
||||||
" q Quit\n" +
|
|
||||||
" ? Help\n"
|
|
||||||
|
|
||||||
modal := tview.NewModal().
|
|
||||||
SetText(text).
|
|
||||||
AddButtons([]string{"Close"}).
|
|
||||||
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
|
|
||||||
t.handleModalClose()
|
|
||||||
})
|
|
||||||
|
|
||||||
t.app.SetRoot(modal, true)
|
|
||||||
}
|
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
// UI State Management (hide UI elements)
|
// UI State Management (hide UI elements)
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ import (
|
|||||||
func NewHintBar() *tview.TextView {
|
func NewHintBar() *tview.TextView {
|
||||||
hint := tview.NewTextView().SetDynamicColors(true)
|
hint := tview.NewTextView().SetDynamicColors(true)
|
||||||
hint.SetBackgroundColor(tcell.Color233)
|
hint.SetBackgroundColor(tcell.Color233)
|
||||||
hint.SetText("[#BBBBBB]Press [::b]/[-:-:b] to search… • ↑↓ Navigate • Enter SSH • c Copy SSH • g Ping • r Refresh • a Add • e Edit • t Tags • d Delete • p Pin/Unpin • s Sort • ? Help[-]")
|
hint.SetText("[#BBBBBB]Press [::b]/[-:-:b] to search… • ↑↓ Navigate • Enter SSH • c Copy SSH • g Ping • r Refresh • a Add • e Edit • t Tags • d Delete • p Pin/Unpin • s Sort[-]")
|
||||||
return hint
|
return hint
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func DefaultStatusText() string {
|
func DefaultStatusText() string {
|
||||||
return "[white]↑↓[-] Navigate • [white]Enter[-] SSH • [white]c[-] Copy SSH • [white]a[-] Add • [white]e[-] Edit • [white]g[-] Ping • [white]d[-] Delete • [white]p[-] Pin/Unpin • [white]/[-] Search • [white]q[-] Quit • [white]?[-] Help"
|
return "[white]↑↓[-] Navigate • [white]Enter[-] SSH • [white]c[-] Copy SSH • [white]a[-] Add • [white]e[-] Edit • [white]g[-] Ping • [white]d[-] Delete • [white]p[-] Pin/Unpin • [white]/[-] Search • [white]q[-] Quit"
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStatusBar() *tview.TextView {
|
func NewStatusBar() *tview.TextView {
|
||||||
|
|||||||
Reference in New Issue
Block a user