fix(ui): 校正三语指标文案并核对构建包译文
This commit is contained in:
@@ -7,7 +7,7 @@ struct StorageDetailsView: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
field("memory.available", value: MetricFormat.bytes(disk?.available))
|
||||
field("memory.available", value: Text(verbatim: MetricFormat.bytes(disk?.available)))
|
||||
ViewThatFits(in: .horizontal) {
|
||||
HStack(spacing: 6) { read; write }.fixedSize(horizontal: true, vertical: true)
|
||||
VStack(alignment: .leading, spacing: 3) { read; write }
|
||||
@@ -24,15 +24,18 @@ struct StorageDetailsView: View {
|
||||
.font(.system(size: 10)).lineLimit(1)
|
||||
}
|
||||
|
||||
private var read: some View { field("disk.read", value: MetricFormat.rate(io?.read)) }
|
||||
private var write: some View { field("disk.write", value: MetricFormat.rate(io?.written)) }
|
||||
private var life: some View { field("disk.lifeShort", value: MetricFormat.percent(health?.remainingLife)) }
|
||||
private var powerOn: some View { field("disk.powerOnShort", value: health?.powerOnHours.map { "\($0) h" } ?? "--") }
|
||||
private var read: some View { field("disk.read", value: Text(verbatim: MetricFormat.rate(io?.read))) }
|
||||
private var write: some View { field("disk.write", value: Text(verbatim: MetricFormat.rate(io?.written))) }
|
||||
private var life: some View { field("disk.lifeShort", value: Text(verbatim: MetricFormat.percent(health?.remainingLife))) }
|
||||
private var powerOn: some View {
|
||||
let hours = health?.powerOnHours.map { Text("duration.hours \(String($0))") }
|
||||
return field("disk.powerOnShort", value: hours ?? Text(verbatim: "--"))
|
||||
}
|
||||
|
||||
private func field(_ title: LocalizedStringKey, value: String) -> some View {
|
||||
private func field(_ title: LocalizedStringKey, value: Text) -> some View {
|
||||
HStack(spacing: 3) {
|
||||
Text(title).foregroundStyle(.secondary).help(Text(title))
|
||||
MetricText(value: value).fontWeight(.medium).foregroundStyle(.primary)
|
||||
value.monospacedDigit().fontWeight(.medium).foregroundStyle(.primary)
|
||||
}.frame(height: 14)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user