- Added internal/vault/client.go for creating a Vault client with configuration settings. - Introduced internal/vault/errors.go to classify Vault API errors for better UI handling. - Created internal/vault/kv.go to manage KV secrets, including listing, reading, writing, and deleting operations. - Implemented internal/vault/mounts.go to list and describe secret engine mounts. - Developed internal/vault/service.go to provide a unified entry point for Vault operations. - Added internal/vault/kv_test.go for comprehensive testing of KV operations. - Introduced internal/ui/toast.go for transient notifications in the UI. - Added renovate.json for dependency management and updates.
28 lines
680 B
Go
28 lines
680 B
Go
package ui
|
|
|
|
import (
|
|
tea "charm.land/bubbletea/v2"
|
|
"charm.land/lipgloss/v2"
|
|
)
|
|
|
|
// updateHelp handles the "?" full-keybinding overlay — any key closes it,
|
|
// since it's purely informational.
|
|
func (m *Model) updateHelp(msg tea.KeyPressMsg) (tea.Model, tea.Cmd) {
|
|
m.helpOpen = false
|
|
return m, nil
|
|
}
|
|
|
|
func (m *Model) viewHelp() string {
|
|
w := m.lay.w - 12
|
|
if w > 72 {
|
|
w = 72
|
|
}
|
|
if w < 30 {
|
|
w = 30
|
|
}
|
|
m.help.SetWidth(w)
|
|
body := m.help.FullHelpView(m.keys.FullHelp())
|
|
lines := []string{m.styles.ModalTitle.Render("Keybindings"), "", body, "", m.styles.Help.Render("press any key to close")}
|
|
return m.styles.Modal.Render(lipgloss.JoinVertical(lipgloss.Left, lines...))
|
|
}
|