commit changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||||
@@ -14,8 +14,9 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="Assets\Subject.png" />
|
<None Remove="Assets\Subject.png" />
|
||||||
|
<None Remove="SendEmail.xaml" />
|
||||||
<None Remove="Settings.xaml" />
|
<None Remove="Settings.xaml" />
|
||||||
<None Remove="URLShortener.xaml" />
|
<None Remove="TokenManagement.xaml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -44,6 +45,16 @@
|
|||||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
|
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
|
||||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
|
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="TokenManagement.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Page Update="SendEmail.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="Settings.xaml">
|
<Page Update="Settings.xaml">
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
@@ -33,6 +34,8 @@ namespace APIToolkit
|
|||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
this.InitializeComponent();
|
this.InitializeComponent();
|
||||||
|
GlobalMethods.WebRequest.BaseAddress = new Uri("https://enstrayed.com/api/"); // Set base address for web requests being made
|
||||||
|
GlobalMethods.WebRequest.DefaultRequestHeaders.UserAgent.ParseAdd($"DotNet/{Environment.Version} APIToolkit/{GlobalMethods.Version}"); // Set user agent of client
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -47,4 +50,10 @@ namespace APIToolkit
|
|||||||
|
|
||||||
private Window? m_window;
|
private Window? m_window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static class GlobalMethods
|
||||||
|
{
|
||||||
|
public static HttpClient WebRequest = new();
|
||||||
|
public static string Version = "1.0";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ using System.Text;
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace APIToolkit
|
namespace APIToolkit.Classes
|
||||||
{
|
{
|
||||||
public record class APIHeaders
|
public record class APIHeaders
|
||||||
{
|
{
|
||||||
@@ -19,7 +19,7 @@ namespace APIToolkit
|
|||||||
public required string CfIpCountry { get; set; }
|
public required string CfIpCountry { get; set; }
|
||||||
|
|
||||||
[JsonPropertyName("cf-ray")]
|
[JsonPropertyName("cf-ray")]
|
||||||
public required string CfRay { get; set; }
|
public required string CfRay { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,7 @@ using System.Text;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Windows.Foundation.Metadata;
|
using Windows.Foundation.Metadata;
|
||||||
|
|
||||||
namespace APIToolkit
|
namespace APIToolkit.Classes
|
||||||
{
|
{
|
||||||
public class UIFunctions
|
public class UIFunctions
|
||||||
{
|
{
|
||||||
@@ -6,6 +6,7 @@ using System.Linq;
|
|||||||
using System.Net.Http;
|
using System.Net.Http;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.InteropServices.WindowsRuntime;
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using APIToolkit.Classes;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
@@ -31,9 +32,6 @@ namespace APIToolkit
|
|||||||
this.SetTitleBar(AppTitleBar);
|
this.SetTitleBar(AppTitleBar);
|
||||||
|
|
||||||
ContentArea.Navigate(typeof(URLShortener)); // Set default page
|
ContentArea.Navigate(typeof(URLShortener)); // Set default page
|
||||||
|
|
||||||
GlobalMethods.WebRequest.BaseAddress = new Uri("https://enstrayed.com/api/"); // Set base address for web requests being made
|
|
||||||
GlobalMethods.WebRequest.DefaultRequestHeaders.UserAgent.ParseAdd($"DotNet/{Environment.Version} APIToolkit/{GlobalMethods.Version}"); // Set user agent of client
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
|
private void NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
|
||||||
@@ -57,10 +55,6 @@ namespace APIToolkit
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class GlobalMethods
|
|
||||||
{
|
|
||||||
public static HttpClient WebRequest = new();
|
|
||||||
public static string Version = "1.0";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Page
|
<Page
|
||||||
x:Class="APIToolkit.URLShortener"
|
x:Class="APIToolkit.SendEmail"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="using:APIToolkit"
|
xmlns:local="using:APIToolkit"
|
||||||
@@ -9,6 +9,6 @@
|
|||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Button Content="URlShortener"/>
|
<Button Content="SendEmail"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
31
Pages/SendEmail.xaml.cs
Normal file
31
Pages/SendEmail.xaml.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace APIToolkit
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class SendEmail : Page
|
||||||
|
{
|
||||||
|
public SendEmail()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
@@ -22,7 +21,7 @@
|
|||||||
|
|
||||||
<!--Margin: Left Top Right Bottom-->
|
<!--Margin: Left Top Right Bottom-->
|
||||||
|
|
||||||
<Expander Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" IsExpanded="True">
|
<Expander Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" IsExpanded="True">
|
||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||||
@@ -39,7 +38,7 @@
|
|||||||
</Expander>
|
</Expander>
|
||||||
|
|
||||||
|
|
||||||
<Expander Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
|
<Expander Grid.Column="0" Grid.Row="1" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
|
||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||||
@@ -76,7 +75,7 @@
|
|||||||
</Expander.Content>
|
</Expander.Content>
|
||||||
</Expander>
|
</Expander>
|
||||||
|
|
||||||
<Expander Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
|
<Expander Grid.Column="0" Grid.Row="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left">
|
||||||
<Expander.Header>
|
<Expander.Header>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||||
@@ -85,7 +84,7 @@
|
|||||||
</Expander.Header>
|
</Expander.Header>
|
||||||
<Expander.Content>
|
<Expander.Content>
|
||||||
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
||||||
<Image Source="Assets/Subject.png" MaxWidth="300"/>
|
<Image Source="/Assets/Subject.png" MaxWidth="300"/>
|
||||||
<StackPanel VerticalAlignment="Center" Margin="36,0,0,0">
|
<StackPanel VerticalAlignment="Center" Margin="36,0,0,0">
|
||||||
<TextBlock Text="Enstrayed API Toolkit" FontSize="32" Margin="0,0,0,8"/>
|
<TextBlock Text="Enstrayed API Toolkit" FontSize="32" Margin="0,0,0,8"/>
|
||||||
<TextBlock Name="SettingsVersionLabel" FontSize="16" Margin="0,0,0,12"/>
|
<TextBlock Name="SettingsVersionLabel" FontSize="16" Margin="0,0,0,12"/>
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using ABI.System;
|
using ABI.System;
|
||||||
|
using APIToolkit.Classes;
|
||||||
using Microsoft.UI.Xaml;
|
using Microsoft.UI.Xaml;
|
||||||
using Microsoft.UI.Xaml.Controls;
|
using Microsoft.UI.Xaml.Controls;
|
||||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
@@ -38,12 +39,19 @@ namespace APIToolkit
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string SettingsHeadersResponseJSON = await GlobalMethods.WebRequest.GetStringAsync("headers");
|
string SettingsHeadersResponseJSON = await GlobalMethods.WebRequest.GetStringAsync("headers");
|
||||||
APIHeaders SettingsHeadersResponse = JsonSerializer.Deserialize<APIHeaders>(SettingsHeadersResponseJSON);
|
var SettingsHeadersResponse = JsonSerializer.Deserialize<APIHeaders>(SettingsHeadersResponseJSON);
|
||||||
|
if (SettingsHeadersResponse is not null)
|
||||||
|
{
|
||||||
|
SettingsHeadersUserAgent.Text = SettingsHeadersResponse.UserAgent;
|
||||||
|
SettingsHeadersConnectingIp.Text = SettingsHeadersResponse.CfConnectingIp;
|
||||||
|
SettingsHeadersIpCountry.Text = SettingsHeadersResponse.CfIpCountry;
|
||||||
|
SettingsHeadersRayId.Text = SettingsHeadersResponse.CfRay;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UIFunctions.ShowError(Settings_MainGrid.XamlRoot, "SettingsHeadersResponse was null");
|
||||||
|
}
|
||||||
|
|
||||||
SettingsHeadersUserAgent.Text = SettingsHeadersResponse.UserAgent;
|
|
||||||
SettingsHeadersConnectingIp.Text = SettingsHeadersResponse.CfConnectingIp;
|
|
||||||
SettingsHeadersIpCountry.Text = SettingsHeadersResponse.CfIpCountry;
|
|
||||||
SettingsHeadersRayId.Text = SettingsHeadersResponse.CfRay;
|
|
||||||
}
|
}
|
||||||
catch (System.Exception Error)
|
catch (System.Exception Error)
|
||||||
{
|
{
|
||||||
14
Pages/TokenManagement.xaml
Normal file
14
Pages/TokenManagement.xaml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Page
|
||||||
|
x:Class="APIToolkit.TokenManagement"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:APIToolkit"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
||||||
31
Pages/TokenManagement.xaml.cs
Normal file
31
Pages/TokenManagement.xaml.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
using Microsoft.UI.Xaml;
|
||||||
|
using Microsoft.UI.Xaml.Controls;
|
||||||
|
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||||
|
using Microsoft.UI.Xaml.Data;
|
||||||
|
using Microsoft.UI.Xaml.Input;
|
||||||
|
using Microsoft.UI.Xaml.Media;
|
||||||
|
using Microsoft.UI.Xaml.Navigation;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
|
||||||
|
// To learn more about WinUI, the WinUI project structure,
|
||||||
|
// and more about our project templates, see: http://aka.ms/winui-project-info.
|
||||||
|
|
||||||
|
namespace APIToolkit
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// An empty page that can be used on its own or navigated to within a Frame.
|
||||||
|
/// </summary>
|
||||||
|
public sealed partial class TokenManagement : Page
|
||||||
|
{
|
||||||
|
public TokenManagement()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
Pages/URLShortener.xaml
Normal file
53
Pages/URLShortener.xaml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Page
|
||||||
|
x:Class="APIToolkit.URLShortener"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:APIToolkit"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
mc:Ignorable="d">
|
||||||
|
|
||||||
|
<Grid Margin="36,36,36,36" x:Name="URLShortener_MainGrid">
|
||||||
|
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition/>
|
||||||
|
<RowDefinition/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Expander Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" IsExpanded="True">
|
||||||
|
<Expander.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||||
|
<TextBlock Text="Authentication"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Expander.Header>
|
||||||
|
<Expander.Content>
|
||||||
|
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
||||||
|
<TextBlock Text="Token" Margin="0,0,12,0" VerticalAlignment="Center"/>
|
||||||
|
<PasswordBox MinWidth="300" Margin="0,0,12,0"/>
|
||||||
|
<Button Content="Save"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Expander.Content>
|
||||||
|
</Expander>
|
||||||
|
|
||||||
|
<Expander Grid.Column="0" Grid.Row="1" HorizontalAlignment="Stretch" HorizontalContentAlignment="Left" IsExpanded="True">
|
||||||
|
<Expander.Header>
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||||
|
<TextBlock Text="Authentication"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Expander.Header>
|
||||||
|
<Expander.Content>
|
||||||
|
<StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
|
||||||
|
<TextBlock Text="Token" Margin="0,0,12,0" VerticalAlignment="Center"/>
|
||||||
|
<PasswordBox MinWidth="300" Margin="0,0,12,0"/>
|
||||||
|
<Button Content="Save"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Expander.Content>
|
||||||
|
</Expander>
|
||||||
|
</Grid>
|
||||||
|
</Page>
|
||||||
Reference in New Issue
Block a user