mirror of
https://github.com/docker/compose.git
synced 2025-12-18 11:15:40 +01:00
Fixed status alignment in progress UI.
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
aa9a71f37a
commit
b62cbed87c
@ -52,7 +52,6 @@ type ttyWriter struct {
|
|||||||
done chan bool
|
done chan bool
|
||||||
mtx *sync.Mutex
|
mtx *sync.Mutex
|
||||||
dryRun bool // FIXME(ndeloof) (re)implement support for dry-run
|
dryRun bool // FIXME(ndeloof) (re)implement support for dry-run
|
||||||
skipChildEvents bool
|
|
||||||
operation string
|
operation string
|
||||||
ticker *time.Ticker
|
ticker *time.Ticker
|
||||||
suspended bool
|
suspended bool
|
||||||
@ -234,19 +233,12 @@ func (w *ttyWriter) print() {
|
|||||||
var statusPadding int
|
var statusPadding int
|
||||||
for _, t := range w.tasks {
|
for _, t := range w.tasks {
|
||||||
l := len(t.ID)
|
l := len(t.ID)
|
||||||
if statusPadding < l {
|
if t.parentID == "" && statusPadding < l {
|
||||||
statusPadding = l
|
statusPadding = l
|
||||||
}
|
}
|
||||||
if t.parentID != "" {
|
|
||||||
statusPadding -= 2
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(w.tasks) > goterm.Height()-2 {
|
|
||||||
w.skipChildEvents = true
|
|
||||||
}
|
|
||||||
numLines := 0
|
numLines := 0
|
||||||
|
|
||||||
for _, id := range w.ids { // iterate on ids to enforce a consistent order
|
for _, id := range w.ids { // iterate on ids to enforce a consistent order
|
||||||
t := w.tasks[id]
|
t := w.tasks[id]
|
||||||
if t.parentID != "" {
|
if t.parentID != "" {
|
||||||
@ -255,16 +247,6 @@ func (w *ttyWriter) print() {
|
|||||||
line := w.lineText(t, "", terminalWidth, statusPadding, w.dryRun)
|
line := w.lineText(t, "", terminalWidth, statusPadding, w.dryRun)
|
||||||
_, _ = fmt.Fprint(w.out, line)
|
_, _ = fmt.Fprint(w.out, line)
|
||||||
numLines++
|
numLines++
|
||||||
for _, t := range w.tasks {
|
|
||||||
if t.parentID == t.ID {
|
|
||||||
if w.skipChildEvents {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
line := w.lineText(t, " ", terminalWidth, statusPadding, w.dryRun)
|
|
||||||
_, _ = fmt.Fprint(w.out, line)
|
|
||||||
numLines++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
for i := numLines; i < w.numLines; i++ {
|
for i := numLines; i < w.numLines; i++ {
|
||||||
if numLines < goterm.Height()-2 {
|
if numLines < goterm.Height()-2 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user