diff --git a/Meshtastic/Views/Nodes/LocationHistory.swift b/Meshtastic/Views/Nodes/LocationHistory.swift index 3a34d5ac..e54c2d43 100644 --- a/Meshtastic/Views/Nodes/LocationHistory.swift +++ b/Meshtastic/Views/Nodes/LocationHistory.swift @@ -68,20 +68,19 @@ struct LocationHistory: View { .foregroundColor(.gray) .font(.caption) + } + + HStack { + Image(systemName: "arrow.up.arrow.down.circle") .font(.subheadline) .foregroundColor(.accentColor) .symbolRenderingMode(.hierarchical) Text("Alt:") .font(.caption) - Text("\(String(mappin.altitude))m") .foregroundColor(.gray) .font(.caption) - } - - HStack { - Image(systemName: "clock.badge.checkmark.fill") .font(.subheadline) .foregroundColor(.accentColor) @@ -98,7 +97,6 @@ struct LocationHistory: View { } } } - .padding() .navigationTitle("Location History \(node.positions?.count ?? 0) Points") .navigationBarTitleDisplayMode(.inline) .navigationBarItems(trailing: diff --git a/Meshtastic/Views/Nodes/NodeDetail.swift b/Meshtastic/Views/Nodes/NodeDetail.swift index 7d60d4d8..45b270c1 100644 --- a/Meshtastic/Views/Nodes/NodeDetail.swift +++ b/Meshtastic/Views/Nodes/NodeDetail.swift @@ -63,13 +63,9 @@ struct NodeDetail: View { } ) } - .ignoresSafeArea(.all, edges: [.leading, .trailing]) .frame(idealWidth: bounds.size.width, minHeight: bounds.size.height / 2) } - - - } } else { @@ -79,46 +75,9 @@ struct NodeDetail: View { .cornerRadius(10) .frame(width: bounds.size.width, height: bounds.size.height / 2) } - - List { - - if (node.positions?.count ?? 0) > 0 { - - NavigationLink { - LocationHistory(node: node) - } label: { - - Image(systemName: "building.columns") - .symbolRenderingMode(.hierarchical) - .font(.title) - - Text("Position History \(node.positions?.count ?? 0) Points") - .font(.title2) - } - .fixedSize(horizontal: false, vertical: true) - } - - NavigationLink { - TelemetryLog(node: node) - } label: { - - Image(systemName: "chart.xyaxis.line") - .symbolRenderingMode(.hierarchical) - .font(.title) - - Text("Telemetry Log \(node.telemetries?.count ?? 0) Readings") - .font(.title2) - } - .fixedSize(horizontal: false, vertical: true) - - } - .frame(height: 160) - ScrollView { - - - + if self.bleManager.connectedPeripheral != nil && self.bleManager.connectedPeripheral.num == node.num && self.bleManager.connectedPeripheral.num == node.num { HStack { @@ -263,12 +222,12 @@ struct NodeDetail: View { } .padding() } + Divider() } .padding() - - Divider() HStack(alignment: .center) { + VStack { HStack { Image(systemName: "person") @@ -398,6 +357,8 @@ struct NodeDetail: View { } .padding(4) + Divider() + HStack(alignment: .center) { VStack { HStack { @@ -431,8 +392,42 @@ struct NodeDetail: View { Text("MAC Address: ") Text(String(node.user?.macaddr?.macAddressString ?? "not a valid mac address")).foregroundColor(.gray) } - .padding() } + + List { + + if (node.positions?.count ?? 0) > 0 { + + NavigationLink { + LocationHistory(node: node) + } label: { + + Image(systemName: "building.columns") + .symbolRenderingMode(.hierarchical) + .font(.title) + + Text("Position History \(node.positions?.count ?? 0) Points") + .font(.title3) + } + .fixedSize(horizontal: false, vertical: true) + } + if (node.telemetries?.count ?? 0) > 0 { + NavigationLink { + TelemetryLog(node: node) + } label: { + + Image(systemName: "chart.xyaxis.line") + .symbolRenderingMode(.hierarchical) + .font(.title) + + Text("Telemetry Log \(node.telemetries?.count ?? 0) Readings") + .font(.title3) + } + .fixedSize(horizontal: false, vertical: true) + } + } + .listStyle(GroupedListStyle()) + .frame(minHeight:170) } } .edgesIgnoringSafeArea([.leading, .trailing]) diff --git a/Meshtastic/Views/Nodes/TelemetryLog.swift b/Meshtastic/Views/Nodes/TelemetryLog.swift index b6e471c2..9f5a7c12 100644 --- a/Meshtastic/Views/Nodes/TelemetryLog.swift +++ b/Meshtastic/Views/Nodes/TelemetryLog.swift @@ -177,10 +177,15 @@ struct TelemetryLog: View { // Device Metrics VStack { - - + HStack { + + Spacer() Text("Device Metrics") .font(.title) + Spacer() + } + + HStack { BatteryIcon(batteryLevel: tel.batteryLevel, font: .callout, color: .accentColor) @@ -329,8 +334,6 @@ struct TelemetryLog: View { } } } - - .padding() .navigationTitle("Telemetry Log \(node.telemetries?.count ?? 0) Readings") .navigationBarTitleDisplayMode(.inline) .navigationBarItems(trailing: