Add inbound country flags and node load in location picker
- Inbound.CountryCode (ISO alpha-2), set on publish; flag shown before the location name (SVG via country-flag-icons on the site, emoji in bot) - Node.Capacity (optional, not a limit); available inbounds report load percent of capacity or active config count, sorted least loaded first Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d7743977a1
commit
bb5e59904f
51 files changed
+3160
-284
No files matched your search
@@ -18,6 +18,10 @@ public sealed class Inbound : Entity
|
||||
public bool IsPublished { get; private set; }
|
||||
public bool IsAvailable { get; private set; } = true;
|
||||
public string? DisplayName { get; private set; }
|
||||
|
||||
/// <summary>ISO 3166-1 alpha-2 (верхний регистр) — страна, флаг которой пользователь видит перед
|
||||
/// именем инбаунда. Только для отображения, на подключение не влияет.</summary>
|
||||
public string? CountryCode { get; private set; }
|
||||
public IReadOnlyList<Guid> AllowedRoleIds { get; private set; } = [];
|
||||
public DateTimeOffset? LastSyncAt { get; private set; }
|
||||
|
||||
@@ -57,11 +61,18 @@ public sealed class Inbound : Entity
|
||||
IsAvailable = true;
|
||||
}
|
||||
|
||||
public void Publish(string? displayName, IReadOnlyCollection<Guid> allowedRoleIds)
|
||||
public void Publish(
|
||||
string? displayName,
|
||||
string? countryCode,
|
||||
IReadOnlyCollection<Guid> allowedRoleIds
|
||||
)
|
||||
{
|
||||
IsPublished = true;
|
||||
IsAvailable = true;
|
||||
DisplayName = displayName;
|
||||
CountryCode = string.IsNullOrWhiteSpace(countryCode)
|
||||
? null
|
||||
: countryCode.Trim().ToUpperInvariant();
|
||||
AllowedRoleIds = allowedRoleIds.Distinct().ToList();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user