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
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
func getHostsKeysUsedOn(_ keys: [Keypair]) -> [Host] {
|
func getHostsUsingKeys(_ keys: [Keypair]) -> [Host] {
|
||||||
var result: [Host] = []
|
var result: [Host] = []
|
||||||
for key in keys {
|
for key in keys {
|
||||||
let hosts = hosts.filter({
|
let hosts = hosts.filter({
|
||||||
|
$0.privateKeyID == key.id ||
|
||||||
$0.publicKey == key.publicKey &&
|
$0.publicKey == key.publicKey &&
|
||||||
$0.privateKey == key.privateKey
|
$0.privateKey == key.privateKey
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ struct KeyDetailView: View {
|
|||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text("Used on")
|
Text("Used on")
|
||||||
.bold()
|
.bold()
|
||||||
ForEach(hostsManager.getHostsKeysUsedOn([keypair])) { host in
|
ForEach(hostsManager.getHostsUsingKeys([keypair])) { host in
|
||||||
HStack {
|
HStack {
|
||||||
SymbolPreview(symbol: host.symbol, label: host.label)
|
SymbolPreview(symbol: host.symbol, label: host.label)
|
||||||
.frame(width: 40, height: 40)
|
.frame(width: 40, height: 40)
|
||||||
|
|||||||
Reference in New Issue
Block a user