-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
Meshtastic/Views/Nodes/Helpers/Actions/TraceRouteButton.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import SwiftUI | ||
|
||
struct TraceRouteButton: View { | ||
var bleManager: BLEManager | ||
|
||
var node: NodeInfoEntity | ||
|
||
@State | ||
private var isPresentingTraceRouteSentAlert: Bool = false | ||
|
||
var body: some View { | ||
Button { | ||
isPresentingTraceRouteSentAlert = bleManager.sendTraceRouteRequest( | ||
destNum: node.user?.num ?? 0, | ||
wantResponse: true | ||
) | ||
} label: { | ||
Label { | ||
Text("Trace Route") | ||
} icon: { | ||
Image(systemName: "signpost.right.and.left") | ||
.symbolRenderingMode(.hierarchical) | ||
} | ||
}.alert( | ||
"Trace Route Sent", | ||
isPresented: $isPresentingTraceRouteSentAlert | ||
) { | ||
Button("OK") { }.keyboardShortcut(.defaultAction) | ||
} message: { | ||
Text("This could take a while. The response will appear in the trace route log for the node it was sent to.") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters