mirror of
https://github.com/2dust/v2rayN.git
synced 2026-05-30 17:54:08 +00:00
Some checks are pending
release Linux / build (push) Waiting to run
release Linux / release-zip (push) Blocked by required conditions
release Linux / build and release deb x64 & arm64 (push) Waiting to run
release Linux / build and release rpm x64 & arm64 (push) Waiting to run
release Linux / build and release rpm riscv64 (push) Waiting to run
release Linux / build and release deb riscv64 (push) Waiting to run
release Linux / build and release deb loong64 (push) Waiting to run
release macOS / build (push) Waiting to run
release macOS / release-zip (push) Blocked by required conditions
release macOS / package and release macOS dmg (push) Blocked by required conditions
release Windows desktop (Avalonia UI) / build (push) Waiting to run
release Windows desktop (Avalonia UI) / release-zip (push) Blocked by required conditions
release Windows / build (push) Waiting to run
release Windows / release-zip (push) Blocked by required conditions
Fetch and display tested server IP and country (with emoji) in speed tests. Adds CountryExtension for country->emoji mapping and a new IpInfoResult type; ConnectionHandler now retrieves/parses IP API results and GetRealPingTime signature adjusted. Models and entities (ProfileItemModel, ProfileExItem, SpeedTestResult) gain IpInfo fields; ProfileExManager can store test IP info. UI/UX updated: new IpInfo column in ProfilesView (desktop and Avalonia), ResUI resource strings for "IP Info", and EServerColName ordering supports IpInfo. SpeedtestService now captures IP info and forwards it to the view model via the update function.
28 lines
739 B
C#
28 lines
739 B
C#
namespace ServiceLib.Models.Dto;
|
|
|
|
internal class IPAPIInfo
|
|
{
|
|
public string? ip { get; set; }
|
|
public string? clientIp { get; set; }
|
|
public string? ip_addr { get; set; }
|
|
public string? query { get; set; }
|
|
public string? country { get; set; }
|
|
public string? country_name { get; set; }
|
|
public string? country_code { get; set; }
|
|
public string? countryCode { get; set; }
|
|
public LocationInfo? location { get; set; }
|
|
}
|
|
|
|
public class LocationInfo
|
|
{
|
|
public string? country_code { get; set; }
|
|
}
|
|
|
|
public readonly record struct IpInfoResult(string Country, string? Ip)
|
|
{
|
|
public override string ToString()
|
|
{
|
|
var emoji = Country.CountryToEmoji();
|
|
return $"{emoji}({Country}) {Ip}";
|
|
}
|
|
}
|