Meshtastic-Apple/Meshtastic/Views/Helpers/Help/ChannelsHelp.swift

98 lines
3 KiB
Swift
Raw Permalink Normal View History

2025-06-18 17:51:09 -07:00
//
// ChannelHelp.swift
// Meshtastic
//
// Copyright(c) Garth Vander Houwen 6/18/25.
//
import SwiftUI
struct ChannelsHelp: View {
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
@Environment(\.dismiss) private var dismiss
var body: some View {
ScrollView {
Label("Channels Help", systemImage: "questionmark.circle")
.font(.title)
.padding(.vertical)
VStack(alignment: .leading) {
HStack {
CircleText(text: String(0), color: .accentColor)
.brightness(0.2)
.offset(y: -10)
Text("A channel index of 0 indicates the primary channel where broadcast packets are sent from. Location data is broadcast from the first channel where it is enabled with firmware 2.7 forward.")
2025-06-18 17:51:09 -07:00
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom)
.padding(.leading, 7)
2025-06-18 17:51:09 -07:00
}
HStack {
Image(systemName: "lock.fill")
.padding(.leading)
.padding(.trailing, 7)
2025-06-18 17:51:09 -07:00
.foregroundColor(Color.green)
.font(.title)
2025-06-18 17:51:09 -07:00
Text("A green lock means the channel is securely encrypted with either a 128 or 256 bit AES key.")
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom)
}
HStack {
Image(systemName: "lock.open.fill")
.padding(.leading)
.foregroundColor(Color.yellow)
.font(.title)
Text("A yellow open lock means the channel is not securely encrypted but it is not used for precise location data, it uses either no key at all or a 1 byte known key.")
.fixedSize(horizontal: false, vertical: true)
2025-06-18 17:51:09 -07:00
.padding(.bottom)
}
HStack {
Image(systemName: "lock.open.fill")
.padding(.leading)
.foregroundColor(Color.red)
.font(.title)
Text("A red open lock means the channel is not securely encrypted and is used for precise location data, it uses either no key at all or a 1 byte known key.")
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom)
}
HStack {
Image(systemName: "lock.open.trianglebadge.exclamationmark.fill")
.padding(.leading)
.symbolRenderingMode(.multicolor)
2025-06-18 17:51:09 -07:00
.foregroundColor(Color.red)
.font(.title)
Text("A red open lock with a warning means the channel is not securely encrypted and is used for precise location data which is being uplinked to the internet via MQTT, it uses either no key at all or a 1 byte known key.")
2025-06-18 17:51:09 -07:00
.fixedSize(horizontal: false, vertical: true)
.padding(.bottom)
}
}
#if targetEnvironment(macCatalyst)
Spacer()
Button {
dismiss()
} label: {
Label("Close", systemImage: "xmark")
}
.buttonStyle(.bordered)
.buttonBorderShape(.capsule)
.controlSize(.large)
.padding(.bottom)
#endif
}
.frame(minHeight: 0, maxHeight: .infinity, alignment: .leading)
.padding()
.presentationDetents([.large])
.presentationContentInteraction(.scrolls)
.presentationDragIndicator(.visible)
.presentationBackgroundInteraction(.enabled(upThrough: .large))
}
}
struct ChannelHelpPreviews: PreviewProvider {
static var previews: some View {
VStack {
ChannelsHelp()
}
}
}