Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions crates/defguard_proxy_manager/src/servers/enrollment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -727,20 +727,21 @@ impl EnrollmentServer {
if let Some(location) = WireguardNetwork::find_by_id(&mut *transaction, location_id)
.await
.map_err(|err| {
error!("Failed to fetch WireguardNetwork with ID {location_id}: {err}",);
error!("Failed to fetch WireguardNetwork with ID {location_id}: {err}");
Status::internal("unexpected error")
})?
{
if let Some(firewall_config) =
try_get_location_firewall_config(&location, &mut transaction)
.await
.map_err(|err| {
error!("Failed to get firewall config for location {location}: {err}",);
error!("Failed to get firewall config for location {location}: {err}");
Status::internal("unexpected error")
})?
{
debug!(
"Sending firewall config update for location {location} affected by adding new device {}, user {}({})",
"Sending firewall config update for location {location} affected by \
adding new device {}, user {}({})",
device.wireguard_pubkey, user.username, user.id
);
self.send_wireguard_event(GatewayEvent::FirewallConfigChanged(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,26 +104,6 @@ const getLicenseLimitConflicts = ({
});
}

const currentDevices = counts.user_device + counts.network_device;
if (currentDevices > limits.devices) {
conflicts.push({
label: 'Devices',
current: currentDevices,
limit: limits.devices,
});
}

if (
isPresent(limits.network_devices) &&
counts.network_device > limits.network_devices
) {
conflicts.push({
label: 'Network devices',
current: counts.network_device,
limit: limits.network_devices,
});
}

return conflicts;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,6 @@ const ModalContent = ({ conflicts }: OpenLicenseLimitConflictModal) => {
{`To apply this license, first reduce your usage so it fits within the license limits.`}
</AppText>
<SizedBox height={ThemeSpacing.Lg} />
<AppText font={TextStyle.TBodySm400} color={ThemeVariable.FgNeutral}>
{`You can also upgrade your plan to the one with higher limits such as:`}
<br />
{`• 30 users or more`}
<br />
{`• 5 locations or more`}
</AppText>
<SizedBox height={ThemeSpacing.Lg} />
<AppText font={TextStyle.TBodyXs400} color={ThemeVariable.FgMuted}>
{`No changes were made to your current configuration.`}
</AppText>
{conflicts.length > 0 && (
<div>
{conflicts.map((conflict) => (
Expand All @@ -92,6 +81,10 @@ const ModalContent = ({ conflicts }: OpenLicenseLimitConflictModal) => {
))}
</div>
)}
<SizedBox height={ThemeSpacing.Lg} />
<AppText font={TextStyle.TBodyXs400} color={ThemeVariable.FgMuted}>
{`No changes were made to your current configuration.`}
</AppText>
<LicenseModalControls modalName={modalNameKey} />
</>
);
Expand Down
Loading