Redesign dashboard

This commit is contained in:
世界
2025-11-26 22:25:51 +08:00
parent b7a810b168
commit 68b4142340
17 changed files with 759 additions and 89 deletions
@@ -0,0 +1,30 @@
import Library
import SwiftUI
public struct HTTPProxyCard: View {
@EnvironmentObject private var profile: ExtensionProfile
@Binding private var systemProxyAvailable: Bool
@Binding private var systemProxyEnabled: Bool
private let onToggle: (Bool) async -> Void
public init(
systemProxyAvailable: Binding<Bool>,
systemProxyEnabled: Binding<Bool>,
onToggle: @escaping (Bool) async -> Void
) {
_systemProxyAvailable = systemProxyAvailable
_systemProxyEnabled = systemProxyEnabled
self.onToggle = onToggle
}
public var body: some View {
DashboardCardView(title: "", isHalfWidth: false) {
Toggle("System HTTP Proxy", isOn: $systemProxyEnabled)
.onChangeCompat(of: systemProxyEnabled) { newValue in
Task {
await onToggle(newValue)
}
}
}
}
}