Properly acknowledge in the environment metrics graph that sometimes Canada is not frozen

This commit is contained in:
Garth Vander Houwen 2023-05-31 21:39:56 -07:00
parent 5641896ed2
commit baaa88dbec
3 changed files with 8 additions and 4 deletions

View file

@ -182,7 +182,7 @@ struct UserMessageList: View {
if message.realACK {
Text("\(ackErrorVal?.display ?? "Empty Ack Error")").font(.caption2).foregroundColor(.gray)
} else {
Text("Implicit ACK from Unknown Node").font(.caption2).foregroundColor(.orange)
Text("Implicit ACK from another node").font(.caption2).foregroundColor(.orange)
}
} else if currentUser && message.ackError == 0 {
// Empty Error

View file

@ -27,7 +27,10 @@ struct EnvironmentMetricsLog: View {
let chartData = environmentMetrics
.filter { $0.time != nil && $0.time! >= oneWeekAgo! }
.sorted { $0.time! < $1.time! }
let locale = NSLocale.current as NSLocale
let localeUnit = locale.object(forKey: NSLocale.Key(rawValue: "kCFLocaleTemperatureUnitKey"))
var format: UnitTemperature = localeUnit as? String ?? "Celsius" == "Fahrenheit" ? .fahrenheit : .celsius
NavigationStack {
if chartData.count > 0 {
@ -69,7 +72,7 @@ struct EnvironmentMetricsLog: View {
.chartXAxis(content: {
AxisMarks(position: .top)
})
.chartYScale(domain: 0...125)
.chartYScale(domain: format == .celsius ? -20...50 : 0...125)
.chartForegroundStyleScale([
"Temperature" : .clear
])

View file

@ -23,6 +23,7 @@ struct AdminMessageList: View {
var body: some View {
let localeDateFormat = DateFormatter.dateFormat(fromTemplate: "yyMMddjmmssa", options: 0, locale: Locale.current)
let dateFormatString = (localeDateFormat ?? "MM/dd/YY j:mm:ss a")
List {
if user != nil {
@ -47,7 +48,7 @@ struct AdminMessageList: View {
.foregroundColor(am.receivedACK ? .gray : .red)
.font(.caption2)
} else {
Text("Implicit ACK from Unknown Node")
Text("Implicit ACK from another node")
.foregroundColor(.orange)
.font(.caption2)
}