new security settings

This commit is contained in:
Peter Steinberger 2025-06-24 02:41:00 +02:00
parent 52bded09fa
commit a3564f4586

View file

@ -292,8 +292,7 @@ private struct SecuritySection: View {
}
.labelsHidden()
.pickerStyle(.menu)
.frame(minWidth: 120, idealWidth: 150)
.fixedSize()
.frame(alignment: .trailing)
.onChange(of: authMode) { _, newValue in
// Save the authentication mode
UserDefaults.standard.set(newValue.rawValue, forKey: "authenticationMode")
@ -305,6 +304,11 @@ private struct SecuritySection: View {
}
}
Text(authMode.description)
.font(.caption)
.foregroundStyle(.secondary)
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)
}
// Additional info based on selected mode
@ -407,6 +411,7 @@ private struct AccessModeView: View {
let restartServerWithNewBindAddress: () -> Void
var body: some View {
VStack(alignment: .leading, spacing: 8) {
HStack {
Text("Access Mode")
.font(.callout)
@ -425,9 +430,17 @@ private struct AccessModeView: View {
if accessMode == .network {
if let ip = localIPAddress {
Text("Dashboard available at http://\(ip):\(serverPort)")
HStack {
Text("Dashboard available at")
.font(.caption)
.foregroundStyle(.secondary)
if let url = URL(string: "http://\(ip):\(serverPort)") {
Link(url.absoluteString, destination: url)
.font(.caption)
.foregroundStyle(.blue)
}
}
} else {
Text("Fetching local IP address...")
.font(.caption)
@ -436,6 +449,7 @@ private struct AccessModeView: View {
}
}
}
}
// MARK: - Port Configuration View