mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-27 15:17:38 +00:00
new security settings
This commit is contained in:
parent
52bded09fa
commit
a3564f4586
1 changed files with 39 additions and 25 deletions
|
|
@ -292,8 +292,7 @@ private struct SecuritySection: View {
|
||||||
}
|
}
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
.pickerStyle(.menu)
|
.pickerStyle(.menu)
|
||||||
.frame(minWidth: 120, idealWidth: 150)
|
.frame(alignment: .trailing)
|
||||||
.fixedSize()
|
|
||||||
.onChange(of: authMode) { _, newValue in
|
.onChange(of: authMode) { _, newValue in
|
||||||
// Save the authentication mode
|
// Save the authentication mode
|
||||||
UserDefaults.standard.set(newValue.rawValue, forKey: "authenticationMode")
|
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
|
// Additional info based on selected mode
|
||||||
|
|
@ -407,31 +411,41 @@ private struct AccessModeView: View {
|
||||||
let restartServerWithNewBindAddress: () -> Void
|
let restartServerWithNewBindAddress: () -> Void
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack {
|
VStack(alignment: .leading, spacing: 8) {
|
||||||
Text("Access Mode")
|
HStack {
|
||||||
.font(.callout)
|
Text("Access Mode")
|
||||||
Spacer()
|
.font(.callout)
|
||||||
Picker("", selection: $accessModeString) {
|
Spacer()
|
||||||
ForEach(DashboardAccessMode.allCases, id: \.rawValue) { mode in
|
Picker("", selection: $accessModeString) {
|
||||||
Text(mode.displayName)
|
ForEach(DashboardAccessMode.allCases, id: \.rawValue) { mode in
|
||||||
.tag(mode.rawValue)
|
Text(mode.displayName)
|
||||||
|
.tag(mode.rawValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.labelsHidden()
|
||||||
|
.onChange(of: accessModeString) { _, _ in
|
||||||
|
restartServerWithNewBindAddress()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.labelsHidden()
|
|
||||||
.onChange(of: accessModeString) { _, _ in
|
if accessMode == .network {
|
||||||
restartServerWithNewBindAddress()
|
if let ip = localIPAddress {
|
||||||
}
|
HStack {
|
||||||
}
|
Text("Dashboard available at")
|
||||||
|
.font(.caption)
|
||||||
if accessMode == .network {
|
.foregroundStyle(.secondary)
|
||||||
if let ip = localIPAddress {
|
|
||||||
Text("Dashboard available at http://\(ip):\(serverPort)")
|
if let url = URL(string: "http://\(ip):\(serverPort)") {
|
||||||
.font(.caption)
|
Link(url.absoluteString, destination: url)
|
||||||
.foregroundStyle(.secondary)
|
.font(.caption)
|
||||||
} else {
|
.foregroundStyle(.blue)
|
||||||
Text("Fetching local IP address...")
|
}
|
||||||
.font(.caption)
|
}
|
||||||
.foregroundStyle(.secondary)
|
} else {
|
||||||
|
Text("Fetching local IP address...")
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundStyle(.secondary)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue