Unify labels, byte units, snapshot numbers and spelling
This commit is contained in:
@@ -25,17 +25,6 @@ private func since(_ date: Date) -> String {
|
||||
return ago(date)
|
||||
}
|
||||
|
||||
private func bytes(_ n: Int64) -> String {
|
||||
let units = ["B", "KB", "MB", "GB", "TB"]
|
||||
var i = 0
|
||||
var v = Double(n)
|
||||
while v >= 1024 && i < units.count - 1 {
|
||||
v /= 1024
|
||||
i += 1
|
||||
}
|
||||
return "\(v.formatted(.number.precision(.fractionLength(i == 0 ? 0 : 1)).grouping(.never))) \(units[i])"
|
||||
}
|
||||
|
||||
private func resetText(_ at: Date) -> String {
|
||||
let time = at.formatted(Date.FormatStyle().weekday(.abbreviated).hour().minute())
|
||||
let minutes = Int((at.timeIntervalSinceNow / 60).rounded())
|
||||
@@ -487,7 +476,7 @@ private struct ClientTable: View {
|
||||
Text("\(c.login) · build \(build(c))")
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(Palette.muted)
|
||||
Text("Connected \(ago(c.connectedAt)) ·last action \(c.lastActionAt.map(since) ?? "—")")
|
||||
Text("Connected \(ago(c.connectedAt)) · last action \(c.lastActionAt.map(since) ?? "—")")
|
||||
.font(Fonts.font(11))
|
||||
.foregroundStyle(Palette.muted)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user