Skip to content

Commit

Permalink
Add file browser
Browse files Browse the repository at this point in the history
  • Loading branch information
jarkkosonninen authored and derailed committed Jan 19, 2025
1 parent 6eca796 commit b7212da
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/view/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ func (c *Container) bindDangerousKeys(aa *ui.KeyActions) {
Visible: true,
Dangerous: true,
}),
ui.KeyB: ui.NewKeyActionWithOpts(
"Browse",
c.browseCmd,
ui.ActionOpts{
Visible: true,
Dangerous: true,
}),
})
}

Expand Down Expand Up @@ -204,6 +211,15 @@ func (c *Container) portFwdCmd(evt *tcell.EventKey) *tcell.EventKey {
return nil
}

func (c *Container) browseCmd(evt *tcell.EventKey) *tcell.EventKey {
co := c.GetTable().GetSelectedItem()
if co == "" {
return evt
}
dirRemoteIn(c.App(), c, c.GetTable().Path, co, "")
return nil
}

func checkRunningStatus(co string, ss []v1.ContainerStatus) error {
var cs *v1.ContainerStatus
for i := range ss {
Expand Down

0 comments on commit b7212da

Please sign in to comment.