App updates

This commit is contained in:
Neil Alexander 2024-04-16 21:35:51 +01:00
parent 2cb5eebcd2
commit 5fbb735f56
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944
9 changed files with 204 additions and 91 deletions

View file

@ -93,6 +93,8 @@ struct StatusView: View {
Text(appDelegate.yggdrasilVersion())
.foregroundColor(Color.gray)
}
}, header: {
Text("Status")
})
Section(content: {
@ -114,7 +116,7 @@ struct StatusView: View {
.lineLimit(1)
.textSelection(.enabled)
}
HStack {
/*HStack {
Text("Coordinates")
Spacer()
Text(appDelegate.yggdrasilCoords)
@ -122,7 +124,7 @@ struct StatusView: View {
.truncationMode(.tail)
.lineLimit(1)
.textSelection(.enabled)
}
}*/
HStack {
Text("Public Key")
Spacer()
@ -133,7 +135,35 @@ struct StatusView: View {
.lineLimit(1)
.textSelection(.enabled)
}
}, header: {
Text("Details")
})
if self.appDelegate.yggdrasilEnabled {
Section(content: {
List(self.appDelegate.yggdrasilPeers.sorted(by: { a, b in
a.key < a.key
}), id: \.remote) { peer in
VStack {
Text(peer.remote)
.frame(maxWidth: .infinity, alignment: .leading)
.truncationMode(.tail)
.lineLimit(1)
.textSelection(.enabled)
Text(peer.address)
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(Color.gray)
.font(.system(size: 11, design: .monospaced))
.truncationMode(.tail)
.lineLimit(1)
.textSelection(.enabled)
}
.padding(.all, 2)
}
}, header: {
Text("Peers")
})
}
}
.formStyle(.grouped)
.navigationTitle("Yggdrasil")