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)

View File

@@ -119,6 +119,18 @@ namespace Navigator.ViewModels
}
}
public String SystemInfo
{
get
{
String systemInfo = "";
ServiceResult serviceResult = MarketDataServiceClient.GetInstance().GetSystemInfo();
if(serviceResult.Success)systemInfo=(String)serviceResult.ContextSpecificResult;
return "System Info: "+systemInfo;
}
}
public String ScreenDimensions
{
get

View File

@@ -74,6 +74,7 @@
</Button>
<Label Text="{Binding Status,Mode=TwoWay}" />
<Label Text="{Binding ScreenDimensions, Mode=OneWay}"/>
<Label Text="{Binding SystemInfo, Mode=OneWay}"/>
<Label Text="{Binding Date, Mode=OneWay}"/>
</StackLayout>
</StackLayout>