mirror of
https://github.com/bit1001/tdl.git
synced 2025-10-01 10:45:33 +08:00
chore(progress): reduce tracker length
This commit is contained in:
parent
d81c5d072e
commit
40097c6cea
2 changed files with 3 additions and 4 deletions
|
@ -10,14 +10,13 @@ import (
|
||||||
func New() progress.Writer {
|
func New() progress.Writer {
|
||||||
pw := progress.NewWriter()
|
pw := progress.NewWriter()
|
||||||
pw.SetAutoStop(true)
|
pw.SetAutoStop(true)
|
||||||
pw.SetTrackerLength(25)
|
pw.SetTrackerLength(20)
|
||||||
pw.SetMessageWidth(40)
|
pw.SetMessageWidth(35)
|
||||||
pw.SetStyle(progress.StyleDefault)
|
pw.SetStyle(progress.StyleDefault)
|
||||||
pw.SetTrackerPosition(progress.PositionRight)
|
pw.SetTrackerPosition(progress.PositionRight)
|
||||||
pw.SetUpdateFrequency(time.Millisecond * 100)
|
pw.SetUpdateFrequency(time.Millisecond * 100)
|
||||||
pw.Style().Colors = progress.StyleColorsExample
|
pw.Style().Colors = progress.StyleColorsExample
|
||||||
pw.Style().Options.PercentFormat = "%4.1f%%"
|
pw.Style().Options.PercentFormat = "%4.1f%%"
|
||||||
pw.Style().Options.ETAString = "Remaining"
|
|
||||||
pw.Style().Visibility.TrackerOverall = true
|
pw.Style().Visibility.TrackerOverall = true
|
||||||
pw.Style().Visibility.ETA = true
|
pw.Style().Visibility.ETA = true
|
||||||
pw.Style().Visibility.ETAOverall = false
|
pw.Style().Visibility.ETAOverall = false
|
||||||
|
|
|
@ -11,7 +11,7 @@ func AppendTracker(pw progress.Writer, message string, total int64) *progress.Tr
|
||||||
units.Formatter = utils.Byte.FormatBinaryBytes
|
units.Formatter = utils.Byte.FormatBinaryBytes
|
||||||
|
|
||||||
tracker := progress.Tracker{
|
tracker := progress.Tracker{
|
||||||
Message: color.BlueString("%s - %s", utils.Byte.FormatBinaryBytes(total), message),
|
Message: color.BlueString(message),
|
||||||
Total: total,
|
Total: total,
|
||||||
Units: units,
|
Units: units,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue