From 5852aa31f5142133597d6885febd81af80888607 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Mon, 19 Aug 2024 15:06:53 -0700 Subject: [PATCH] Admin drop down updates to redice the number of nodes. --- Localizable.xcstrings | 10 ++++++++-- Meshtastic/Views/Settings/Settings.swift | 17 ++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Localizable.xcstrings b/Localizable.xcstrings index b9858fe8..c518a26f 100644 --- a/Localizable.xcstrings +++ b/Localizable.xcstrings @@ -17261,7 +17261,10 @@ "Remote administration for: %@" : { }, - "Remote: %@" : { + "Remote Legacy Admin: %@" : { + + }, + "Remote PKI Admin: %@" : { }, "Remove" : { @@ -17331,7 +17334,10 @@ } } }, - "Request Admin: %@" : { + "Request Legacy Admin: %@" : { + + }, + "Request PKI Admin: %@" : { }, "Requires that there be an accelerometer on your device." : { diff --git a/Meshtastic/Views/Settings/Settings.swift b/Meshtastic/Views/Settings/Settings.swift index 4bf75555..814f3ab9 100644 --- a/Meshtastic/Views/Settings/Settings.swift +++ b/Meshtastic/Views/Settings/Settings.swift @@ -364,21 +364,28 @@ struct Settings: View { .tag(Int(node.num)) } else if node.canRemoteAdmin && UserDefaults.enableAdministration && node.sessionPasskey != nil { /// Nodes using the new PKI system Label { - Text("Remote: \(node.user?.longName ?? "unknown".localized)") + Text("Remote PKI Admin: \(node.user?.longName ?? "unknown".localized)") } icon: { Image(systemName: "av.remote") } .tag(Int(node.num)) - } else if node.metadata != nil { /// Nodes using the old admin system + } else if !UserDefaults.enableAdministration && node.metadata != nil { /// Nodes using the old admin system Label { - Text("Remote: \(node.user?.longName ?? "unknown".localized)") + Text("Remote Legacy Admin: \(node.user?.longName ?? "unknown".localized)") } icon: { Image(systemName: "av.remote") } .tag(Int(node.num)) - } else { + } else if UserDefaults.enableAdministration && node.user?.pkiEncrypted ?? false { Label { - Text("Request Admin: \(node.user?.longName ?? "unknown".localized)") + Text("Request PKI Admin: \(node.user?.longName ?? "unknown".localized)") + } icon: { + Image(systemName: "rectangle.and.hand.point.up.left") + } + .tag(Int(node.num)) + } else if !UserDefaults.enableAdministration { + Label { + Text("Request Legacy Admin: \(node.user?.longName ?? "unknown".localized)") } icon: { Image(systemName: "rectangle.and.hand.point.up.left") }