mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-22 07:11:01 +00:00
Merge pull request #252 from jtraub/browser-services
This commit is contained in:
commit
4391878bab
8 changed files with 31 additions and 0 deletions
|
|
@ -42,6 +42,7 @@
|
|||
<kbd>R</kbd>: zeige Neustartoptionen
|
||||
<kbd>c</kbd>: führe vordefinierten benutzerdefinierten Befehl aus
|
||||
<kbd>b</kbd>: view bulk commands
|
||||
<kbd>w</kbd>: open in browser (first port is http)
|
||||
<kbd>enter</kbd>: fokussieren aufs Hauptpanel
|
||||
</pre>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<kbd>R</kbd>: view restart options
|
||||
<kbd>c</kbd>: run predefined custom command
|
||||
<kbd>b</kbd>: view bulk commands
|
||||
<kbd>w</kbd>: open in browser (first port is http)
|
||||
<kbd>enter</kbd>: focus main panel
|
||||
</pre>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<kbd>R</kbd>: bekijk herstart opties
|
||||
<kbd>c</kbd>: draai een vooraf bedacht aangepaste opdracht
|
||||
<kbd>b</kbd>: view bulk commands
|
||||
<kbd>w</kbd>: open in browser (first port is http)
|
||||
<kbd>enter</kbd>: focus hoofdpaneel
|
||||
</pre>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<kbd>R</kbd>: pokaż opcje restartu
|
||||
<kbd>c</kbd>: wykonaj predefiniowaną własną komende
|
||||
<kbd>b</kbd>: view bulk commands
|
||||
<kbd>w</kbd>: open in browser (first port is http)
|
||||
<kbd>enter</kbd>: skup na głównym panelu
|
||||
</pre>
|
||||
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
<kbd>R</kbd>: yeniden başlatma seçeneklerini görüntüle
|
||||
<kbd>c</kbd>: önceden tanımlanmış özel komutu çalıştır
|
||||
<kbd>b</kbd>: view bulk commands
|
||||
<kbd>w</kbd>: open in browser (first port is http)
|
||||
<kbd>enter</kbd>: ana panele odaklan
|
||||
</pre>
|
||||
|
||||
|
|
|
|||
|
|
@ -597,6 +597,11 @@ func (gui *Gui) handleContainersOpenInBrowserCommand(g *gocui.Gui, v *gocui.View
|
|||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return gui.openContainerInBrowser(container)
|
||||
}
|
||||
|
||||
func (gui *Gui) openContainerInBrowser(container *commands.Container) error {
|
||||
// skip if no any ports
|
||||
if len(container.Container.Ports) == 0 {
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -346,6 +346,13 @@ func (gui *Gui) GetInitialKeybindings() []*Binding {
|
|||
Handler: gui.handleServicesBulkCommand,
|
||||
Description: gui.Tr.ViewBulkCommands,
|
||||
},
|
||||
{
|
||||
ViewName: "services",
|
||||
Key: 'w',
|
||||
Modifier: gocui.ModNone,
|
||||
Handler: gui.handleServicesOpenInBrowserCommand,
|
||||
Description: gui.Tr.OpenInBrowser,
|
||||
},
|
||||
{
|
||||
ViewName: "images",
|
||||
Key: '[',
|
||||
|
|
|
|||
|
|
@ -409,3 +409,17 @@ func (gui *Gui) handleServicesBulkCommand(g *gocui.Gui, v *gocui.View) error {
|
|||
|
||||
return gui.createBulkCommandMenu(bulkCommands, commandObject)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleServicesOpenInBrowserCommand(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.openContainerInBrowser(container)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue