Skip to content

Commit 3f67fd9

Browse files
committed
add force_all_traffic to enterprise settings frontend
1 parent e68aa8a commit 3f67fd9

File tree

5 files changed

+45
-1
lines changed

5 files changed

+45
-1
lines changed

web/src/i18n/en/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,6 +1713,11 @@ Licensing information: [https://docs.defguard.net/enterprise/license](https://do
17131713
helper:
17141714
'When this option is enabled, users will not be able to route all traffic through the VPN using the defguard client.',
17151715
},
1716+
forceAllTraffic: {
1717+
label: 'Force the clients to route all traffic through VPN',
1718+
helper:
1719+
'When this option is enabled, the users will always route all traffic through the VPN using the defguard client.',
1720+
},
17161721
manualConfig: {
17171722
label: "Disable users' ability to manually configure WireGuard client",
17181723
helper:

web/src/i18n/i18n-types.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,6 +4092,16 @@ type RootTranslation = {
40924092
*/
40934093
helper: string
40944094
}
4095+
forceAllTraffic: {
4096+
/**
4097+
* F​o​r​c​e​ ​t​h​e​ ​c​l​i​e​n​t​s​ ​t​o​ ​r​o​u​t​e​ ​a​l​l​ ​t​r​a​f​f​i​c​ ​t​h​r​o​u​g​h​ ​V​P​N
4098+
*/
4099+
label: string
4100+
/**
4101+
* W​h​e​n​ ​t​h​i​s​ ​o​p​t​i​o​n​ ​i​s​ ​e​n​a​b​l​e​d​,​ ​t​h​e​ ​u​s​e​r​s​ ​w​i​l​l​ ​a​l​w​a​y​s​ ​r​o​u​t​e​ ​a​l​l​ ​t​r​a​f​f​i​c​ ​t​h​r​o​u​g​h​ ​t​h​e​ ​V​P​N​ ​u​s​i​n​g​ ​t​h​e​ ​d​e​f​g​u​a​r​d​ ​c​l​i​e​n​t​.
4102+
*/
4103+
helper: string
4104+
}
40954105
manualConfig: {
40964106
/**
40974107
* D​i​s​a​b​l​e​ ​u​s​e​r​s​'​ ​a​b​i​l​i​t​y​ ​t​o​ ​m​a​n​u​a​l​l​y​ ​c​o​n​f​i​g​u​r​e​ ​W​i​r​e​G​u​a​r​d​ ​c​l​i​e​n​t
@@ -10823,6 +10833,16 @@ export type TranslationFunctions = {
1082310833
*/
1082410834
helper: () => LocalizedString
1082510835
}
10836+
forceAllTraffic: {
10837+
/**
10838+
* Force the clients to route all traffic through VPN
10839+
*/
10840+
label: () => LocalizedString
10841+
/**
10842+
* When this option is enabled, the users will always route all traffic through the VPN using the defguard client.
10843+
*/
10844+
helper: () => LocalizedString
10845+
}
1082610846
manualConfig: {
1082710847
/**
1082810848
* Disable users' ability to manually configure WireGuard client

web/src/i18n/pl/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,11 @@ Uwaga, podane tutaj konfiguracje nie posiadają klucza prywatnego. Musisz uzupe
14991499
helper:
15001500
'Kiedy ta opcja jest włączona, użytkownicy nie będą mogli przekierować całego ruchu przez VPN za pomocą klienta Defguard.',
15011501
},
1502+
forceAllTraffic: {
1503+
label: 'Wymuś przekierowanie całego ruchu przez VPN',
1504+
helper:
1505+
'Kiedy ta opcja jest włączona, użytkownicy będą zawsze przekierowywać cały ruch przez VPN za pomocą klienta Defguard.',
1506+
},
15021507
manualConfig: {
15031508
label: 'Wyłącz manualną konfigurację WireGuard',
15041509
helper:

web/src/pages/settings/components/EnterpriseSettings/components/EnterpriseForm.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const EnterpriseForm = () => {
7878
</div>
7979
<div className="helper-row">
8080
<LabeledCheckbox
81-
disabled={isLoading}
81+
disabled={isLoading || settings.force_all_traffic}
8282
label={LL.settingsPage.enterprise.fields.disableAllTraffic.label()}
8383
value={settings.disable_all_traffic}
8484
onChange={() =>
@@ -89,6 +89,19 @@ export const EnterpriseForm = () => {
8989
{parse(LL.settingsPage.enterprise.fields.disableAllTraffic.helper())}
9090
</Helper>
9191
</div>
92+
<div className="helper-row">
93+
<LabeledCheckbox
94+
disabled={isLoading || settings.disable_all_traffic}
95+
label={LL.settingsPage.enterprise.fields.forceAllTraffic.label()}
96+
value={settings.force_all_traffic}
97+
onChange={() =>
98+
mutate({ force_all_traffic: !settings.force_all_traffic })
99+
}
100+
/>
101+
<Helper>
102+
{parse(LL.settingsPage.enterprise.fields.forceAllTraffic.helper())}
103+
</Helper>
104+
</div>
92105
</div>
93106
</section>
94107
);

web/src/shared/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,6 +1124,7 @@ export type SettingsGatewayNotifications = {
11241124
export type SettingsEnterprise = {
11251125
admin_device_management: boolean;
11261126
disable_all_traffic: boolean;
1127+
force_all_traffic: boolean;
11271128
only_client_activation: boolean;
11281129
};
11291130

0 commit comments

Comments
 (0)