This commit is contained in:
Garth Vander Houwen 2024-08-14 14:11:08 -07:00
parent 7a4ae7957d
commit 59a104d9e9
7 changed files with 64 additions and 17 deletions

View file

@ -334,9 +334,6 @@
},
"Ack Time: %@" : {
},
"Acknowledged" : {
},
"Acknowledged by another node" : {
@ -6700,9 +6697,6 @@
},
"Drag & Drop is the recommended way to update firmware for NRF devices. If your iPhone or iPad is USB-C it will work with your regular USB-C charging cable, for lightning devices you need the Apple Lightning to USB camera adaptor." : {
},
"Each node is an available contact. Contacts with recent messages or marked as favorites show up at the top of the list. Select a contact to send or view messages. Long press to favorite or mute the contact or delete the conversation." : {
},
"echo" : {
"localizations" : {
@ -7209,6 +7203,9 @@
},
"Favorites" : {
},
"Favorites and nodes with recent messages show up at the top of the list. Contacts using the shared key display an open lock, nodes with a private key show a green lock and a red key with a slash will show up if a key has changed for a contact. Long press to favorite or mute the contact or delete a conversation." : {
},
"Fifteen Minutes" : {
@ -18446,7 +18443,18 @@
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "PKI Failed"
"value" : "Encrypted Send Failed"
}
}
}
},
"routing.pkiunknownpubkey" : {
"extractionState" : "manual",
"localizations" : {
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Unknown Public Key"
}
}
}

View file

@ -5,6 +5,7 @@
// Copyright(c) Garth Vander Houwen 8/4/22.
//
import Foundation
import SwiftUI
import MeshtasticProtobufs
enum RoutingError: Int, CaseIterable, Identifiable {
@ -22,6 +23,7 @@ enum RoutingError: Int, CaseIterable, Identifiable {
case badRequest = 32
case notAuthorized = 33
case pkiFailed = 34
case pkiUnknownPubkey = 35
var id: Int { self.rawValue }
var display: String {
@ -53,6 +55,41 @@ enum RoutingError: Int, CaseIterable, Identifiable {
return "routing.notauthorized".localized
case .pkiFailed:
return "routing.pkiFailed".localized
case .pkiUnknownPubkey:
return "routing.pkiunknownpubkey".localized
}
}
var color: Color {
switch self {
case .none:
return Color.secondary
case .noRoute:
return Color.red
case .gotNak:
return Color.red
case .timeout:
return Color.orange
case .noInterface:
return Color.red
case .maxRetransmit:
return Color.red
case .noChannel:
return Color.orange
case .tooLarge:
return Color.red
case .noResponse:
return Color.orange
case .dutyCycleLimit:
return Color.orange
case .badRequest:
return Color.red
case .notAuthorized:
return Color.red
case .pkiFailed:
return Color.red
case .pkiUnknownPubkey:
return Color.red
}
}
func protoEnumValue() -> Routing.Error {
@ -85,6 +122,8 @@ enum RoutingError: Int, CaseIterable, Identifiable {
return Routing.Error.notAuthorized
case .pkiFailed:
return Routing.Error.pkiFailed
case .pkiUnknownPubkey:
return Routing.Error.pkiFailed
}
}
}

View file

@ -370,7 +370,7 @@
{
"hwModel": 66,
"hwModelSlug": "HELTEC_VISION_MASTER_T190",
"platformioTarget": "heltec-vision-master-T190",
"platformioTarget": "heltec-vision-master-t190",
"architecture": "esp32-s3",
"activelySupported": true,
"displayName": "Heltec Vision Master T190"

View file

@ -38,7 +38,7 @@ struct ContactsTip: Tip {
}
var message: Text? {
// Text("tip.messages.contacts.message")
Text("Each node is an available contact. Contacts with recent messages or marked as favorites show up at the top of the list. Select a contact to send or view messages. Long press to favorite or mute the contact or delete the conversation.")
Text("Favorites and nodes with recent messages show up at the top of the list. Contacts using the shared key display an open lock, nodes with a private key show a green lock and a red key with a slash will show up if a key has changed for a contact. Long press to favorite or mute the contact or delete a conversation.")
}
var image: Image? {
Image(systemName: "person.circle")

View file

@ -84,16 +84,14 @@ struct ChannelMessageList: View {
}
HStack {
if currentUser && message.receivedACK {
// Ack Received
Text("Acknowledged").font(.caption2).foregroundColor(.gray)
} else if currentUser && message.ackError == 0 {
if currentUser && message.ackError == 0 {
// Empty Error
Text("Waiting to be acknowledged. . .").font(.caption2).foregroundColor(.orange)
} else if currentUser && message.ackError > 0 {
let ackErrorVal = RoutingError(rawValue: Int(message.ackError))
Text("\(ackErrorVal?.display ?? "Empty Ack Error")").fixedSize(horizontal: false, vertical: true)
.font(.caption2).foregroundColor(.red)
.foregroundStyle(ackErrorVal?.color ?? .red)
.font(.caption2)
} else if isDetectionSensorMessage {
let messageDate = message.timestamp
Text(" \(messageDate.formattedDate(format: MessageText.dateFormatString))").font(.caption2).foregroundColor(.gray)

View file

@ -185,7 +185,7 @@ struct UserList: View {
}
}
.listStyle(.plain)
.navigationTitle(String.localizedStringWithFormat("contacts %@".localized, String(users.count == 0 ? 0 : users.count - 1)))
.navigationTitle(String.localizedStringWithFormat("contacts %@".localized, String(users.count == 0 ? 0 : users.count)))
.sheet(isPresented: $isEditingFilters) {
NodeListFilter(filterTitle: "Contact Filters", viaLora: $viaLora, viaMqtt: $viaMqtt, isOnline: $isOnline, isPkiEncrypted: $isPkiEncrypted, isFavorite: $isFavorite, isEnvironment: $isEnvironment, distanceFilter: $distanceFilter, maximumDistance: $maxDistance, hopsAway: $hopsAway, roleFilter: $roleFilter, deviceRoles: $deviceRoles)
}

View file

@ -78,7 +78,9 @@ struct UserMessageList: View {
if currentUser && message.receivedACK {
// Ack Received
if message.realACK {
Text("\(ackErrorVal?.display ?? "Empty Ack Error")").font(.caption2).foregroundColor(.gray)
Text("\(ackErrorVal?.display ?? "Empty Ack Error")")
.font(.caption2)
.foregroundStyle(ackErrorVal?.color ?? Color.secondary)
} else {
Text("Acknowledged by another node").font(.caption2).foregroundColor(.orange)
}
@ -87,7 +89,7 @@ struct UserMessageList: View {
Text("Waiting to be acknowledged. . .").font(.caption2).foregroundColor(.yellow)
} else if currentUser && message.ackError > 0 {
Text("\(ackErrorVal?.display ?? "Empty Ack Error")").fixedSize(horizontal: false, vertical: true)
.font(.caption2).foregroundColor(.red)
.foregroundStyle(ackErrorVal?.color ?? Color.red)
}
}
}