@@ -10,17 +10,43 @@ struct VPNState<VPN: VPNService>: View {
1010 Group {
1111 switch ( vpn. state, state. hasSession) {
1212 case ( . failed( . systemExtensionError( . needsUserApproval) ) , _) :
13- Text ( " Awaiting System Extension approval " )
14- . font ( . body)
15- . foregroundStyle ( . secondary)
13+ VStack {
14+ Text ( " Awaiting System Extension approval " )
15+ . foregroundColor ( . secondary)
16+ . multilineTextAlignment ( . center)
17+ . fixedSize ( horizontal: false , vertical: true )
18+ . padding ( . horizontal, Theme . Size. trayInset)
19+ . padding ( . vertical, Theme . Size. trayPadding)
20+ . frame ( maxWidth: . infinity)
21+ Button {
22+ openSystemExtensionSettings ( )
23+ } label: {
24+ Text ( " Approve in System Settings " )
25+ }
26+ }
1627 case ( _, false ) :
1728 Text ( " Sign in to use Coder Desktop " )
1829 . font ( . body)
1930 . foregroundColor ( . secondary)
2031 case ( . failed( . networkExtensionError( . unconfigured) ) , _) :
21- Text ( " The system VPN requires reconfiguration. " )
22- . font ( . body)
23- . foregroundStyle ( . secondary)
32+ VStack {
33+ Text ( " The system VPN requires reconfiguration " )
34+ . foregroundColor ( . secondary)
35+ . multilineTextAlignment ( . center)
36+ . fixedSize ( horizontal: false , vertical: true )
37+ . padding ( . horizontal, Theme . Size. trayInset)
38+ . padding ( . vertical, Theme . Size. trayPadding)
39+ . frame ( maxWidth: . infinity)
40+ Button {
41+ state. reconfigure ( )
42+ } label: {
43+ Text ( " Reconfigure VPN " )
44+ }
45+ } . onAppear {
46+ // Show the prompt onAppear, so the user doesn't have to
47+ // open the menu bar an extra time
48+ state. reconfigure ( )
49+ }
2450 case ( . disabled, _) :
2551 Text ( " Enable Coder Connect to see workspaces " )
2652 . font ( . body)
0 commit comments