@@ -10,17 +10,45 @@ struct VPNState<VPN: VPNService>: View {
10
10
Group {
11
11
switch ( vpn. state, state. hasSession) {
12
12
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
+ . font ( . headline)
16
+ . foregroundColor ( . secondary)
17
+ . multilineTextAlignment ( . center)
18
+ . fixedSize ( horizontal: false , vertical: true )
19
+ . padding ( . horizontal, Theme . Size. trayInset)
20
+ . padding ( . vertical, Theme . Size. trayPadding)
21
+ . frame ( maxWidth: . infinity)
22
+ Button {
23
+ openSystemExtensionSettings ( )
24
+ } label: {
25
+ Text ( " Approve in System Settings " )
26
+ }
27
+ }
16
28
case ( _, false ) :
17
29
Text ( " Sign in to use Coder Desktop " )
18
30
. font ( . body)
19
31
. foregroundColor ( . secondary)
20
32
case ( . failed( . networkExtensionError( . unconfigured) ) , _) :
21
- Text ( " The system VPN requires reconfiguration. " )
22
- . font ( . body)
23
- . foregroundStyle ( . secondary)
33
+ VStack {
34
+ Text ( " The system VPN requires reconfiguration " )
35
+ . font ( . headline)
36
+ . foregroundColor ( . secondary)
37
+ . multilineTextAlignment ( . center)
38
+ . fixedSize ( horizontal: false , vertical: true )
39
+ . padding ( . horizontal, Theme . Size. trayInset)
40
+ . padding ( . vertical, Theme . Size. trayPadding)
41
+ . frame ( maxWidth: . infinity)
42
+ Button {
43
+ state. reconfigure ( )
44
+ } label: {
45
+ Text ( " Reconfigure VPN " )
46
+ }
47
+ } . onAppear {
48
+ // Show the prompt onAppear, so the user doesn't have to
49
+ // open the menu bar an extra time
50
+ state. reconfigure ( )
51
+ }
24
52
case ( . disabled, _) :
25
53
Text ( " Enable Coder Connect to see workspaces " )
26
54
. font ( . body)
0 commit comments