commit changes
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||
@@ -14,8 +14,9 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Remove="Assets\Subject.png" />
|
||||
<None Remove="SendEmail.xaml" />
|
||||
<None Remove="Settings.xaml" />
|
||||
<None Remove="URLShortener.xaml" />
|
||||
<None Remove="TokenManagement.xaml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -44,6 +45,16 @@
|
||||
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
|
||||
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.250108002" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="TokenManagement.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="SendEmail.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="Settings.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
@@ -33,6 +34,8 @@ namespace APIToolkit
|
||||
public App()
|
||||
{
|
||||
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>
|
||||
@@ -47,4 +50,10 @@ namespace APIToolkit
|
||||
|
||||
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.Threading.Tasks;
|
||||
|
||||
namespace APIToolkit
|
||||
namespace APIToolkit.Classes
|
||||
{
|
||||
public record class APIHeaders
|
||||
{
|
||||
@@ -19,7 +19,7 @@ namespace APIToolkit
|
||||
public required string CfIpCountry { get; set; }
|
||||
|
||||
[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 Windows.Foundation.Metadata;
|
||||
|
||||
namespace APIToolkit
|
||||
namespace APIToolkit.Classes
|
||||
{
|
||||
public class UIFunctions
|
||||
{
|
||||
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices.WindowsRuntime;
|
||||
using APIToolkit.Classes;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
@@ -31,9 +32,6 @@ namespace APIToolkit
|
||||
this.SetTitleBar(AppTitleBar);
|
||||
|
||||
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)
|
||||
@@ -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"?>
|
||||
<Page
|
||||
x:Class="APIToolkit.URLShortener"
|
||||
x:Class="APIToolkit.SendEmail"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:APIToolkit"
|
||||
@@ -9,6 +9,6 @@
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid>
|
||||
<Button Content="URlShortener"/>
|
||||
<Button Content="SendEmail"/>
|
||||
</Grid>
|
||||
</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>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
@@ -22,7 +21,7 @@
|
||||
|
||||
<!--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>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||
@@ -39,7 +38,7 @@
|
||||
</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>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||
@@ -76,7 +75,7 @@
|
||||
</Expander.Content>
|
||||
</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>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<FontIcon Glyph="" Margin="0,0,12,0"/>
|
||||
@@ -85,7 +84,7 @@
|
||||
</Expander.Header>
|
||||
<Expander.Content>
|
||||
<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">
|
||||
<TextBlock Text="Enstrayed API Toolkit" FontSize="32" Margin="0,0,0,8"/>
|
||||
<TextBlock Name="SettingsVersionLabel" FontSize="16" Margin="0,0,0,12"/>
|
||||
@@ -1,4 +1,5 @@
|
||||
using ABI.System;
|
||||
using APIToolkit.Classes;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using Microsoft.UI.Xaml.Controls.Primitives;
|
||||
@@ -38,12 +39,19 @@ namespace APIToolkit
|
||||
try
|
||||
{
|
||||
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)
|
||||
{
|
||||
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