mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Pad lora meter a little
Auto dismiss trace route alert
This commit is contained in:
parent
ee7c2467c7
commit
8817cf7fe9
4 changed files with 27 additions and 17 deletions
|
|
@ -29,19 +29,21 @@ struct LoRaSignalStrengthMeter: View {
|
|||
.font(.caption2)
|
||||
}
|
||||
} else {
|
||||
Gauge(value: Double(signalStrength.rawValue), in: 0...3) {
|
||||
} currentValueLabel: {
|
||||
Image(systemName: "dot.radiowaves.left.and.right")
|
||||
.font(.callout)
|
||||
.frame(width: 30)
|
||||
Text("Signal \(signalStrength.description)")
|
||||
.font(UIDevice.current.userInterfaceIdiom == .phone ? .callout : .caption)
|
||||
.foregroundColor(.gray)
|
||||
.fixedSize()
|
||||
VStack {
|
||||
Gauge(value: Double(signalStrength.rawValue), in: 0...3) {
|
||||
} currentValueLabel: {
|
||||
Image(systemName: "dot.radiowaves.left.and.right")
|
||||
.font(.callout)
|
||||
.frame(width: 30)
|
||||
Text("Signal \(signalStrength.description)")
|
||||
.font(UIDevice.current.userInterfaceIdiom == .phone ? .callout : .caption)
|
||||
.foregroundColor(.gray)
|
||||
.fixedSize()
|
||||
}
|
||||
.gaugeStyle(.accessoryLinear)
|
||||
.tint(gradient)
|
||||
.font(.caption)
|
||||
}
|
||||
.gaugeStyle(.accessoryLinear)
|
||||
.tint(gradient)
|
||||
.font(.caption)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -199,9 +199,8 @@ struct NodeListItem: View {
|
|||
}
|
||||
} else {
|
||||
if node.snr != 0 && !node.viaMqtt {
|
||||
VStack(alignment: .center) {
|
||||
LoRaSignalStrengthMeter(snr: node.snr, rssi: node.rssi, preset: modemPreset, compact: true)
|
||||
}
|
||||
LoRaSignalStrengthMeter(snr: node.snr, rssi: node.rssi, preset: modemPreset, compact: true)
|
||||
.padding(.top, node.hasPositions || node.hasEnvironmentMetrics || node.hasDetectionSensorMetrics || node.hasTraceRoutes ? 0 : 15)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,9 @@ struct NodeList: View {
|
|||
)
|
||||
if positionSent {
|
||||
isPresentingPositionSentAlert = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
||||
isPresentingPositionSentAlert = false
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label("Exchange Positions", systemImage: "arrow.triangle.2.circlepath")
|
||||
|
|
@ -116,7 +119,11 @@ struct NodeList: View {
|
|||
let success = bleManager.sendTraceRouteRequest(destNum: node.user?.num ?? 0, wantResponse: true)
|
||||
if success {
|
||||
isPresentingTraceRouteSentAlert = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
||||
isPresentingTraceRouteSentAlert = false
|
||||
}
|
||||
}
|
||||
|
||||
} label: {
|
||||
Label("Trace Route", systemImage: "signpost.right.and.left")
|
||||
}
|
||||
|
|
@ -126,6 +133,9 @@ struct NodeList: View {
|
|||
let success = bleManager.requestStoreAndForwardClientHistory(fromUser: connectedNode!.user!, toUser: node.user!)
|
||||
if success {
|
||||
isPresentingClientHistorySentAlert = true
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 2.0) {
|
||||
isPresentingClientHistorySentAlert = false
|
||||
}
|
||||
}
|
||||
} label: {
|
||||
Label("Client History", systemImage: "envelope.arrow.triangle.branch")
|
||||
|
|
@ -302,7 +312,7 @@ struct NodeList: View {
|
|||
searchNodeList()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private func searchNodeList() {
|
||||
/// Case Insensitive Search Text Predicates
|
||||
let searchPredicates = ["user.userId", "user.numString", "user.hwModel", "user.longName", "user.shortName"].map { property in
|
||||
|
|
|
|||
|
|
@ -54,7 +54,6 @@ class Api : ObservableObject{
|
|||
}
|
||||
|
||||
URLSession.shared.dataTask(with: url) { data, response, error in
|
||||
let deviceHardware = try! JSONDecoder().decode([DeviceHardware].self, from: data!)
|
||||
if let data = data {
|
||||
do {
|
||||
let deviceHardware = try JSONDecoder().decode([DeviceHardware].self, from: data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue