0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 21:30:16 +02:00

Shorten the UI bar

This commit is contained in:
Zack Scholl 2017-10-25 09:44:08 -06:00
parent 2ab6542fea
commit d134e7986f

View file

@ -520,6 +520,7 @@ func (c *Connection) receiveFile(id int, connection net.Conn) error {
if !c.Debug { if !c.Debug {
c.bars[id] = uiprogress.AddBar(int(chunkSize)/1024 + 1).AppendCompleted().PrependElapsed() c.bars[id] = uiprogress.AddBar(int(chunkSize)/1024 + 1).AppendCompleted().PrependElapsed()
c.bars[id].Width = 40
} }
logger.Debug("waiting for file") logger.Debug("waiting for file")
@ -579,6 +580,7 @@ func (c *Connection) sendFile(id int, connection net.Conn) error {
if !c.Debug { if !c.Debug {
logger.Debug("going to show progress") logger.Debug("going to show progress")
c.bars[id] = uiprogress.AddBar(int(fi.Size())).AppendCompleted().PrependElapsed() c.bars[id] = uiprogress.AddBar(int(fi.Size())).AppendCompleted().PrependElapsed()
c.bars[id].Width = 40
} }
// rate limit the bandwidth // rate limit the bandwidth