Fixes ngrok

This commit is contained in:
Peter Steinberger 2025-06-24 02:06:59 +02:00
parent 45fd5c476e
commit 60baba5b75

View file

@ -533,20 +533,12 @@ private struct NgrokIntegrationSection: View {
if isStartingNgrok { if isStartingNgrok {
ProgressView() ProgressView()
.scaleEffect(0.7) .scaleEffect(0.7)
} else if let status = ngrokStatus { } else if ngrokStatus != nil {
switch status { Image(systemName: "checkmark.circle.fill")
case .connected(let url): .foregroundColor(.green)
Image(systemName: "checkmark.circle.fill") Text("Connected")
.foregroundColor(.green) .font(.caption)
Text("Connected") .foregroundColor(.secondary)
.font(.caption)
.foregroundColor(.secondary)
case .disconnected:
EmptyView()
case .error:
Image(systemName: "exclamationmark.triangle.fill")
.foregroundColor(.red)
}
} }
} }
@ -562,8 +554,8 @@ private struct NgrokIntegrationSection: View {
) )
// Public URL display // Public URL display
if let status = ngrokStatus, case .connected(let url) = status { if let status = ngrokStatus {
PublicURLView(url: url) PublicURLView(url: status.publicUrl)
} }
// Error display // Error display
@ -650,7 +642,8 @@ private struct AuthTokenField: View {
return return
} }
if ngrokService.saveAuthToken(ngrokAuthToken) { ngrokService.authToken = ngrokAuthToken
if ngrokService.authToken != nil {
ngrokTokenPresent = true ngrokTokenPresent = true
tokenSaveError = nil tokenSaveError = nil
isTokenRevealed = false isTokenRevealed = false
@ -717,27 +710,6 @@ private struct ErrorView: View {
} }
} }
// MARK: - Dashboard Access Mode
enum DashboardAccessMode: String, CaseIterable {
case localhost = "localhost"
case network = "network"
var displayName: String {
switch self {
case .localhost: "Localhost Only"
case .network: "Network"
}
}
var bindAddress: String {
switch self {
case .localhost: "127.0.0.1"
case .network: "0.0.0.0"
}
}
}
// MARK: - Previews // MARK: - Previews
struct DashboardSettingsView_Previews: PreviewProvider { struct DashboardSettingsView_Previews: PreviewProvider {