add button to copy v2ray client params
This commit is contained in:
1 parent
91920118ff
commit
7f8ab300d6
3 files changed
+18
No files matched your search
@@ -50,6 +50,14 @@ struct ContentView: View {
|
||||
if proxyManager.status == .tunnelConnected {
|
||||
ProxyInfoView(proxyUrl: proxyManager.socksUrl, onCopy: proxyManager.copyProxyUrl)
|
||||
|
||||
Button(action: { proxyManager.openHappProxy() }) {
|
||||
Label(NSLocalizedString("btn_open_in_happ", comment: ""), systemImage: "globe")
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.tint(.purple)
|
||||
.padding(.horizontal)
|
||||
|
||||
Button(action: { proxyManager.openTelegramProxy() }) {
|
||||
Label(NSLocalizedString("btn_open_in_telegram", comment: ""), systemImage: "paperplane.fill")
|
||||
.frame(maxWidth: .infinity)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"btn_stop" = "Stop";
|
||||
"btn_go" = "Go";
|
||||
"btn_done" = "Done";
|
||||
"btn_open_in_happ" = "Copy v2ray URL";
|
||||
"btn_open_in_telegram" = "Open in Telegram";
|
||||
"hint_call_link" = "VK / Telemost link or wbstream://<room-id>";
|
||||
"hint_username" = "Username";
|
||||
@@ -28,4 +29,5 @@
|
||||
"settings_vp8_fps" = "FPS";
|
||||
"settings_vp8_batch" = "Batch";
|
||||
"proxy_url_copied" = "Proxy URL copied";
|
||||
"toast_happ_params_copied" = "v2ray URL copied";
|
||||
"dc_mode_not_supported" = "DC mode not supported - falling back to video";
|
||||
@@ -401,4 +401,12 @@ class ProxyManager: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func openHappProxy() {
|
||||
let creds = "\(activeSocksUser):\(activeSocksPass)"
|
||||
let credsB64 = Data(creds.utf8).base64EncodedString()
|
||||
let proxyUri = "socks://\(credsB64)@127.0.0.1:\(socksPort)#WLB-\(socksPort)"
|
||||
UIPasteboard.general.string = proxyUri
|
||||
showToast(NSLocalizedString("toast_happ_params_copied", comment: ""))
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user