Skip to content

Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic

Add release notes link to update views; update VersionInfo to include releaseNotesUrl

AnoF-Cyber2870939dc3f5
diff --git a/MacOS/ProxyBridge/ProxyBridge/UpdateCheckView.swift b/MacOS/ProxyBridge/ProxyBridge/UpdateCheckView.swift
index 37d945b..5775f25 100644
--- a/MacOS/ProxyBridge/ProxyBridge/UpdateCheckView.swift
+++ b/MacOS/ProxyBridge/ProxyBridge/UpdateCheckView.swift
@@ -45,6 +45,15 @@ struct UpdateCheckView: View {
}
.padding(.horizontal)
}
+
+ if let notes = viewModel.releaseNotesUrl, let url = URL(string: notes) {
+ Link(destination: url) {
+ HStack(spacing: 4) {
+ Image(systemName: "doc.text")
+ Text("View Release Notes")
+ }
+ }
+ }
// Error Message
if viewModel.hasError {
@@ -120,7 +129,8 @@ class UpdateCheckViewModel: ObservableObject {
@Published var isDownloading = false
@Published var downloadProgress: Double = 0
@Published var downloadStatus = ""
-
+ @Published var releaseNotesUrl: String?
+
private let updateService = UpdateService()
private var versionInfo: VersionInfo?
@@ -136,6 +146,7 @@ class UpdateCheckViewModel: ObservableObject {
currentVersion = info.currentVersion
latestVersion = info.latestVersion
isUpdateAvailable = info.isUpdateAvailable
+ releaseNotesUrl = info.isUpdateAvailable ? info.releaseNotesUrl : nil
if let error = info.error {
hasError = true
diff --git a/MacOS/ProxyBridge/ProxyBridge/UpdateNotificationView.swift b/MacOS/ProxyBridge/ProxyBridge/UpdateNotificationView.swift
index d2a20ad..59ae081 100644
--- a/MacOS/ProxyBridge/ProxyBridge/UpdateNotificationView.swift
+++ b/MacOS/ProxyBridge/ProxyBridge/UpdateNotificationView.swift
@@ -50,6 +50,15 @@ struct UpdateNotificationView: View {
Text("A new version of ProxyBridge is available!")
.multilineTextAlignment(.center)
.foregroundColor(.secondary)
+
+ if let notes = versionInfo.releaseNotesUrl, let url = URL(string: notes) {
+ Link(destination: url) {
+ HStack(spacing: 4) {
+ Image(systemName: "doc.text")
+ Text("View Release Notes")
+ }
+ }
+ }
// Download Progress
if viewModel.isDownloading {
diff --git a/MacOS/ProxyBridge/ProxyBridge/UpdateService.swift b/MacOS/ProxyBridge/ProxyBridge/UpdateService.swift
index 982eb25..b44ec44 100644
--- a/MacOS/ProxyBridge/ProxyBridge/UpdateService.swift
+++ b/MacOS/ProxyBridge/ProxyBridge/UpdateService.swift
@@ -26,6 +26,7 @@ struct VersionInfo {
let isUpdateAvailable: Bool
let downloadUrl: String?
let fileName: String?
+ let releaseNotesUrl: String?
let error: String?
}
@@ -57,6 +58,7 @@ class UpdateService {
isUpdateAvailable: isUpdateAvailable,
downloadUrl: mac.download,
fileName: fileName,
+ releaseNotesUrl: mac.releaseNotes,
error: nil
)
} catch {
@@ -159,6 +161,7 @@ class UpdateService {
isUpdateAvailable: false,
downloadUrl: nil,
fileName: nil,
+ releaseNotesUrl: nil,
error: message
)
}