mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
Merge branch 'master' into ssh-host
This commit is contained in:
commit
33e207aeac
18 changed files with 126 additions and 78 deletions
15
README.md
15
README.md
|
|
@ -71,6 +71,20 @@ You can install `lazydocker` using [Chocolatey](https://chocolatey.org/):
|
|||
```sh
|
||||
choco install lazydocker
|
||||
```
|
||||
### asdf-vm
|
||||
|
||||
You can install [asdf-lazydocker plugin](https://github.com/comdotlinux/asdf-lazydocker) using [asdf-vm](https://asdf-vm.com/):
|
||||
#### Setup (Once)
|
||||
```sh
|
||||
asdf plugin add https://github.com/comdotlinux/asdf-lazydocker.git
|
||||
```
|
||||
|
||||
#### For Install / Upgrade
|
||||
```sh
|
||||
asdf list all lazydocker
|
||||
asdf install lazydocker 0.12
|
||||
asdf global lazydocker 0.12
|
||||
```
|
||||
|
||||
### Binary Release (Linux/OSX/Windows)
|
||||
|
||||
|
|
@ -81,7 +95,6 @@ Automated install/update, don't forget to always verify what you're piping into
|
|||
```sh
|
||||
curl https://raw.githubusercontent.com/jesseduffield/lazydocker/master/scripts/install_update_linux.sh | bash
|
||||
```
|
||||
|
||||
The script installs downloaded binary to `/usr/local/bin` directory by default, but it can be changed by setting `DIR` environment variable.
|
||||
|
||||
### Go
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ Changes to the user config will only take place after closing and re-opening laz
|
|||
```yml
|
||||
gui:
|
||||
scrollHeight: 2
|
||||
language: 'auto' # one of 'auto' | 'en' | 'pl' | 'nl' | 'de' | 'tr'
|
||||
theme:
|
||||
activeBorderColor:
|
||||
- green
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
1
go.mod
1
go.mod
|
|
@ -22,7 +22,6 @@ require (
|
|||
github.com/integrii/flaggy v1.4.0
|
||||
github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee
|
||||
github.com/jesseduffield/gocui v0.3.1-0.20200201013258-57fdcf23edc5
|
||||
github.com/jesseduffield/rollrus v0.0.0-20190701125922-dd028cb0bfd7 // indirect
|
||||
github.com/jesseduffield/termbox-go v0.0.0-20200130214842-1d31d1faa3c9 // indirect
|
||||
github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
|
||||
|
|
|
|||
22
go.sum
22
go.sum
|
|
@ -48,23 +48,14 @@ github.com/integrii/flaggy v1.4.0 h1:A1x7SYx4jqu5NSrY14z8Z+0UyX2S5ygfJJrfolWR3zM
|
|||
github.com/integrii/flaggy v1.4.0/go.mod h1:tnTxHeTJbah0gQ6/K0RW0J7fMUBk9MCF5blhm43LNpI=
|
||||
github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee h1:7Zi/OQlGbMz4MT2V1+prN/gv1C64NDyVb/MbJnS0ZfA=
|
||||
github.com/jesseduffield/asciigraph v0.0.0-20190605104717-6d88e39309ee/go.mod h1:Z9UKHveKXXgyo8ME7R8yxh/BUTFOK+FgfWKlhy8oOAg=
|
||||
github.com/jesseduffield/gocui v0.3.1-0.20190803023616-ad0cd60f29f9 h1:v2Pf3RaIN+MlFfSDnJw2d9Qksr4Tw08+pjL4LEY+JLM=
|
||||
github.com/jesseduffield/gocui v0.3.1-0.20190803023616-ad0cd60f29f9/go.mod h1:2RtZznzYKt8RLRwvFiSkXjU0Ei8WwHdubgnlaYH47dw=
|
||||
github.com/jesseduffield/gocui v0.3.1-0.20200201013258-57fdcf23edc5 h1:tE0w3tuL/bj1o5VMhjjE0ep6i7Fva+RYjKcMFcniJEY=
|
||||
github.com/jesseduffield/gocui v0.3.1-0.20200201013258-57fdcf23edc5/go.mod h1:2RtZznzYKt8RLRwvFiSkXjU0Ei8WwHdubgnlaYH47dw=
|
||||
github.com/jesseduffield/roll v0.0.0-20190629104057-695be2e62b00 h1:+JaOkfBNYQYlGD7dgru8mCwYNEc5tRRI8mThlVANhSM=
|
||||
github.com/jesseduffield/roll v0.0.0-20190629104057-695be2e62b00/go.mod h1:cWNQljQAWYBp4wchyGfql4q2jRNZXxiE1KhVQgz+JaM=
|
||||
github.com/jesseduffield/rollrus v0.0.0-20190701125922-dd028cb0bfd7 h1:CRD7bVjlGIiV+M0jlsa+XWpneW0KY0e7Y4z3GWb5S4o=
|
||||
github.com/jesseduffield/rollrus v0.0.0-20190701125922-dd028cb0bfd7/go.mod h1:VspA3aTkEo0Q7TPCLmX1uHNP+Wb4iSDX09hmTRo1QYc=
|
||||
github.com/jesseduffield/termbox-go v0.0.0-20190630083001-9dd53af7214e h1:tth7wr6+sfSbdpRWWrwvLYyS56HyIRVfq0Qcl2h28wM=
|
||||
github.com/jesseduffield/termbox-go v0.0.0-20190630083001-9dd53af7214e/go.mod h1:anMibpZtqNxjDbxrcDEAwSdaJ37vyUeM1f/M4uekib4=
|
||||
github.com/jesseduffield/termbox-go v0.0.0-20200130214842-1d31d1faa3c9 h1:iBBk1lhFwjwJw//J2m1yyz9S368GeXQTpMVACTyQMh0=
|
||||
github.com/jesseduffield/termbox-go v0.0.0-20200130214842-1d31d1faa3c9/go.mod h1:anMibpZtqNxjDbxrcDEAwSdaJ37vyUeM1f/M4uekib4=
|
||||
github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56 h1:33wSxJWU/f2TAozHYtJ8zqBxEnEVYM+22moLoiAkxvg=
|
||||
github.com/jesseduffield/yaml v0.0.0-20190702115811-b900b7e08b56/go.mod h1:FZJBwOhE+RXz8EVZfY+xnbCw2cVOwxlK3/aIi581z/s=
|
||||
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
|
|
@ -73,8 +64,6 @@ github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVc
|
|||
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||
github.com/mattn/go-isatty v0.0.11 h1:FxPOTFNqGkuDUGi3H/qkUbQO4ZiBa2brKq5r0l8TGeM=
|
||||
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
|
||||
github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54=
|
||||
github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.8 h1:3tS41NlGYSmhhe/8fhGRzc+z3AYCw1Fe1WAyLuujKs0=
|
||||
github.com/mattn/go-runewidth v0.0.8/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mcuadros/go-lookup v0.0.0-20171110082742-5650f26be767 h1:BrhJNdEFWGuiJk/3/SwsG5Rex3zjFxYsDi2bpd7382Y=
|
||||
|
|
@ -96,8 +85,6 @@ github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
|
|||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME=
|
||||
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=
|
||||
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
|
||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||
|
|
@ -107,27 +94,18 @@ github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
|
|||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
|
||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA=
|
||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
|
||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553 h1:efeOvDhwQ29Dj3SdAV/MJf8oukgn+8D8WgaCaRMchF8=
|
||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA=
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
|
||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e h1:o3PsSEY8E4eXWkXrIP9YJALUkVZqzHJT5DOasTyn8Vs=
|
||||
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
|
|
|
|||
|
|
@ -34,7 +34,10 @@ func NewApp(config *config.AppConfig) (*App, error) {
|
|||
}
|
||||
var err error
|
||||
app.Log = log.NewLogger(config, "23432119147a4367abf7c0de2aa99a2d")
|
||||
app.Tr = i18n.NewTranslationSet(app.Log)
|
||||
app.Tr, err = i18n.NewTranslationSetFromConfig(app.Log, config.UserConfig.Gui.Language)
|
||||
if err != nil {
|
||||
return app, err
|
||||
}
|
||||
app.OSCommand = commands.NewOSCommand(app.Log, config)
|
||||
|
||||
// here is the place to make use of the docker-compose.yml file in the current directory
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
ogLog "log"
|
||||
"net"
|
||||
"net/url"
|
||||
"os"
|
||||
|
|
@ -174,7 +175,7 @@ func clientBuilder(c *client.Client) error {
|
|||
func NewDockerCommand(log *logrus.Entry, osCommand *OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*DockerCommand, error) {
|
||||
cli, err := client.NewClientWithOpts(clientBuilder, client.WithVersion(APIVersion))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
ogLog.Fatal(err)
|
||||
}
|
||||
|
||||
dockerCommand := &DockerCommand{
|
||||
|
|
|
|||
|
|
@ -42,10 +42,11 @@ func NewDummyDockerCommand() *DockerCommand {
|
|||
|
||||
// NewDummyDockerCommandWithOSCommand creates a new dummy DockerCommand for testing
|
||||
func NewDummyDockerCommandWithOSCommand(osCommand *OSCommand) *DockerCommand {
|
||||
newAppConfig := NewDummyAppConfig()
|
||||
return &DockerCommand{
|
||||
Log: NewDummyLog(),
|
||||
OSCommand: osCommand,
|
||||
Tr: i18n.NewTranslationSet(NewDummyLog()),
|
||||
Config: NewDummyAppConfig(),
|
||||
Tr: i18n.NewTranslationSet(NewDummyLog(), newAppConfig.UserConfig.Gui.Language),
|
||||
Config: newAppConfig,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,9 @@ type GuiConfig struct {
|
|||
// scrolling the main panel
|
||||
ScrollHeight int `yaml:"scrollHeight,omitempty"`
|
||||
|
||||
// Language determines which language the GUI displayed.
|
||||
Language string `yaml:"language,omitempty"`
|
||||
|
||||
// ScrollPastBottom determines whether you can scroll past the bottom of the
|
||||
// main view
|
||||
ScrollPastBottom bool `yaml:"scrollPastBottom,omitempty"`
|
||||
|
|
@ -311,6 +314,7 @@ func GetDefaultConfig() UserConfig {
|
|||
return UserConfig{
|
||||
Gui: GuiConfig{
|
||||
ScrollHeight: 2,
|
||||
Language: "auto",
|
||||
ScrollPastBottom: false,
|
||||
IgnoreMouseEvents: false,
|
||||
Theme: ThemeConfig{
|
||||
|
|
|
|||
|
|
@ -178,58 +178,62 @@ func (gui *Gui) renderContainerLogs(container *commands.Container) error {
|
|||
mainView.Wrap = gui.Config.UserConfig.Gui.WrapMainPanel
|
||||
|
||||
return gui.T.NewTickerTask(time.Millisecond*200, nil, func(stop, notifyStopped chan struct{}) {
|
||||
gui.clearMainView()
|
||||
gui.renderContainerLogsAux(container, stop, notifyStopped)
|
||||
})
|
||||
}
|
||||
|
||||
command := utils.ApplyTemplate(
|
||||
gui.Config.UserConfig.CommandTemplates.ContainerLogs,
|
||||
gui.DockerCommand.NewCommandObject(commands.CommandObject{Container: container}),
|
||||
)
|
||||
cmd := gui.OSCommand.RunCustomCommand(command)
|
||||
func (gui *Gui) renderContainerLogsAux(container *commands.Container, stop, notifyStopped chan struct{}) {
|
||||
gui.clearMainView()
|
||||
|
||||
// Ensure the child process is treated as a group, as the child process spawns
|
||||
// its own children. Termination requires sending the signal to the group
|
||||
// process ID.
|
||||
gui.OSCommand.PrepareForChildren(cmd)
|
||||
command := utils.ApplyTemplate(
|
||||
gui.Config.UserConfig.CommandTemplates.ContainerLogs,
|
||||
gui.DockerCommand.NewCommandObject(commands.CommandObject{Container: container}),
|
||||
)
|
||||
cmd := gui.OSCommand.RunCustomCommand(command)
|
||||
|
||||
mainView := gui.getMainView()
|
||||
cmd.Stdout = mainView
|
||||
cmd.Stderr = mainView
|
||||
// Ensure the child process is treated as a group, as the child process spawns
|
||||
// its own children. Termination requires sending the signal to the group
|
||||
// process ID.
|
||||
gui.OSCommand.PrepareForChildren(cmd)
|
||||
|
||||
cmd.Start()
|
||||
mainView := gui.getMainView()
|
||||
cmd.Stdout = mainView
|
||||
cmd.Stderr = mainView
|
||||
|
||||
go func() {
|
||||
<-stop
|
||||
if err := gui.OSCommand.Kill(cmd); err != nil {
|
||||
gui.Log.Warn(err)
|
||||
}
|
||||
gui.Log.Info("killed container logs process")
|
||||
cmd.Start()
|
||||
|
||||
go func() {
|
||||
<-stop
|
||||
if err := gui.OSCommand.Kill(cmd); err != nil {
|
||||
gui.Log.Warn(err)
|
||||
}
|
||||
gui.Log.Info("killed container logs process")
|
||||
return
|
||||
}()
|
||||
|
||||
cmd.Wait()
|
||||
|
||||
// if we are here because the task has been stopped, we should return
|
||||
// if we are here then the container must have exited, meaning we should wait until it's back again before
|
||||
ticker := time.NewTicker(time.Millisecond * 100)
|
||||
defer ticker.Stop()
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
return
|
||||
}()
|
||||
|
||||
cmd.Wait()
|
||||
|
||||
// if we are here because the task has been stopped, we should return
|
||||
// if we are here then the container must have exited, meaning we should wait until it's back again before
|
||||
L:
|
||||
for {
|
||||
select {
|
||||
case <-stop:
|
||||
case <-ticker.C:
|
||||
result, err := container.Inspect()
|
||||
if err != nil {
|
||||
// if we get an error, then the container has probably been removed so we'll get out of here
|
||||
gui.Log.Error(err)
|
||||
notifyStopped <- struct{}{}
|
||||
return
|
||||
}
|
||||
if result.State.Running {
|
||||
return
|
||||
default:
|
||||
result, err := container.Inspect()
|
||||
if err != nil {
|
||||
// if we get an error, then the container has probably been removed so we'll get out of here
|
||||
gui.Log.Error(err)
|
||||
notifyStopped <- struct{}{}
|
||||
return
|
||||
}
|
||||
if result.State.Running {
|
||||
break L
|
||||
}
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func (gui *Gui) refreshContainersAndServices() error {
|
||||
|
|
@ -593,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)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import (
|
|||
"github.com/imdario/mergo"
|
||||
|
||||
"github.com/cloudfoundry/jibber_jabber"
|
||||
"github.com/go-errors/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
|
|
@ -16,16 +17,28 @@ type Localizer struct {
|
|||
S TranslationSet
|
||||
}
|
||||
|
||||
// NewTranslationSet creates a new Localizer
|
||||
func NewTranslationSet(log *logrus.Entry) *TranslationSet {
|
||||
userLang := detectLanguage(jibber_jabber.DetectLanguage)
|
||||
func NewTranslationSetFromConfig(log *logrus.Entry, configLanguage string) (*TranslationSet, error) {
|
||||
if configLanguage == "auto" {
|
||||
language := detectLanguage(jibber_jabber.DetectLanguage)
|
||||
return NewTranslationSet(log, language), nil
|
||||
}
|
||||
|
||||
log.Info("language: " + userLang)
|
||||
for key := range GetTranslationSets() {
|
||||
if key == configLanguage {
|
||||
return NewTranslationSet(log, configLanguage), nil
|
||||
}
|
||||
}
|
||||
|
||||
return NewTranslationSet(log, "en"), errors.New("Language not found: " + configLanguage)
|
||||
}
|
||||
|
||||
func NewTranslationSet(log *logrus.Entry, language string) *TranslationSet {
|
||||
log.Info("language: " + language)
|
||||
|
||||
baseSet := englishSet()
|
||||
|
||||
for languageCode, translationSet := range GetTranslationSets() {
|
||||
if strings.HasPrefix(userLang, languageCode) {
|
||||
if strings.HasPrefix(language, languageCode) {
|
||||
_ = mergo.Merge(&baseSet, translationSet, mergo.WithOverride)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# allow specifying different destination directory
|
||||
DIR="${DIR:-"/usr/local/bin"}"
|
||||
DIR="${DIR:-"$HOME/.local/bin"}"
|
||||
|
||||
# map different architecture variations to the available binaries
|
||||
ARCH=$(uname -m)
|
||||
|
|
@ -20,5 +20,5 @@ GITHUB_URL="https://github.com/jesseduffield/lazydocker/releases/download/${GITH
|
|||
# install/update the local binary
|
||||
curl -L -o lazydocker.tar.gz $GITHUB_URL
|
||||
tar xzvf lazydocker.tar.gz lazydocker
|
||||
sudo mv -f lazydocker "$DIR"
|
||||
install -Dm 755 lazydocker -t "$DIR"
|
||||
rm lazydocker.tar.gz
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue