@@ -138,6 +138,9 @@ export const Settings = () => {
138
138
useState ( true ) ;
139
139
const [ formPeerApprovalEnabled , setFormPeerApprovalEnabled ] =
140
140
useState ( false ) ;
141
+
142
+ const [ assignIPv6ByDefault , setAssignIPv6ByDefault ] =
143
+ useState ( true ) ;
141
144
const [ jwtGroupsEnabled , setJwtGroupsEnabled ] = useState ( true ) ;
142
145
const [ groupsPropagationEnabled , setGroupsPropagationEnabled ] =
143
146
useState ( true ) ;
@@ -261,11 +264,13 @@ export const Settings = () => {
261
264
jwt_allow_groups : account . settings . jwt_allow_groups ? account . settings . jwt_allow_groups : [ ] ,
262
265
groups_propagation_enabled : account . settings . groups_propagation_enabled ,
263
266
peer_approval_enabled : account . settings . extra ? account . settings . extra . peer_approval_enabled : false ,
267
+ assign_ipv6_by_default : account . settings . assign_ipv6_by_default
264
268
} as FormAccount ;
265
269
setFormAccount ( fAccount ) ;
266
270
setFormPeerExpirationEnabled ( fAccount . peer_login_expiration_enabled ) ;
267
271
setFormPeerApprovalEnabled ( fAccount . peer_approval_enabled ) ;
268
272
setJwtGroupsEnabled ( fAccount . jwt_groups_enabled ) ;
273
+ setAssignIPv6ByDefault ( fAccount . assign_ipv6_by_default ) ;
269
274
setGroupsPropagationEnabled ( fAccount . groups_propagation_enabled ) ;
270
275
setJwtGroupsClaimName ( fAccount . jwt_groups_claim_name ) ;
271
276
setJwtAllowGroups ( fAccount . jwt_allow_groups ) ;
@@ -438,6 +443,8 @@ export const Settings = () => {
438
443
groups_propagation_enabled :
439
444
updatedAccount . data . settings . groups_propagation_enabled ,
440
445
peer_approval_enabled : updatedAccount . data . settings . extra ? updatedAccount . data . settings . extra . peer_approval_enabled : false ,
446
+ assign_ipv6_by_default :
447
+ updatedAccount . data . settings . assign_ipv6_by_default ,
441
448
} as FormAccount ;
442
449
setFormAccount ( fAccount ) ;
443
450
} else if ( updatedAccount . error ) {
@@ -474,6 +481,7 @@ export const Settings = () => {
474
481
jwt_allow_groups : jwtAllowGroups ,
475
482
groups_propagation_enabled : groupsPropagationEnabled ,
476
483
peer_approval_enabled : formPeerApprovalEnabled ,
484
+ assign_ipv6_by_default : assignIPv6ByDefault
477
485
} ) ;
478
486
} )
479
487
. catch ( ( errorInfo ) => {
@@ -503,6 +511,7 @@ export const Settings = () => {
503
511
jwt_groups_claim_name : jwtGroupsClaimName ,
504
512
jwt_allow_groups : jwtAllowGroups ,
505
513
groups_propagation_enabled : groupsPropagationEnabled ,
514
+ assign_ipv6_by_default : values . assign_ipv6_by_default
506
515
} ,
507
516
} as Account ;
508
517
if ( isNetBirdHosted ( ) || isLocalDev ( ) ) {
@@ -1064,6 +1073,66 @@ export const Settings = () => {
1064
1073
</ Form . Item >
1065
1074
</ Col >
1066
1075
</ Row >
1076
+ < Row >
1077
+ < Col span = { 12 } >
1078
+ < Form . Item name = "assign_ipv6_by_default" label = "" >
1079
+ < div
1080
+ style = { {
1081
+ display : "flex" ,
1082
+ gap : "15px" ,
1083
+ } }
1084
+ >
1085
+ < Switch
1086
+ onChange = { ( checked ) => {
1087
+ setAssignIPv6ByDefault ( checked ) ;
1088
+ } }
1089
+ size = "small"
1090
+ checked = { assignIPv6ByDefault }
1091
+ />
1092
+ < div >
1093
+ < label
1094
+ style = { {
1095
+ color : "rgba(0, 0, 0, 0.88)" ,
1096
+ fontSize : "14px" ,
1097
+ fontWeight : "500" ,
1098
+ } }
1099
+ >
1100
+ Assign IPv6 by default{ " " }
1101
+ < Tooltip
1102
+ title = "Determines whether hosts that support it
1103
+ automatically get assigned an IPv6 address when
1104
+ they are added to the network.
1105
+
1106
+ Note that this setting does not affect existing
1107
+ hosts."
1108
+ >
1109
+ < Text
1110
+ style = { {
1111
+ marginLeft : "5px" ,
1112
+ fontSize : "14px" ,
1113
+ color : "#bdbdbe" ,
1114
+ } }
1115
+ type = { "secondary" }
1116
+ >
1117
+ < QuestionCircleFilled />
1118
+ </ Text >
1119
+ </ Tooltip >
1120
+ </ label >
1121
+ < Paragraph
1122
+ type = { "secondary" }
1123
+ style = { {
1124
+ marginTop : "-2" ,
1125
+ fontWeight : "400" ,
1126
+ marginBottom : "0" ,
1127
+ } }
1128
+ >
1129
+ Assign an IPv6 address to new hosts that support it by default.
1130
+ </ Paragraph >
1131
+ </ div >
1132
+ </ div >
1133
+ </ Form . Item >
1134
+ </ Col >
1135
+ </ Row >
1067
1136
< Row >
1068
1137
< Col span = { 12 } >
1069
1138
< label
0 commit comments