chore(progress): reduce tracker length

This commit is contained in:
iyear 2022-09-04 13:18:48 +08:00
parent d81c5d072e
commit 40097c6cea
2 changed files with 3 additions and 4 deletions

View file

@ -10,14 +10,13 @@ import (
func New() progress.Writer {
pw := progress.NewWriter()
pw.SetAutoStop(true)
pw.SetTrackerLength(25)
pw.SetMessageWidth(40)
pw.SetTrackerLength(20)
pw.SetMessageWidth(35)
pw.SetStyle(progress.StyleDefault)
pw.SetTrackerPosition(progress.PositionRight)
pw.SetUpdateFrequency(time.Millisecond * 100)
pw.Style().Colors = progress.StyleColorsExample
pw.Style().Options.PercentFormat = "%4.1f%%"
pw.Style().Options.ETAString = "Remaining"
pw.Style().Visibility.TrackerOverall = true
pw.Style().Visibility.ETA = true
pw.Style().Visibility.ETAOverall = false

View file

@ -11,7 +11,7 @@ func AppendTracker(pw progress.Writer, message string, total int64) *progress.Tr
units.Formatter = utils.Byte.FormatBinaryBytes
tracker := progress.Tracker{
Message: color.BlueString("%s - %s", utils.Byte.FormatBinaryBytes(total), message),
Message: color.BlueString(message),
Total: total,
Units: units,
}