mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
show lazydocker config in about tab
This commit is contained in:
parent
3105c03bbe
commit
b644249d0e
2 changed files with 17 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package gui
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
|
|
@ -9,6 +10,7 @@ import (
|
|||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazydocker/pkg/commands"
|
||||
"github.com/jesseduffield/lazydocker/pkg/utils"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
func (gui *Gui) getStatusContexts() []string {
|
||||
|
|
@ -20,7 +22,7 @@ func (gui *Gui) getStatusContexts() []string {
|
|||
|
||||
func (gui *Gui) getStatusContextTitles() []string {
|
||||
if gui.DockerCommand.InDockerComposeProject {
|
||||
return []string{gui.Tr.LogsTitle, gui.Tr.CreditsTitle, gui.Tr.ConfigTitle}
|
||||
return []string{gui.Tr.LogsTitle, gui.Tr.CreditsTitle, gui.Tr.DockerComposeConfigTitle}
|
||||
}
|
||||
return []string{gui.Tr.CreditsTitle}
|
||||
}
|
||||
|
|
@ -83,6 +85,9 @@ func (gui *Gui) renderCredits() error {
|
|||
mainView.Autoscroll = false
|
||||
mainView.Wrap = true
|
||||
|
||||
var configBuf bytes.Buffer
|
||||
yaml.NewEncoder(&configBuf).Encode(gui.Config.UserConfig)
|
||||
|
||||
dashboardString := strings.Join(
|
||||
[]string{
|
||||
lazydockerTitle(),
|
||||
|
|
@ -91,6 +96,8 @@ func (gui *Gui) renderCredits() error {
|
|||
"Config Options: https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md",
|
||||
"Raise an Issue: https://github.com/jesseduffield/lazydocker/issues",
|
||||
utils.ColoredString("Buy Jesse a coffee: https://donorbox.org/lazydocker", color.FgMagenta), // caffeine ain't free
|
||||
"Here's what you lazydocker config is when merged with the defaults (you can open your config by pressing 'o'):",
|
||||
configBuf.String(),
|
||||
}, "\n\n")
|
||||
|
||||
gui.renderString(gui.g, "main", dashboardString)
|
||||
|
|
|
|||
|
|
@ -70,11 +70,12 @@ type TranslationSet struct {
|
|||
ViewRestartOptions string
|
||||
RunCustomCommand string
|
||||
|
||||
LogsTitle string
|
||||
ConfigTitle string
|
||||
StatsTitle string
|
||||
CreditsTitle string
|
||||
ContainerConfigTitle string
|
||||
LogsTitle string
|
||||
ConfigTitle string
|
||||
DockerComposeConfigTitle string
|
||||
StatsTitle string
|
||||
CreditsTitle string
|
||||
ContainerConfigTitle string
|
||||
}
|
||||
|
||||
func englishSet() TranslationSet {
|
||||
|
|
@ -98,8 +99,8 @@ func englishSet() TranslationSet {
|
|||
Close: "close",
|
||||
Menu: "menu",
|
||||
Scroll: "scroll",
|
||||
OpenConfig: "open config container",
|
||||
EditConfig: "edit config container",
|
||||
OpenConfig: "open lazydocker config",
|
||||
EditConfig: "edit lazydocker config",
|
||||
Cancel: "cancel",
|
||||
Remove: "remove",
|
||||
ForceRemove: "force remove",
|
||||
|
|
@ -137,6 +138,7 @@ func englishSet() TranslationSet {
|
|||
ErrorTitle: "Error",
|
||||
LogsTitle: "Logs",
|
||||
ConfigTitle: "Config",
|
||||
DockerComposeConfigTitle: "Docker-Compose Config",
|
||||
TopTitle: "Top",
|
||||
StatsTitle: "Stats",
|
||||
CreditsTitle: "About",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue