This commit is contained in:
zeus
2025-01-22 16:22:33 +08:00
parent 09b9cec8ec
commit 738c373a77
2534 changed files with 0 additions and 486292 deletions
@@ -1,79 +0,0 @@
import Library
import SwiftUI
@MainActor
public struct InstallProfileButton: View {
private let callback: (Error?) async -> Void
public init(_ callback: @escaping ((Error?) async -> Void)) {
self.callback = callback
}
public var body: some View {
parsePowerButton()
/* FormButton {
Task {
await installProfile()
}
} label: {
Label("VPN", systemImage: "lock.doc.fill")
.font(.title3)
.padding(15)
.foregroundColor(.red)
.background(
RoundedRectangle(cornerRadius: 10)
.strokeBorder(.white.opacity(0.25),lineWidth: 1)
)
}
.alertBinding($alert)*/
}
@ViewBuilder
func parsePowerButton()->some View{
Button {
Task {
await installProfile()
}
} label: {
ZStack{
ZStack{
//
// LottieView(animationFileName: "1d2a0fe5" , loopMode: .loop)
LottieView(animationFileName: "8dfa14a6" , loopMode: .loop).scaleEffect(0.2)
Text("开启服务").bold().font(.title2).foregroundStyle(Color.white)
}
}
// Max Frame...
.frame(width: 190,height: 190)
}.padding()
}
private func installProfile() async {
print("installProfile...")
do {
try await ExtensionProfile.install()
await callback(nil)
} catch {
print("installProfile: \(error.localizedDescription)")
await callback(error)
// alert = Alert(error)
}
}
}