Windows 0.3.5 traffic trends UI source delta; connection fixes retained; no private history or other platform changes
This commit is contained in:
@@ -65,12 +65,13 @@ internal sealed class VpnApiClient : IDisposable
|
||||
return await GitReleaseUpdater.GetLatestAsync(cancellationToken);
|
||||
}
|
||||
|
||||
internal async Task<NodeTrafficSnapshot> GetNodeTrafficAsync(string token, CancellationToken cancellationToken)
|
||||
internal async Task<NodeTrafficSnapshot> GetNodeTrafficAsync(string token, CancellationToken cancellationToken,DateTimeOffset? since=null)
|
||||
{
|
||||
using var deadline = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
|
||||
deadline.CancelAfter(TimeSpan.FromSeconds(3));
|
||||
using var request = AuthorizedRequest(HttpMethod.Get, "api/v1/client/node-traffic/", token);
|
||||
return await SendAsync<NodeTrafficSnapshot>(request, deadline.Token, maximumBodyBytes: 32 * 1024);
|
||||
deadline.CancelAfter(TimeSpan.FromSeconds(since.HasValue?3:8));
|
||||
var path="api/v1/client/node-traffic/"+(since is { } cursor?"?since="+Uri.EscapeDataString(cursor.ToString("O")):"");
|
||||
using var request = AuthorizedRequest(HttpMethod.Get, path, token);
|
||||
return await SendAsync<NodeTrafficSnapshot>(request, deadline.Token, maximumBodyBytes: 1024 * 1024);
|
||||
}
|
||||
|
||||
internal async Task<ConfigResponse> GetConfigAsync(string token, string nodeSlug, string routeMode, CancellationToken cancellationToken, IEnumerable<string>? excluded = null)
|
||||
|
||||
Reference in New Issue
Block a user