diff --git a/Dreadnought/Views/StatsView.swift b/Dreadnought/Views/StatsView.swift index a548d60..123cd5c 100644 --- a/Dreadnought/Views/StatsView.swift +++ b/Dreadnought/Views/StatsView.swift @@ -22,40 +22,38 @@ struct StatsView: View { var body: some View { Grid(alignment: .trailing, horizontalSpacing: 15) { - StatGridTitle(text: "Session") + StatGridTitle(text: "Lifetime") GridRow { Text("Upload") - Text(FilesizeFormatStyle().format(client.sessionUpload)) + Text(FilesizeFormatStyle().format(client.allTimeUpload)) } GridRow { Text("Download") - Text(FilesizeFormatStyle().format(client.sessionDownload)) + Text(FilesizeFormatStyle().format(client.allTimeDownload)) } GridRow { Text("Ratio") - Text(RatioFormatStyle().format(sessionRatio)) + Text(RatioFormatStyle().format(allTimeRatio)) } Divider().gridCellUnsizedAxes(.horizontal) - StatGridTitle(text: "Lifetime") + StatGridTitle(text: "Session") GridRow { Text("Upload") - Text(FilesizeFormatStyle().format(client.allTimeUpload)) + Text(FilesizeFormatStyle().format(client.sessionUpload)) } GridRow { Text("Download") - Text(FilesizeFormatStyle().format(client.allTimeDownload)) + Text(FilesizeFormatStyle().format(client.sessionDownload)) } GridRow { Text("Ratio") - Text(RatioFormatStyle().format(allTimeRatio)) + Text(RatioFormatStyle().format(sessionRatio)) } - Divider().gridCellUnsizedAxes(.horizontal) - GridRow { - Text("Session waste") + Text("Waste") Text(FilesizeFormatStyle().format(client.sessionWaste)) } GridRow { @@ -106,5 +104,11 @@ struct StatsView: View { #Preview { @State var client = TorrentClient() + client.allTimeDownload = 197912819680 + client.allTimeUpload = 1834422655961 + client.sessionUpload = 499025 + client.sessionWaste = 1024 + client.connectedPeers = 12 + client.totalBufferSize = 131234 return StatsView().environmentObject(client) }