mirror of
https://github.com/neon443/ShhShell.git
synced 2026-03-11 13:26:16 +00:00
update getting hosts that use keys to use new key system
This commit is contained in:
@@ -200,10 +200,11 @@ class HostsManager: ObservableObject, @unchecked Sendable {
|
||||
return result
|
||||
}
|
||||
|
||||
func getHostsKeysUsedOn(_ keys: [Keypair]) -> [Host] {
|
||||
func getHostsUsingKeys(_ keys: [Keypair]) -> [Host] {
|
||||
var result: [Host] = []
|
||||
for key in keys {
|
||||
let hosts = hosts.filter({
|
||||
$0.privateKeyID == key.id ||
|
||||
$0.publicKey == key.publicKey &&
|
||||
$0.privateKey == key.privateKey
|
||||
})
|
||||
|
||||
@@ -20,7 +20,7 @@ struct KeyDetailView: View {
|
||||
VStack(alignment: .leading) {
|
||||
Text("Used on")
|
||||
.bold()
|
||||
ForEach(hostsManager.getHostsKeysUsedOn([keypair])) { host in
|
||||
ForEach(hostsManager.getHostsUsingKeys([keypair])) { host in
|
||||
HStack {
|
||||
SymbolPreview(symbol: host.symbol, label: host.label)
|
||||
.frame(width: 40, height: 40)
|
||||
|
||||
Reference in New Issue
Block a user