mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
287 Display hotkeys to detach from the container (#465)
Co-authored-by: glendsoza <glendsouza23@gmail.com>
This commit is contained in:
parent
15bc01b9af
commit
e5ca391291
8 changed files with 82 additions and 69 deletions
|
|
@ -408,7 +408,7 @@ func (gui *Gui) handleContainerAttach(g *gocui.Gui, v *gocui.View) error {
|
||||||
return gui.createErrorPanel(err.Error())
|
return gui.createErrorPanel(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
return gui.runSubprocess(c)
|
return gui.runSubprocessWithMessage(c, gui.Tr.DetachFromContainerShortCut)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) handlePruneContainers() error {
|
func (gui *Gui) handlePruneContainers() error {
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,10 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (gui *Gui) runSubprocess(cmd *exec.Cmd) error {
|
func (gui *Gui) runSubprocess(cmd *exec.Cmd) error {
|
||||||
|
return gui.runSubprocessWithMessage(cmd, "")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) runSubprocessWithMessage(cmd *exec.Cmd, msg string) error {
|
||||||
gui.Mutexes.SubprocessMutex.Lock()
|
gui.Mutexes.SubprocessMutex.Lock()
|
||||||
defer gui.Mutexes.SubprocessMutex.Unlock()
|
defer gui.Mutexes.SubprocessMutex.Unlock()
|
||||||
|
|
||||||
|
|
@ -22,7 +26,7 @@ func (gui *Gui) runSubprocess(cmd *exec.Cmd) error {
|
||||||
|
|
||||||
gui.PauseBackgroundThreads = true
|
gui.PauseBackgroundThreads = true
|
||||||
|
|
||||||
gui.runCommand(cmd)
|
gui.runCommand(cmd, msg)
|
||||||
|
|
||||||
if err := gui.g.Resume(); err != nil {
|
if err := gui.g.Resume(); err != nil {
|
||||||
return gui.createErrorPanel(err.Error())
|
return gui.createErrorPanel(err.Error())
|
||||||
|
|
@ -33,7 +37,7 @@ func (gui *Gui) runSubprocess(cmd *exec.Cmd) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) runCommand(cmd *exec.Cmd) {
|
func (gui *Gui) runCommand(cmd *exec.Cmd, msg string) {
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
cmd.Stderr = os.Stdout
|
cmd.Stderr = os.Stdout
|
||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
|
|
@ -51,7 +55,9 @@ func (gui *Gui) runCommand(cmd *exec.Cmd) {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString("+ "+strings.Join(cmd.Args, " "), color.FgBlue))
|
fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString("+ "+strings.Join(cmd.Args, " "), color.FgBlue))
|
||||||
|
if msg != "" {
|
||||||
|
fmt.Fprintf(os.Stdout, "\n%s\n\n", utils.ColoredString(msg, color.FgGreen))
|
||||||
|
}
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
// not handling the error explicitly because usually we're going to see it
|
// not handling the error explicitly because usually we're going to see it
|
||||||
// in the output anyway
|
// in the output anyway
|
||||||
|
|
|
||||||
|
|
@ -93,5 +93,6 @@ func dutchSet() TranslationSet {
|
||||||
StopService: "Weet je zeker dat je deze service zijn containers wil stoppen?",
|
StopService: "Weet je zeker dat je deze service zijn containers wil stoppen?",
|
||||||
StopContainer: "Weet je zeker dat je deze container wil stoppen?",
|
StopContainer: "Weet je zeker dat je deze container wil stoppen?",
|
||||||
PressEnterToReturn: "Druk op enter om terug te gaan naar lazydocker (Deze popup kan uit gezet worden door in de config dit neer te zetten `gui.returnImmediately: true`)",
|
PressEnterToReturn: "Druk op enter om terug te gaan naar lazydocker (Deze popup kan uit gezet worden door in de config dit neer te zetten `gui.returnImmediately: true`)",
|
||||||
|
DetachFromContainerShortCut: "Als u wilt loskoppelen van de container, drukt u standaard op ctrl-p en vervolgens op ctrl-q",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,7 @@ type TranslationSet struct {
|
||||||
PruningStatus string
|
PruningStatus string
|
||||||
StopService string
|
StopService string
|
||||||
PressEnterToReturn string
|
PressEnterToReturn string
|
||||||
|
DetachFromContainerShortCut string
|
||||||
StopAllContainers string
|
StopAllContainers string
|
||||||
RemoveAllContainers string
|
RemoveAllContainers string
|
||||||
ViewRestartOptions string
|
ViewRestartOptions string
|
||||||
|
|
@ -254,6 +255,7 @@ func englishSet() TranslationSet {
|
||||||
StopService: "Are you sure you want to stop this service's containers?",
|
StopService: "Are you sure you want to stop this service's containers?",
|
||||||
StopContainer: "Are you sure you want to stop this container?",
|
StopContainer: "Are you sure you want to stop this container?",
|
||||||
PressEnterToReturn: "Press enter to return to lazydocker (this prompt can be disabled in your config by setting `gui.returnImmediately: true`)",
|
PressEnterToReturn: "Press enter to return to lazydocker (this prompt can be disabled in your config by setting `gui.returnImmediately: true`)",
|
||||||
|
DetachFromContainerShortCut: "By default, to detach from the container press ctrl-p then ctrl-q",
|
||||||
|
|
||||||
No: "no",
|
No: "no",
|
||||||
Yes: "yes",
|
Yes: "yes",
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ func frenchSet() TranslationSet {
|
||||||
StopService: "Êtes-vous certain de vouloir arrêter le conteneur de ce service ?",
|
StopService: "Êtes-vous certain de vouloir arrêter le conteneur de ce service ?",
|
||||||
StopContainer: "Êtes-vous certain de vouloir arrêter ce conteneur ?",
|
StopContainer: "Êtes-vous certain de vouloir arrêter ce conteneur ?",
|
||||||
PressEnterToReturn: "Appuiez sur Enter pour revenir à lazydocker (ce message peut être désactivé dans vos configurations en appliquant `gui.returnImmediately: true`)",
|
PressEnterToReturn: "Appuiez sur Enter pour revenir à lazydocker (ce message peut être désactivé dans vos configurations en appliquant `gui.returnImmediately: true`)",
|
||||||
|
DetachFromContainerShortCut: "Par défaut, pour se détacher du conteneur appuyez sur ctrl-p puis ctrl-q",
|
||||||
|
|
||||||
No: "non",
|
No: "non",
|
||||||
Yes: "oui",
|
Yes: "oui",
|
||||||
|
|
|
||||||
|
|
@ -92,5 +92,6 @@ func germanSet() TranslationSet {
|
||||||
StopService: "Bist du dir sicher, dass du den Dienst dieses Containers anhalten möchtest?",
|
StopService: "Bist du dir sicher, dass du den Dienst dieses Containers anhalten möchtest?",
|
||||||
StopContainer: "Bist du dir sicher, dass du den Container anhalten möchtest?",
|
StopContainer: "Bist du dir sicher, dass du den Container anhalten möchtest?",
|
||||||
PressEnterToReturn: "Drücke Eingabe um zu lazydocker zurückzukehren. (Diese Nachfrage kann in Deiner Konfiguration deaktiviert werden, indem du folgenden Wert setzt: `gui.returnImmediately: true`)",
|
PressEnterToReturn: "Drücke Eingabe um zu lazydocker zurückzukehren. (Diese Nachfrage kann in Deiner Konfiguration deaktiviert werden, indem du folgenden Wert setzt: `gui.returnImmediately: true`)",
|
||||||
|
DetachFromContainerShortCut: "Um sich vom Container zu trennen, drücken Sie standardmäßig ctrl-p und dann ctrl-q",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,5 +92,6 @@ func polishSet() TranslationSet {
|
||||||
StopService: "Na pewno zatrzymać kontenery tego serwisu?",
|
StopService: "Na pewno zatrzymać kontenery tego serwisu?",
|
||||||
StopContainer: "Na pewno zatrzymać ten kontener?",
|
StopContainer: "Na pewno zatrzymać ten kontener?",
|
||||||
PressEnterToReturn: "Wciśnij enter aby powrócić do lazydockera (ten komunikat może być wyłączony w konfiguracji poprzez ustawienie `gui.returnImmediately: true`)",
|
PressEnterToReturn: "Wciśnij enter aby powrócić do lazydockera (ten komunikat może być wyłączony w konfiguracji poprzez ustawienie `gui.returnImmediately: true`)",
|
||||||
|
DetachFromContainerShortCut: "Domyślnie, aby odłączyć się od kontenera, naciśnij ctrl-p, a następnie ctrl-q",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,5 +92,6 @@ func turkishSet() TranslationSet {
|
||||||
StopService: "Bu servisin konteynerlerini durdurmak istediğinize emin misiniz?",
|
StopService: "Bu servisin konteynerlerini durdurmak istediğinize emin misiniz?",
|
||||||
StopContainer: "Bu konteyneri durdurmak istediğinize emin misiniz?",
|
StopContainer: "Bu konteyneri durdurmak istediğinize emin misiniz?",
|
||||||
PressEnterToReturn: "lazydocker' a geri dönmek için enter tuşuna basın ( Bu uyarı, `gui.return Immediately: true` ayarıyla devre dışı bırakılabilir)",
|
PressEnterToReturn: "lazydocker' a geri dönmek için enter tuşuna basın ( Bu uyarı, `gui.return Immediately: true` ayarıyla devre dışı bırakılabilir)",
|
||||||
|
DetachFromContainerShortCut: "Varsayılan olarak, kaptan ayırmak için ctrl-p ve ardından ctrl-q tuşlarına basın",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue