Add SystemInfo to AboutPage

This commit is contained in:
2025-04-09 17:24:27 -04:00
parent dea4df678d
commit a0fc6855cc
3 changed files with 38 additions and 0 deletions

View File

@@ -61,6 +61,7 @@ namespace MarketData.Service
{
return null==baseUri?"":baseUri.ToString();
}
public bool Ping(String url)
{
lock(this)
@@ -98,6 +99,30 @@ namespace MarketData.Service
}
}
}
public ServiceResult GetSystemInfo()
{
lock(this)
{
try
{
if(!IsNetworkAvailable())return new ServiceResult(false,"No network.");
StringBuilder sb = new StringBuilder();
sb.Append("/api/Ping/GetSystemInfo");
String json = httpClient.GetStringAsync(sb.ToString()).Result;
json=ToConformimgJson(json);
String accessToken = JsonConvert.DeserializeObject<String>(json);
return new ServiceResult(accessToken);
}
catch (Exception exception)
{
exceptions.Add(exception);
Debug.WriteLine(exception.ToString());
return new ServiceResult(false,exception.ToString());
}
}
}
private ServiceResult Login(String user, String password)
{
lock(this)