File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
OpenHaystack/OpenHaystack/HaystackApp/Views Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,8 @@ struct AccessoryListEntry: View {
9898 }
9999 Divider ( )
100100 Button ( " Mark as \( accessory. isDeployed ? " deployable " : " deployed " ) " , action: { accessory. isDeployed. toggle ( ) } )
101+
102+ Button ( " Copy private Key B64 " , action: { copyPrivateKey ( accessory: accessory) } )
101103 }
102104 }
103105
@@ -188,6 +190,15 @@ struct AccessoryListEntry: View {
188190 assert ( false )
189191 }
190192 }
193+
194+ func copyPrivateKey( accessory: Accessory ) {
195+ let privateKey = accessory. privateKey
196+ let keyB64 = privateKey. base64EncodedString ( )
197+
198+ let pasteboard = NSPasteboard . general
199+ pasteboard. prepareForNewContents ( with: . currentHostOnly)
200+ pasteboard. setString ( keyB64, forType: . string)
201+ }
191202
192203 struct AccessoryListEntry_Previews : PreviewProvider {
193204 @StateObject static var accessory = PreviewData . accessories. first!
You can’t perform that action at this time.
0 commit comments