mirror of
https://github.com/insidegui/VirtualBuddy.git
synced 2026-12-02 03:29:20 +08:00
* Implement support for managed preferences; allow disabling shared folders with managed preferences * Implement managed preferences for USB passthrough, bridged networking, guest app, and microphone input * Implement unified UI component for informing user about managed preference restrictions
35 lines
1.2 KiB
Swift
35 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct ManagedRestrictionBannerView: View {
|
|
var title: LocalizedStringResource
|
|
|
|
@State private var isShowingHelp = false
|
|
|
|
var body: some View {
|
|
Button {
|
|
isShowingHelp.toggle()
|
|
} label: {
|
|
Label(title, systemImage: "lock.shield")
|
|
.font(.headline.weight(.medium))
|
|
.foregroundStyle(.primary)
|
|
.padding(.horizontal, 10)
|
|
.padding(.vertical, 8)
|
|
.frame(maxWidth: .infinity, alignment: .leading)
|
|
.airGlassEffect(.regular.tint(.purple), in: RoundedRectangle(cornerRadius: 12))
|
|
}
|
|
.buttonStyle(.plain)
|
|
.alert("Managed Preferences", isPresented: $isShowingHelp) {
|
|
Button("OK") { isShowingHelp = false }
|
|
} message: {
|
|
Text("A configuration profile applied by your organization is blocking this feature in VirtualBuddy. For more information, please contact your system administrator or IT department.")
|
|
}
|
|
}
|
|
}
|
|
|
|
#if DEBUG
|
|
#Preview {
|
|
ManagedRestrictionBannerView(title: "USB passthrough is disabled by your organization.")
|
|
.frame(width: 600, height: 600)
|
|
}
|
|
#endif
|