mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Remove sponsor link
This commit is contained in:
parent
2627858e33
commit
0aba48a447
4 changed files with 63 additions and 42 deletions
|
|
@ -86,7 +86,7 @@ extension UserDefaults {
|
|||
@UserDefault(.provideLocation, defaultValue: false)
|
||||
static var provideLocation: Bool
|
||||
|
||||
@UserDefault(.provideLocationInterval, defaultValue: 0)
|
||||
@UserDefault(.provideLocationInterval, defaultValue: 30)
|
||||
static var provideLocationInterval: Int
|
||||
|
||||
@UserDefault(.mapLayer, defaultValue: .standard)
|
||||
|
|
|
|||
|
|
@ -91,35 +91,35 @@ struct IndoorAirQuality_Previews: PreviewProvider {
|
|||
IndoorAirQuality(iaq: 351, displayMode: .dot)
|
||||
}
|
||||
}
|
||||
Text(".text")
|
||||
.font(.title)
|
||||
IndoorAirQuality(iaq: 6, displayMode: .text)
|
||||
IndoorAirQuality(iaq: 51, displayMode: .text)
|
||||
IndoorAirQuality(iaq: 101, displayMode: .text)
|
||||
IndoorAirQuality(iaq: 201, displayMode: .text)
|
||||
IndoorAirQuality(iaq: 350, displayMode: .text)
|
||||
IndoorAirQuality(iaq: 351, displayMode: .text)
|
||||
Text(".gauge")
|
||||
.font(.title)
|
||||
HStack (alignment: .top) {
|
||||
VStack{
|
||||
IndoorAirQuality(iaq: 6, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 51, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 101, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 151, displayMode: .gauge)
|
||||
}
|
||||
VStack{
|
||||
IndoorAirQuality(iaq: 201, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 251, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 301, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 350, displayMode: .gauge)
|
||||
}
|
||||
VStack{
|
||||
IndoorAirQuality(iaq: 351, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 401, displayMode: .gauge)
|
||||
IndoorAirQuality(iaq: 500, displayMode: .gauge)
|
||||
}
|
||||
}
|
||||
// Text(".text")
|
||||
// .font(.title)
|
||||
// IndoorAirQuality(iaq: 6, displayMode: .text)
|
||||
// IndoorAirQuality(iaq: 51, displayMode: .text)
|
||||
// IndoorAirQuality(iaq: 101, displayMode: .text)
|
||||
// IndoorAirQuality(iaq: 201, displayMode: .text)
|
||||
// IndoorAirQuality(iaq: 350, displayMode: .text)
|
||||
// IndoorAirQuality(iaq: 351, displayMode: .text)
|
||||
// Text(".gauge")
|
||||
// .font(.title)
|
||||
// HStack (alignment: .top) {
|
||||
// VStack{
|
||||
// IndoorAirQuality(iaq: 6, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 51, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 101, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 151, displayMode: .gauge)
|
||||
// }
|
||||
// VStack{
|
||||
// IndoorAirQuality(iaq: 201, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 251, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 301, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 350, displayMode: .gauge)
|
||||
// }
|
||||
// VStack{
|
||||
// IndoorAirQuality(iaq: 351, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 401, displayMode: .gauge)
|
||||
// IndoorAirQuality(iaq: 500, displayMode: .gauge)
|
||||
// }
|
||||
// }
|
||||
}.previewLayout(.fixed(width: 300, height: 800))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//
|
||||
import SwiftUI
|
||||
import Charts
|
||||
import UIKit
|
||||
|
||||
struct DeviceMetricsLog: View {
|
||||
|
||||
|
|
@ -86,8 +87,8 @@ struct DeviceMetricsLog: View {
|
|||
}
|
||||
.frame(minHeight: 250)
|
||||
}
|
||||
let localeDateFormat = DateFormatter.dateFormat(fromTemplate: "yyMMddjmma", options: 0, locale: Locale.current)
|
||||
let dateFormatString = (localeDateFormat ?? "MM/dd/YY j:mma").replacingOccurrences(of: ",", with: "")
|
||||
let localeDateFormat = DateFormatter.dateFormat(fromTemplate: "yyMdjmma", options: 0, locale: Locale.current)
|
||||
let dateFormatString = (localeDateFormat ?? "M/d/YY j:mma").replacingOccurrences(of: ",", with: "")
|
||||
if UIScreen.main.bounds.size.width > 768 && (UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac) {
|
||||
// Add a table for mac and ipad
|
||||
// Table(Array(deviceMetrics),id: \.self) {
|
||||
|
|
@ -111,8 +112,30 @@ struct DeviceMetricsLog: View {
|
|||
TableColumn("uptime") { dm in
|
||||
let now = Date.now
|
||||
let later = now + TimeInterval(dm.uptimeSeconds)
|
||||
let components = (now..<later).formatted(.components(style: .condensedAbbreviated))
|
||||
let components = (now..<later).formatted(.components(style: .narrow))
|
||||
Text(components)
|
||||
|
||||
let formatter = RelativeDateTimeFormatter()
|
||||
formatter.unitsStyle = .abbreviated
|
||||
//let formattedString = String(format: "%02ld%02ld", difference.hour!, difference.minute!)
|
||||
//print(formattedString)
|
||||
|
||||
// let formatter = DateComponentsFormatter()
|
||||
//
|
||||
// formatter.unitsStyle = .abbreviated
|
||||
// formatter.zeroFormattingBehavior = .dropAll
|
||||
// formatter.allowedUnits = [.day, .hour, .minute, .second]
|
||||
//formatter.unitsStyle = .narrow
|
||||
// let formattedDuration = formatter.string(from: now, to: later)
|
||||
// print(formattedDuration) // Output: "2h 30m"
|
||||
|
||||
//let formattedDuration = formatter.string(from: now, to: later)
|
||||
//print(formattedDuration) // Output: "2h 30m"
|
||||
|
||||
//let components = (now..<later).formatted(.components(style: .narrow))
|
||||
//formatter.string(from: (now..<later).duration)
|
||||
//Text(formattedDuration)
|
||||
//Text(components)
|
||||
}
|
||||
TableColumn("timestamp") { dm in
|
||||
Text(dm.time?.formattedDate(format: dateFormatString) ?? "unknown.age".localized)
|
||||
|
|
@ -122,12 +145,12 @@ struct DeviceMetricsLog: View {
|
|||
} else {
|
||||
ScrollView {
|
||||
let columns = [
|
||||
GridItem(.flexible(minimum: 25, maximum: 50), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 25, maximum: 50), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 25, maximum: 60), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 25, maximum: 60), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 25, maximum: 50), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 130, maximum: 175), spacing: 0.1)
|
||||
GridItem(.flexible(minimum: 20, maximum: 50), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 20, maximum: 50), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 20, maximum: 60), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 20, maximum: 60), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 20, maximum: 70), spacing: 0.1),
|
||||
GridItem(.flexible(minimum: 100, maximum: .infinity), spacing: 0.1)
|
||||
]
|
||||
LazyVGrid(columns: columns, alignment: .leading, spacing: 1) {
|
||||
GridRow {
|
||||
|
|
|
|||
|
|
@ -39,9 +39,7 @@ struct AboutMeshtastic: View {
|
|||
}
|
||||
}
|
||||
}
|
||||
Link("Sponsor App Development", destination: URL(string: "https://github.com/sponsors/garthvh")!)
|
||||
.font(.title2)
|
||||
Link("GitHub Repository", destination: URL(string: "https://github.com/meshtastic/Meshtastic-Apple")!)
|
||||
Link("Help with App Development", destination: URL(string: "https://github.com/meshtastic/Meshtastic-Apple")!)
|
||||
.font(.title2)
|
||||
Button("Review the app") {
|
||||
if let scene = UIApplication.shared.connectedScenes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue