Skip to content

Commit 9529d1d

Browse files
authored
display license tier in settings (#1754)
1 parent 84c3be7 commit 9529d1d

6 files changed

Lines changed: 25 additions & 2 deletions

File tree

crates/defguard_core/src/enterprise/handlers/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ pub async fn check_enterprise_info(_admin: AdminRole, _session: SessionInfo) ->
5757
"valid_until": license.valid_until,
5858
"subscription": license.subscription,
5959
"expired": license.is_max_overdue(),
60-
"limits_exceeded": counts.is_over_license_limits(license)
60+
"limits_exceeded": counts.is_over_license_limits(license),
61+
"tier": license.tier
6162
}
6263
)
6364
});

web/src/i18n/en/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,9 @@ Licensing information: [https://docs.defguard.net/enterprise/license](https://do
15751575
validUntil: {
15761576
label: 'Valid until',
15771577
},
1578+
licenseTier: {
1579+
label: 'License tier',
1580+
},
15781581
},
15791582
},
15801583
},

web/src/i18n/i18n-types.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3813,6 +3813,12 @@ type RootTranslation = {
38133813
*/
38143814
label: string
38153815
}
3816+
licenseTier: {
3817+
/**
3818+
* L​i​c​e​n​s​e​ ​t​i​e​r
3819+
*/
3820+
label: string
3821+
}
38163822
}
38173823
}
38183824
}
@@ -10575,6 +10581,12 @@ export type TranslationFunctions = {
1057510581
*/
1057610582
label: () => LocalizedString
1057710583
}
10584+
licenseTier: {
10585+
/**
10586+
* License tier
10587+
*/
10588+
label: () => LocalizedString
10589+
}
1057810590
}
1057910591
}
1058010592
}

web/src/pages/settings/components/GlobalSettings/components/LicenseSettings/LicenseSettings.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,12 @@ export const LicenseSettings = ({
109109
: '-'}
110110
</p>
111111
</div>
112+
<div>
113+
<Label>
114+
{LL.settingsPage.license.licenseInfo.fields.licenseTier.label()}
115+
</Label>
116+
<p>{enterpriseInfo.tier || '-'}</p>
117+
</div>
112118
</div>
113119
) : (
114120
<p id="no-license">

web/src/pages/settings/components/GlobalSettings/components/LicenseSettings/styles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#license-info {
2727
display: grid;
28-
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
28+
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
2929
gap: 16px;
3030

3131
& > div {

web/src/shared/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,7 @@ export type EnterpriseInfo = {
11481148
subscription: boolean;
11491149
// iso utc date
11501150
valid_until: string;
1151+
tier: string;
11511152
};
11521153

11531154
export interface Webhook {

0 commit comments

Comments
 (0)