mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
use confirmation panel for upping project
This commit is contained in:
parent
0a0116b5eb
commit
129402fd50
2 changed files with 16 additions and 12 deletions
|
|
@ -326,17 +326,19 @@ func (gui *Gui) handleServiceRenderLogsToMain(g *gocui.Gui, v *gocui.View) error
|
|||
}
|
||||
|
||||
func (gui *Gui) handleProjectUp(g *gocui.Gui, v *gocui.View) error {
|
||||
cmdStr := utils.ApplyTemplate(
|
||||
gui.Config.UserConfig.CommandTemplates.Up,
|
||||
gui.DockerCommand.NewCommandObject(commands.CommandObject{}),
|
||||
)
|
||||
return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmUpProject, func(g *gocui.Gui, v *gocui.View) error {
|
||||
cmdStr := utils.ApplyTemplate(
|
||||
gui.Config.UserConfig.CommandTemplates.Up,
|
||||
gui.DockerCommand.NewCommandObject(commands.CommandObject{}),
|
||||
)
|
||||
|
||||
return gui.WithWaitingStatus(gui.Tr.UppingAllStatus, func() error {
|
||||
if err := gui.OSCommand.RunCommand(cmdStr); err != nil {
|
||||
return gui.createErrorPanel(err.Error())
|
||||
}
|
||||
return nil
|
||||
})
|
||||
return gui.WithWaitingStatus(gui.Tr.UppingProjectStatus, func() error {
|
||||
if err := gui.OSCommand.RunCommand(cmdStr); err != nil {
|
||||
return gui.createErrorPanel(err.Error())
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}, nil)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleProjectDown(g *gocui.Gui, v *gocui.View) error {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ type TranslationSet struct {
|
|||
OpenConfig string
|
||||
EditConfig string
|
||||
ConfirmQuit string
|
||||
ConfirmUpProject string
|
||||
ErrorOccurred string
|
||||
ConnectionFailed string
|
||||
UnattachableContainerError string
|
||||
|
|
@ -41,7 +42,7 @@ type TranslationSet struct {
|
|||
RestartingStatus string
|
||||
StartingStatus string
|
||||
StoppingStatus string
|
||||
UppingAllStatus string
|
||||
UppingProjectStatus string
|
||||
UppingServiceStatus string
|
||||
PausingStatus string
|
||||
RemovingStatus string
|
||||
|
|
@ -125,7 +126,7 @@ func englishSet() TranslationSet {
|
|||
StartingStatus: "starting",
|
||||
StoppingStatus: "stopping",
|
||||
UppingServiceStatus: "upping service",
|
||||
UppingAllStatus: "upping all",
|
||||
UppingProjectStatus: "upping project",
|
||||
DowningStatus: "downing",
|
||||
PausingStatus: "pausing",
|
||||
RunningCustomCommandStatus: "running custom command",
|
||||
|
|
@ -221,6 +222,7 @@ func englishSet() TranslationSet {
|
|||
NoVolumes: "No volumes",
|
||||
|
||||
ConfirmQuit: "Are you sure you want to quit?",
|
||||
ConfirmUpProject: "Are you sure you want to 'up' your docker compose project?",
|
||||
MustForceToRemoveContainer: "You cannot remove a running container unless you force it. Do you want to force it?",
|
||||
NotEnoughSpace: "Not enough space to render panels",
|
||||
ConfirmPruneImages: "Are you sure you want to prune all unused images?",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue