diff --git a/docs/keybindings/Keybindings_de.md b/docs/keybindings/Keybindings_de.md
index 2ec26c14..ea89147d 100644
--- a/docs/keybindings/Keybindings_de.md
+++ b/docs/keybindings/Keybindings_de.md
@@ -42,6 +42,7 @@
R: zeige Neustartoptionen
c: führe vordefinierten benutzerdefinierten Befehl aus
b: view bulk commands
+ w: open in browser (first port is http)
enter: fokussieren aufs Hauptpanel
diff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md
index ac16e92e..85e67026 100644
--- a/docs/keybindings/Keybindings_en.md
+++ b/docs/keybindings/Keybindings_en.md
@@ -42,6 +42,7 @@
R: view restart options
c: run predefined custom command
b: view bulk commands
+ w: open in browser (first port is http)
enter: focus main panel
diff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md
index 10f7d524..f0f50dbc 100644
--- a/docs/keybindings/Keybindings_nl.md
+++ b/docs/keybindings/Keybindings_nl.md
@@ -42,6 +42,7 @@
R: bekijk herstart opties
c: draai een vooraf bedacht aangepaste opdracht
b: view bulk commands
+ w: open in browser (first port is http)
enter: focus hoofdpaneel
diff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md
index af32ec47..a902386f 100644
--- a/docs/keybindings/Keybindings_pl.md
+++ b/docs/keybindings/Keybindings_pl.md
@@ -42,6 +42,7 @@
R: pokaż opcje restartu
c: wykonaj predefiniowaną własną komende
b: view bulk commands
+ w: open in browser (first port is http)
enter: skup na głównym panelu
diff --git a/docs/keybindings/Keybindings_tr.md b/docs/keybindings/Keybindings_tr.md
index a7079d42..85b43165 100644
--- a/docs/keybindings/Keybindings_tr.md
+++ b/docs/keybindings/Keybindings_tr.md
@@ -42,6 +42,7 @@
R: yeniden başlatma seçeneklerini görüntüle
c: önceden tanımlanmış özel komutu çalıştır
b: view bulk commands
+ w: open in browser (first port is http)
enter: ana panele odaklan
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go
index d7784a41..cfb9c42f 100644
--- a/pkg/gui/keybindings.go
+++ b/pkg/gui/keybindings.go
@@ -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: '[',
diff --git a/pkg/gui/services_panel.go b/pkg/gui/services_panel.go
index 460a3a07..8ce15913 100644
--- a/pkg/gui/services_panel.go
+++ b/pkg/gui/services_panel.go
@@ -409,3 +409,31 @@ 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)
+ }
+
+ // skip if no any ports
+ if len(container.Container.Ports) == 0 {
+ return nil
+ }
+ // skip if the first port is not published
+ port := container.Container.Ports[0]
+ if port.IP == "" {
+ return nil
+ }
+ ip := port.IP
+ if ip == "0.0.0.0" {
+ ip = "localhost"
+ }
+ link := fmt.Sprintf("http://%s:%d/", ip, port.PublicPort)
+ return gui.OSCommand.OpenLink(link)
+}