Refactor VPN configuration handling to remove device limit management
- Updated the VPN configuration commands and handlers to eliminate the device limit parameter, simplifying the configuration process. - Adjusted related API documentation to reflect the removal of device limit management, clarifying that this setting is now handled directly in the 3x-ui by node administrators. - Enhanced the overall codebase by removing unnecessary device limit references across various components, ensuring a cleaner and more maintainable code structure.
This commit is contained in:
@@ -18,7 +18,6 @@ public sealed class VpnConfig : Entity
|
||||
public string ClientEmail { get; private set; } = string.Empty;
|
||||
public string ClientExternalId { get; private set; } = string.Empty;
|
||||
public VpnProtocol Protocol { get; private set; }
|
||||
public int DeviceLimit { get; private set; }
|
||||
public long UsedUpBytes { get; private set; }
|
||||
public long UsedDownBytes { get; private set; }
|
||||
public DateTimeOffset? ExpiresAt { get; private set; }
|
||||
@@ -31,7 +30,7 @@ public sealed class VpnConfig : Entity
|
||||
{
|
||||
}
|
||||
|
||||
public static VpnConfig Create(Guid userId, Guid inboundId, VpnProtocol protocol, string? label, int deviceLimit)
|
||||
public static VpnConfig Create(Guid userId, Guid inboundId, VpnProtocol protocol, string? label)
|
||||
{
|
||||
return new VpnConfig
|
||||
{
|
||||
@@ -42,7 +41,6 @@ public sealed class VpnConfig : Entity
|
||||
ClientEmail = GenerateClientEmail(userId),
|
||||
ClientExternalId = string.Empty,
|
||||
Label = label,
|
||||
DeviceLimit = deviceLimit,
|
||||
Status = ConfigStatus.Active,
|
||||
SubscriptionToken = GenerateToken(),
|
||||
CreatedAt = DateTimeOffset.UtcNow,
|
||||
@@ -54,8 +52,6 @@ public sealed class VpnConfig : Entity
|
||||
|
||||
public void Rename(string? label) => Label = label;
|
||||
|
||||
public void SetDeviceLimit(int deviceLimit) => DeviceLimit = deviceLimit;
|
||||
|
||||
public void Rotate(string newClientEmail, string newClientExternalId)
|
||||
{
|
||||
EnsureActive("перевыпустить");
|
||||
|
||||
Reference in New Issue
Block a user