mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
Merge pull request #346 from jesseduffield/exec-shell-service
exec shell handler for services panel
This commit is contained in:
commit
0118786fd9
3 changed files with 26 additions and 0 deletions
|
|
@ -523,6 +523,11 @@ func (gui *Gui) handleContainersExecShell(g *gocui.Gui, v *gocui.View) error {
|
|||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return gui.containerExecShell(container)
|
||||
}
|
||||
|
||||
func (gui *Gui) containerExecShell(container *commands.Container) error {
|
||||
commandObject := gui.DockerCommand.NewCommandObject(commands.CommandObject{
|
||||
Container: container,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -367,6 +367,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
Handler: gui.handleServicesBulkCommand,
|
||||
Description: gui.Tr.ViewBulkCommands,
|
||||
},
|
||||
{
|
||||
ViewName: "services",
|
||||
Key: 'E',
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleServicesExecShell,
|
||||
Description: gui.Tr.ExecShell,
|
||||
},
|
||||
{
|
||||
ViewName: "services",
|
||||
Key: 'w',
|
||||
|
|
|
|||
|
|
@ -442,6 +442,20 @@ func (gui *Gui) handleServicesBulkCommand(g *gocui.Gui, v *gocui.View) error {
|
|||
return gui.createBulkCommandMenu(bulkCommands, commandObject)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleServicesExecShell(g *gocui.Gui, v *gocui.View) error {
|
||||
service, err := gui.getSelectedService()
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
container := service.Container
|
||||
if container == nil {
|
||||
return gui.createErrorPanel(gui.g, gui.Tr.NoContainers)
|
||||
}
|
||||
|
||||
return gui.containerExecShell(container)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleServicesOpenInBrowserCommand(g *gocui.Gui, v *gocui.View) error {
|
||||
service, err := gui.getSelectedService()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue