improvements to settings page
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using ABI.System;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
@@ -9,7 +10,10 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Json;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using System.Text.Json;
|
||||
using Windows.Foundation;
|
||||
using Windows.Foundation.Collections;
|
||||
|
||||
@@ -26,6 +30,27 @@ namespace APIToolkit
|
||||
public Settings()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
SettingsVersionLabel.Text = $"Version {GlobalMethods.Version}";
|
||||
}
|
||||
|
||||
private async void SettingsHeadersRefresh(object sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
string SettingsHeadersResponseJSON = await GlobalMethods.WebRequest.GetStringAsync("headers");
|
||||
APIHeaders SettingsHeadersResponse = JsonSerializer.Deserialize<APIHeaders>(SettingsHeadersResponseJSON);
|
||||
|
||||
SettingsHeadersUserAgent.Text = SettingsHeadersResponse.UserAgent;
|
||||
SettingsHeadersConnectingIp.Text = SettingsHeadersResponse.CfConnectingIp;
|
||||
SettingsHeadersIpCountry.Text = SettingsHeadersResponse.CfIpCountry;
|
||||
SettingsHeadersRayId.Text = SettingsHeadersResponse.CfRay;
|
||||
}
|
||||
catch (System.Exception Error)
|
||||
{
|
||||
UIFunctions.ShowError(Settings_MainGrid.XamlRoot, Error.Message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user