[uishell] ProgressUI uses only 2 line per file (#221)
This commit is contained in:
parent
d4d6d7ffbe
commit
61231b8e97
1 changed files with 8 additions and 6 deletions
|
@ -18,7 +18,7 @@ object ProgressUI {
|
||||||
private val uploads: AtomicReference[Map[RemoteKey, UploadState]] =
|
private val uploads: AtomicReference[Map[RemoteKey, UploadState]] =
|
||||||
new AtomicReference[Map[RemoteKey, UploadState]](Map.empty)
|
new AtomicReference[Map[RemoteKey, UploadState]](Map.empty)
|
||||||
|
|
||||||
private val statusHeight = 3
|
private val statusHeight = 2
|
||||||
|
|
||||||
def requestCycle(
|
def requestCycle(
|
||||||
localFile: LocalFile,
|
localFile: LocalFile,
|
||||||
|
@ -53,12 +53,14 @@ object ProgressUI {
|
||||||
val fileLength = sizeInEnglish(state.fileLength)
|
val fileLength = sizeInEnglish(state.fileLength)
|
||||||
val line1 =
|
val line1 =
|
||||||
s"${GREEN}Uploading:$RESET ${remoteKey.key}$eraseLineForward"
|
s"${GREEN}Uploading:$RESET ${remoteKey.key}$eraseLineForward"
|
||||||
val line2 = s"$GREEN File:$RESET ($percent%) $transferred of $fileLength" + s"$eraseLineForward"
|
val line2body = s"($percent%) $transferred of $fileLength "
|
||||||
val line3 =
|
val bar =
|
||||||
progressBar(state.transferred, state.fileLength, Terminal.width)
|
progressBar(state.transferred,
|
||||||
|
state.fileLength,
|
||||||
|
Terminal.width - line2body.length)
|
||||||
|
val line2 = s"$GREEN$line2body$RESET$bar$eraseLineForward"
|
||||||
Console.putStrLn(line1) *>
|
Console.putStrLn(line1) *>
|
||||||
Console.putStrLn(line2) *>
|
Console.putStrLn(line2)
|
||||||
Console.putStrLn(line3)
|
|
||||||
}
|
}
|
||||||
} *> Console.putStr(resetCursor)
|
} *> Console.putStr(resetCursor)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue