mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Tighten up the hardware card
This commit is contained in:
parent
7dae25d949
commit
24a4f709fa
2 changed files with 32 additions and 31 deletions
|
|
@ -20,54 +20,56 @@ struct NodeInfoItem: View {
|
|||
|
||||
var body: some View {
|
||||
ViewThatFits(in: .horizontal) {
|
||||
HStack {
|
||||
Spacer()
|
||||
CircleText(
|
||||
text: node.user?.shortName ?? "?",
|
||||
color: Color(UIColor(hex: UInt32(node.num))),
|
||||
circleSize: 75
|
||||
)
|
||||
VStack {
|
||||
if let user = node.user {
|
||||
VStack(alignment: .center) {
|
||||
HStack(alignment: .center) {
|
||||
if user.hwModel != "UNSET" {
|
||||
Image(user.hardwareImage ?? "UNSET")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 65, height: 65)
|
||||
.frame(width: 75, height: 75)
|
||||
.cornerRadius(5)
|
||||
Text(String(node.user!.hwModel ?? "unset".localized))
|
||||
.font(.caption2)
|
||||
.frame(maxWidth: 80)
|
||||
.font(.callout)
|
||||
} else {
|
||||
Image(systemName: "person.crop.circle.badge.questionmark")
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
.frame(width: 65, height: 65)
|
||||
.frame(width: 75, height: 75)
|
||||
.cornerRadius(5)
|
||||
Text(String("incomplete".localized))
|
||||
.font(.caption)
|
||||
.frame(maxWidth: 80)
|
||||
.font(.callout)
|
||||
}
|
||||
}
|
||||
}
|
||||
if node.snr != 0 && !node.viaMqtt {
|
||||
VStack(alignment: .center) {
|
||||
let signalStrength = getLoRaSignalStrength(snr: node.snr, rssi: node.rssi, preset: modemPreset)
|
||||
LoRaSignalStrengthIndicator(signalStrength: signalStrength)
|
||||
Text("Signal \(signalStrength.description)").font(.footnote)
|
||||
Text("SNR \(String(format: "%.2f", node.snr))dB")
|
||||
.foregroundColor(getSnrColor(snr: node.snr, preset: modemPreset))
|
||||
.font(.caption2)
|
||||
Text("RSSI \(node.rssi)dB")
|
||||
.foregroundColor(getRssiColor(rssi: node.rssi))
|
||||
.font(.caption)
|
||||
HStack {
|
||||
Spacer()
|
||||
CircleText(
|
||||
text: node.user?.shortName ?? "?",
|
||||
color: Color(UIColor(hex: UInt32(node.num))),
|
||||
circleSize: 75
|
||||
)
|
||||
if node.snr != 0 && !node.viaMqtt {
|
||||
VStack(alignment: .center) {
|
||||
let signalStrength = getLoRaSignalStrength(snr: node.snr, rssi: node.rssi, preset: modemPreset)
|
||||
LoRaSignalStrengthIndicator(signalStrength: signalStrength)
|
||||
Text("Signal \(signalStrength.description)").font(.footnote)
|
||||
Text("SNR \(String(format: "%.2f", node.snr))dB")
|
||||
.foregroundColor(getSnrColor(snr: node.snr, preset: modemPreset))
|
||||
.font(.caption2)
|
||||
Text("RSSI \(node.rssi)dB")
|
||||
.foregroundColor(getRssiColor(rssi: node.rssi))
|
||||
.font(.caption)
|
||||
}
|
||||
.frame(minWidth: 110, maxWidth: 175)
|
||||
} else {
|
||||
Spacer()
|
||||
}
|
||||
.frame(minWidth: 110, maxWidth: 175)
|
||||
if node.telemetries?.count ?? 0 > 0 {
|
||||
BatteryGauge(node: node)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
if node.telemetries?.count ?? 0 > 0 {
|
||||
BatteryGauge(node: node)
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ struct NodeListItem: View {
|
|||
LazyVStack(alignment: .leading) {
|
||||
HStack {
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
CircleText(text: node.user?.shortName ?? "?", color: Color(UIColor(hex: UInt32(node.num))), circleSize: 70)
|
||||
.padding(.trailing, 5)
|
||||
BatteryLevelCompact(node: node, font: .caption, iconFont: .callout, color: .accentColor)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue