Merge remote-tracking branch 'origin/feat/container-details' into feat/l-for-details
# Conflicts: # internal/ui/app/app_test.go
This commit is contained in:
commit
75f62240fc
15 files changed
+559
-8
No files matched your search
@@ -56,6 +56,7 @@ const (
|
||||
slotDescribe // extra metadata for the selected object
|
||||
slotCopy // fetch a value straight to the clipboard
|
||||
slotVersions // count the selected object's versions
|
||||
slotDetails // a vault's, scope's or file's details
|
||||
slotCount
|
||||
)
|
||||
|
||||
@@ -177,6 +178,7 @@ type Model struct {
|
||||
fields panes.Fields
|
||||
lastLeft pane
|
||||
groups map[string]groupsState
|
||||
details map[string]detailsState // by containerKey
|
||||
getenv func(string) string
|
||||
nvimOpen func(server, path string, line int) error // edit.go
|
||||
now func() time.Time
|
||||
@@ -376,6 +378,7 @@ func New(providers []provider.Provider, opts Options) Model {
|
||||
nvimOpen: nvimOpen,
|
||||
cache: newCache(),
|
||||
groups: map[string]groupsState{},
|
||||
details: map[string]detailsState{},
|
||||
fields: panes.NewFields(),
|
||||
}
|
||||
if m.clip == nil {
|
||||
@@ -590,6 +593,16 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case groupsMsg:
|
||||
m.groups[msg.provider] = groupsState{names: msg.names, err: msg.err}
|
||||
|
||||
case detailsMsg:
|
||||
if msg.req == m.reqID[slotDetails] {
|
||||
m.done(slotDetails)
|
||||
}
|
||||
if errors.Is(msg.err, context.Canceled) || errors.Is(msg.err, context.DeadlineExceeded) {
|
||||
delete(m.details, msg.key) // tried again when shown again
|
||||
} else {
|
||||
m.details[msg.key] = detailsState{attrs: msg.attrs, err: msg.err}
|
||||
}
|
||||
|
||||
case crawlMsg:
|
||||
cmds = append(cmds, m.handleCrawl(msg))
|
||||
|
||||
@@ -1036,6 +1049,7 @@ func (m *Model) refresh() tea.Cmd {
|
||||
case paneContainers:
|
||||
if src, ok := m.selectedSource(); ok {
|
||||
m.containers.Refresh()
|
||||
m.details = map[string]detailsState{}
|
||||
return m.loadContainers(src, m.selSource)
|
||||
}
|
||||
case paneSecrets:
|
||||
|
||||
Reference in new issue
Block a user