This commit is contained in:
bnux 2026-04-18 10:37:06 -07:00 committed by GitHub
commit 35ea3690e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,9 +21,15 @@ struct AppLog: View {
@State private var levels: Set<Int> = []
@State var isExporting = false
@State var exportString = ""
@State var exportFilename = "Meshtastic Application Logs"
@State var isEditingFilters = false
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
private static let logFileDateFormatter: DateFormatter = {
let f = DateFormatter()
f.dateFormat = "yyyy-MM-dd_HHmmss"
return f
}()
private let dateFormatStyle = Date.FormatStyle()
.hour(.twoDigits(amPM: .omitted))
.minute()
@ -171,7 +177,7 @@ struct AppLog: View {
isPresented: $isExporting,
document: CsvDocument(emptyCsv: exportString),
contentType: .commaSeparatedText,
defaultFilename: String("Meshtastic Application Logs"),
defaultFilename: exportFilename,
onCompletion: { result in
switch result {
case .success:
@ -200,6 +206,7 @@ struct AppLog: View {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
exportString = logToCsvFile(log: logs)
exportFilename = "Meshtastic Application Logs \(Self.logFileDateFormatter.string(from: .now))"
isExporting = true
}) {
Image(systemName: "square.and.arrow.down")