mirror of
https://github.com/BlossomiShymae/Needlework.Net.git
synced 2025-12-06 18:20:47 +01:00
Bump version, migrate to FluentAvalonia with bug fixes
This commit is contained in:
@@ -2,39 +2,37 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
xmlns:controls="using:Needlework.Net.Desktop.Controls"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.AboutView"
|
||||
x:DataType="vm:AboutViewModel">
|
||||
<Grid Margin="8"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center">
|
||||
<WrapPanel
|
||||
theme:WrapPanelExtensions.AnimatedScroll="true"
|
||||
Orientation="Horizontal">
|
||||
<suki:GlassCard Margin="8">
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<controls:Card Margin="8">
|
||||
<Image Source="/Assets/about.png"
|
||||
RenderOptions.BitmapInterpolationMode="MediumQuality"
|
||||
Width="200"
|
||||
Height="200"/>
|
||||
</suki:GlassCard>
|
||||
<StackPanel>
|
||||
<suki:GlassCard Width="400" Margin="8">
|
||||
</controls:Card>
|
||||
<StackPanel Margin="8 0 0 0">
|
||||
<controls:Card Width="400" Margin="8">
|
||||
<StackPanel>
|
||||
<TextBlock Classes="h3">Blossomi Shymae</TextBlock>
|
||||
<TextBlock Theme="{StaticResource TitleTextBlockStyle}">Blossomi Shymae</TextBlock>
|
||||
</StackPanel>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Width="400" Margin="8">
|
||||
<suki:GroupBox Header="About">
|
||||
</controls:Card>
|
||||
<controls:Card Width="400" Margin="8">
|
||||
<StackPanel >
|
||||
<TextBlock Theme="{StaticResource SubtitleTextBlockStyle}">About</TextBlock>
|
||||
<TextBlock TextWrapping="Wrap">
|
||||
Needlework.Net is .NET rewrite of Needlework. Like Needlework, this project is inspired by
|
||||
LCU Explorer. This tool was made to help others with LCU development. Feel free to ask any questions
|
||||
or help contribute to the project! 💜
|
||||
Needlework.Net is the .NET rewrite of Needlework. This tool was made to help others with LCU development. Feel free to ask any questions
|
||||
or help contribute to the project! Made with love. 💜
|
||||
</TextBlock>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
</StackPanel>
|
||||
</controls:Card>
|
||||
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</Grid>
|
||||
|
||||
@@ -2,85 +2,86 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit"
|
||||
xmlns:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
xmlns:controls="using:Needlework.Net.Desktop.Controls"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.ConsoleView"
|
||||
x:DataType="vm:ConsoleViewModel">
|
||||
<suki:BusyArea IsBusy="{Binding IsBusy}" BusyText="Loading...">
|
||||
<controls:BusyArea IsBusy="{Binding IsBusy}"
|
||||
BusyText="Loading...">
|
||||
<Grid Margin="16" RowDefinitions="auto,*" ColumnDefinitions="*,*">
|
||||
<Grid Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2">
|
||||
<suki:GlassCard Margin="0 0 0 16">
|
||||
<suki:GroupBox Header="Console">
|
||||
<Grid RowDefinitions="auto,auto" ColumnDefinitions="auto,*">
|
||||
<ComboBox ItemsSource="{Binding RequestMethods}" SelectedItem="{Binding RequestMethodSelected}"
|
||||
Grid.Row="0" Grid.Column="0"/>
|
||||
<AutoCompleteBox
|
||||
ItemsSource="{Binding RequestPaths}"
|
||||
Text="{Binding RequestPath}"
|
||||
MaxDropDownHeight="400"
|
||||
FilterMode="StartsWith"
|
||||
Grid.Row="0" Grid.Column="1"/>
|
||||
<avaloniaEdit:TextEditor
|
||||
Name="RequestEditor"
|
||||
Text=""
|
||||
ShowLineNumbers="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
FontSize="12"
|
||||
Height="100"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"/>
|
||||
</Grid>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<Button Classes="Flat Rounded"
|
||||
Margin="0 0 0 0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
FontWeight="DemiBold"
|
||||
Command="{Binding SendRequestCommand}"
|
||||
theme:ButtonExtensions.ShowProgress="{Binding IsRequestBusy}">
|
||||
Send
|
||||
</Button>
|
||||
<StackPanel Margin="0 0 0 16">
|
||||
<Grid RowDefinitions="auto" ColumnDefinitions="auto,*,auto">
|
||||
<ComboBox ItemsSource="{Binding RequestMethods}"
|
||||
SelectedItem="{Binding RequestMethodSelected}"
|
||||
Margin="0 0 8 0"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"/>
|
||||
<AutoCompleteBox
|
||||
ItemsSource="{Binding RequestPaths}"
|
||||
Text="{Binding RequestPath}"
|
||||
MaxDropDownHeight="400"
|
||||
FilterMode="StartsWith"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"/>
|
||||
<Button Margin="8 0 0 0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Bottom"
|
||||
FontWeight="DemiBold"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Command="{Binding SendRequestCommand}">
|
||||
Send
|
||||
</Button>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel
|
||||
Margin="0 0 8 0"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0">
|
||||
<suki:GlassCard Margin="0 4">
|
||||
<suki:GroupBox Header="Path">
|
||||
<TextBlock Text="{Binding ResponsePath}"/>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="0 4">
|
||||
<suki:GroupBox Header="Status">
|
||||
<TextBlock Text="{Binding ResponseStatus}"/>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="0 4">
|
||||
<suki:GroupBox Header="Authorization">
|
||||
<TextBlock Text="{Binding ResponseAuthorization}" />
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
</StackPanel>
|
||||
<suki:GlassCard
|
||||
Margin="0 8"
|
||||
<Grid Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
RowDefinitions="auto,*"
|
||||
ColumnDefinitions="*">
|
||||
<TextBox IsReadOnly="True"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Text="{Binding ResponsePath}"/>
|
||||
<avaloniaEdit:TextEditor
|
||||
Name="RequestEditor"
|
||||
Text=""
|
||||
ShowLineNumbers="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
Margin="0 8 0 0"
|
||||
FontSize="12"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"/>
|
||||
</Grid>
|
||||
<Grid RowDefinitions="35,*"
|
||||
ColumnDefinitions="*"
|
||||
Margin="8 0 0 0"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0">
|
||||
<Button Content="{Binding ResponseStatus}"
|
||||
FontSize="12"
|
||||
VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
<avaloniaEdit:TextEditor
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Name="ResponseEditor"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
ShowLineNumbers="True"
|
||||
IsReadOnly="True"
|
||||
Text=""
|
||||
FontSize="12"/>
|
||||
</suki:GlassCard>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</suki:BusyArea>
|
||||
</controls:BusyArea>
|
||||
</UserControl>
|
||||
|
||||
@@ -3,12 +3,10 @@ using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Styling;
|
||||
using AvaloniaEdit;
|
||||
using AvaloniaEdit.TextMate;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Needlework.Net.Desktop.Extensions;
|
||||
using Needlework.Net.Desktop.Messages;
|
||||
using Needlework.Net.Desktop.ViewModels;
|
||||
using SukiUI;
|
||||
using TextMateSharp.Grammars;
|
||||
|
||||
namespace Needlework.Net.Desktop.Views;
|
||||
@@ -46,7 +44,6 @@ public partial class ConsoleView : UserControl, IRecipient<ResponseUpdatedMessag
|
||||
WeakReferenceMessenger.Default.Register<ContentRequestMessage, string>(this, "ConsoleRequestEditor");
|
||||
|
||||
OnBaseThemeChanged(Application.Current!.ActualThemeVariant);
|
||||
SukiTheme.GetInstance().OnBaseThemeChanged += OnBaseThemeChanged;
|
||||
}
|
||||
|
||||
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
@@ -54,19 +51,11 @@ public partial class ConsoleView : UserControl, IRecipient<ResponseUpdatedMessag
|
||||
base.OnDetachedFromVisualTree(e);
|
||||
|
||||
WeakReferenceMessenger.Default.UnregisterAll(this);
|
||||
SukiTheme.GetInstance().OnBaseThemeChanged -= OnBaseThemeChanged;
|
||||
}
|
||||
|
||||
private void OnBaseThemeChanged(ThemeVariant currentTheme)
|
||||
{
|
||||
var registryOptions = new RegistryOptions(
|
||||
currentTheme == ThemeVariant.Dark ? ThemeName.DarkPlus : ThemeName.LightPlus);
|
||||
|
||||
var responseTmi = _responseEditor.InstallTextMate(registryOptions);
|
||||
responseTmi.SetGrammar(registryOptions.GetScopeByLanguageId(registryOptions
|
||||
.GetLanguageByExtension(".json").Id));
|
||||
var requestTmi = _requestEditor.InstallTextMate(registryOptions);
|
||||
requestTmi.SetGrammar(registryOptions.GetScopeByLanguageId(registryOptions
|
||||
.GetLanguageByExtension(".json").Id));
|
||||
}
|
||||
}
|
||||
@@ -2,15 +2,35 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
xmlns:avalonEdit="https://github.com/avaloniaui/avaloniaedit"
|
||||
xmlns:controls="using:Needlework.Net.Desktop.Controls"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.EndpointView"
|
||||
x:DataType="vm:EndpointViewModel">
|
||||
<Grid RowDefinitions="auto,*" ColumnDefinitions="3*,2,4*,2,4*">
|
||||
<UserControl.Styles>
|
||||
<Style Selector="DataGrid">
|
||||
<Setter Property="HorizontalGridLinesBrush" Value="{DynamicResource ControlElevationBorderBrush}"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridColumnHeader TextBlock">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}"/>
|
||||
</Style>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
<Style Selector="DataGridRow">
|
||||
<Setter Property="Margin" Value="0 0 0 4"></Setter>
|
||||
</Style>
|
||||
<Style Selector="TabItem > TextBlock">
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
<Setter Property="FontWeight" Value="DemiBold"/>
|
||||
</Style>
|
||||
<Style Selector="ListBox ListBoxItem">
|
||||
<Setter Property="MinHeight" Value="30"/>
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<Grid RowDefinitions="auto,*" ColumnDefinitions="3*,auto,4*,auto,4*">
|
||||
<Grid Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
RowDefinitions="*"
|
||||
@@ -42,7 +62,7 @@
|
||||
Content="{Binding Method}"
|
||||
Background="{Binding Color}"
|
||||
FontSize="8"
|
||||
Width="45"
|
||||
Width="50"
|
||||
Padding="10 2 10 2"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"/>
|
||||
@@ -58,6 +78,7 @@
|
||||
</ListBox>
|
||||
</Grid>
|
||||
<GridSplitter Background="Gray"
|
||||
Margin="8 0 8 0"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"/>
|
||||
@@ -69,7 +90,8 @@
|
||||
Grid.Column="0"
|
||||
Text="{Binding SelectedPathOperation.Method}"
|
||||
FontSize="12"
|
||||
IsReadOnly="True"/>
|
||||
IsReadOnly="True"
|
||||
Margin="0 0 8 0"/>
|
||||
<TextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
FontSize="12"
|
||||
@@ -92,58 +114,56 @@
|
||||
<TabItem Header="Params">
|
||||
<ScrollViewer>
|
||||
<StackPanel IsVisible="{Binding SelectedPathOperation, Converter={StaticResource NullBoolConverter}}">
|
||||
<suki:GroupBox Header="Path Parameters"
|
||||
<controls:Card
|
||||
Margin="0 4"
|
||||
IsVisible="{Binding SelectedPathOperation.Operation.PathParameters, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<DataGrid
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14"
|
||||
FontWeight="DemiBold">Path Parameters</TextBlock>
|
||||
<DataGrid
|
||||
ItemsSource="{Binding SelectedPathOperation.Operation.PathParameters}"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||
<DataGridCheckBoxColumn Header="Required" Binding="{Binding IsRequired}"/>
|
||||
<DataGridTemplateColumn Header="Value">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ParameterViewModel">
|
||||
<TextBox Text="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</suki:GroupBox>
|
||||
<suki:GroupBox Header="Query Parameters"
|
||||
GridLinesVisibility="All">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||
<DataGridCheckBoxColumn Header="Required" Binding="{Binding IsRequired}"/>
|
||||
<DataGridTemplateColumn Header="Value">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ParameterViewModel">
|
||||
<TextBox Text="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</controls:Card>
|
||||
<controls:Card
|
||||
Margin="0 4"
|
||||
IsVisible="{Binding SelectedPathOperation.Operation.QueryParameters, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<DataGrid
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14"
|
||||
FontWeight="DemiBold">Query Parameters</TextBlock>
|
||||
<DataGrid
|
||||
ItemsSource="{Binding SelectedPathOperation.Operation.QueryParameters}"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||
<DataGridCheckBoxColumn Header="Required" Binding="{Binding IsRequired}"/>
|
||||
<DataGridTemplateColumn Header="Value">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ParameterViewModel">
|
||||
<TextBox Text="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</suki:GroupBox>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
|
||||
<DataGridCheckBoxColumn Header="Required" Binding="{Binding IsRequired}"/>
|
||||
<DataGridTemplateColumn Header="Value">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate DataType="vm:ParameterViewModel">
|
||||
<TextBox Text="{Binding Value}"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Header="Type" Binding="{Binding Type}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</StackPanel>
|
||||
</controls:Card>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
@@ -167,6 +187,7 @@
|
||||
<TextBox FontSize="12"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="0 0 0 8"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding SelectedPathOperation.ResponseUsername}" />
|
||||
<TextBlock FontSize="12"
|
||||
@@ -178,6 +199,7 @@
|
||||
<TextBox FontSize="12"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Margin="0 0 0 8"
|
||||
IsReadOnly="True"
|
||||
Text="{Binding SelectedPathOperation.ResponsePassword}"/>
|
||||
<TextBlock FontSize="12"
|
||||
@@ -196,104 +218,85 @@
|
||||
<TabItem Header="Schemas">
|
||||
<ScrollViewer>
|
||||
<StackPanel>
|
||||
<suki:GlassCard Margin="0 4" IsVisible="{Binding SelectedPathOperation.Operation.RequestBodyType, Converter={StaticResource NullBoolConverter}}">
|
||||
<controls:Card Margin="0 4" IsVisible="{Binding SelectedPathOperation.Operation.RequestBodyType, Converter={StaticResource NullBoolConverter}}">
|
||||
<TextBlock>
|
||||
<Run Text="Request body: " FontWeight="DemiBold" FontSize="12"/>
|
||||
<Run Text="{Binding SelectedPathOperation.Operation.RequestBodyType}" FontSize="12"/>
|
||||
</TextBlock>
|
||||
</suki:GlassCard>
|
||||
</controls:Card>
|
||||
<Border Margin="0 4" IsVisible="{Binding SelectedPathOperation.Operation.RequestClasses, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<ItemsRepeater ItemsSource="{Binding SelectedPathOperation.Operation.RequestClasses}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0 4 0 8">
|
||||
<suki:GlassCard IsVisible="{Binding PropertyFields, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<suki:GroupBox Header="{Binding Id}">
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14" FontWeight="DemiBold" Margin="0 0 0 4">Request Classes</TextBlock>
|
||||
<ItemsRepeater ItemsSource="{Binding SelectedPathOperation.Operation.RequestClasses}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0 4 0 8">
|
||||
<TextBlock FontSize="12" FontWeight="DemiBold" Text="{Binding Id}"/>
|
||||
<controls:Card IsVisible="{Binding PropertyFields, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<DataGrid
|
||||
ItemsSource="{Binding PropertyFields}"
|
||||
ItemsSource="{Binding PropertyFields}"
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
</DataGrid>
|
||||
</controls:Card>
|
||||
<controls:Card Margin="0 0 0 8" IsVisible="{Binding PropertyEnums, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<DataGrid
|
||||
ItemsSource="{Binding PropertyEnums}"
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
</DataGrid>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="0 0 0 8" IsVisible="{Binding PropertyEnums, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<suki:GroupBox Header="{Binding Id}">
|
||||
<DataGrid
|
||||
ItemsSource="{Binding PropertyEnums}"
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
</DataGrid>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</controls:Card>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<suki:GlassCard Margin="0 4">
|
||||
<controls:Card Margin="0 4">
|
||||
<TextBlock>
|
||||
<Run Text="Return value: " FontWeight="DemiBold" FontSize="12"/>
|
||||
<Run Text="{Binding SelectedPathOperation.Operation.ReturnType}" FontSize="12"/>
|
||||
</TextBlock>
|
||||
</suki:GlassCard>
|
||||
</controls:Card>
|
||||
<Border Margin="0 4" IsVisible="{Binding SelectedPathOperation.Operation.ResponseClasses, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<ItemsRepeater ItemsSource="{Binding SelectedPathOperation.Operation.ResponseClasses}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0 4 0 8">
|
||||
<suki:GlassCard IsVisible="{Binding PropertyFields, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<suki:GroupBox Header="{Binding Id}">
|
||||
<StackPanel>
|
||||
<TextBlock FontSize="14" FontWeight="DemiBold">Response Classes</TextBlock>
|
||||
<ItemsRepeater ItemsSource="{Binding SelectedPathOperation.Operation.ResponseClasses}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Margin="0 4 0 8">
|
||||
<TextBlock FontSize="12" FontWeight="DemiBold" Text="{Binding Id}" Margin="0 0 0 4"/>
|
||||
<controls:Card IsVisible="{Binding PropertyFields, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<DataGrid
|
||||
ItemsSource="{Binding PropertyFields}"
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
</DataGrid>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="0 0 0 8" IsVisible="{Binding PropertyEnums, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<suki:GroupBox Header="{Binding Id}">
|
||||
<DataGrid
|
||||
ItemsSource="{Binding PropertyEnums}"
|
||||
ItemsSource="{Binding PropertyFields}"
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
<DataGrid.Styles>
|
||||
<Style Selector="DataGridRow DataGridCell">
|
||||
<Setter Property="FontSize" Value="12"></Setter>
|
||||
</Style>
|
||||
</DataGrid.Styles>
|
||||
</DataGrid>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</controls:Card>
|
||||
<controls:Card Margin="0 0 0 8" IsVisible="{Binding PropertyEnums, Converter={StaticResource EnumerableBoolConverter}}">
|
||||
<DataGrid
|
||||
ItemsSource="{Binding PropertyEnums}"
|
||||
AutoGenerateColumns="True"
|
||||
IsReadOnly="True"
|
||||
GridLinesVisibility="Horizontal">
|
||||
</DataGrid>
|
||||
</controls:Card>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
<GridSplitter Grid.Row="0" Grid.Column="3" Grid.RowSpan="2" Background="Gray"/>
|
||||
<GridSplitter Grid.Row="0" Grid.Column="3" Grid.RowSpan="2" Background="Gray"
|
||||
Margin="8 0 8 0"/>
|
||||
<StackPanel Grid.Row="0" Grid.Column="4" Orientation="Horizontal">
|
||||
<Button HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
@@ -312,6 +315,7 @@
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
ShowLineNumbers="True"
|
||||
IsReadOnly="True"
|
||||
Text=""
|
||||
FontSize="12"/>
|
||||
</TabItem>
|
||||
|
||||
@@ -3,12 +3,10 @@ using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Styling;
|
||||
using AvaloniaEdit;
|
||||
using AvaloniaEdit.TextMate;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Needlework.Net.Desktop.Extensions;
|
||||
using Needlework.Net.Desktop.Messages;
|
||||
using Needlework.Net.Desktop.ViewModels;
|
||||
using SukiUI;
|
||||
using TextMateSharp.Grammars;
|
||||
|
||||
namespace Needlework.Net.Desktop.Views;
|
||||
@@ -37,7 +35,6 @@ public partial class EndpointView : UserControl, IRecipient<EditorUpdateMessage>
|
||||
WeakReferenceMessenger.Default.Register<ContentRequestMessage, string>(this, "EndpointRequestEditor");
|
||||
|
||||
OnBaseThemeChanged(Application.Current!.ActualThemeVariant);
|
||||
SukiTheme.GetInstance().OnBaseThemeChanged += OnBaseThemeChanged;
|
||||
}
|
||||
|
||||
protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)
|
||||
@@ -45,20 +42,12 @@ public partial class EndpointView : UserControl, IRecipient<EditorUpdateMessage>
|
||||
base.OnDetachedFromVisualTree(e);
|
||||
|
||||
WeakReferenceMessenger.Default.UnregisterAll(this);
|
||||
SukiTheme.GetInstance().OnBaseThemeChanged -= OnBaseThemeChanged;
|
||||
}
|
||||
|
||||
private void OnBaseThemeChanged(ThemeVariant currentTheme)
|
||||
{
|
||||
var registryOptions = new RegistryOptions(
|
||||
currentTheme == ThemeVariant.Dark ? ThemeName.DarkPlus : ThemeName.LightPlus);
|
||||
|
||||
var requestTmi = _requestEditor.InstallTextMate(registryOptions);
|
||||
requestTmi.SetGrammar(registryOptions.GetScopeByLanguageId(registryOptions
|
||||
.GetLanguageByExtension(".json").Id));
|
||||
var responseTmi = _requestEditor.InstallTextMate(registryOptions);
|
||||
responseTmi.SetGrammar(registryOptions.GetScopeByLanguageId(registryOptions
|
||||
.GetLanguageByExtension(".json").Id));
|
||||
}
|
||||
|
||||
public void Receive(EditorUpdateMessage message)
|
||||
|
||||
@@ -2,13 +2,31 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
xmlns:avalonEdit="https://github.com/avaloniaui/avaloniaedit"
|
||||
xmlns:i="https://github.com/projektanker/icons.avalonia"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.EndpointsContainerView"
|
||||
x:DataType="vm:EndpointsContainerViewModel">
|
||||
<suki:SukiStackPage Content="{Binding ActiveViewModel}"
|
||||
Margin="-24 -4 0 0"/>
|
||||
<Grid RowDefinitions="auto,*"
|
||||
ColumnDefinitions="*"
|
||||
Margin="16">
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="0 0 0 8">
|
||||
<Button Command="{Binding GoBackCommand}"
|
||||
Theme="{StaticResource TransparentButton}"
|
||||
Margin="0 0 8 0">
|
||||
<i:Icon Value="fa-arrow-left"
|
||||
FontSize="20"/>
|
||||
</Button>
|
||||
<TextBlock Theme="{StaticResource TitleTextBlockStyle}"
|
||||
Text="{Binding Title}"/>
|
||||
</StackPanel>
|
||||
<TransitioningContentControl
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Content="{Binding ActiveViewModel}"/>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -2,24 +2,31 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
xmlns:controls="using:Needlework.Net.Desktop.Controls"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
Name="EndpointsControl"
|
||||
x:Class="Needlework.Net.Desktop.Views.EndpointsView"
|
||||
x:DataType="vm:EndpointsViewModel">
|
||||
<suki:BusyArea IsBusy="{Binding IsBusy}" BusyText="Loading...">
|
||||
<Grid Margin="16" RowDefinitions="auto,auto,*" ColumnDefinitions="*">
|
||||
<TextBox Watermark="Search" Margin="0 4" Text="{Binding Search}" Grid.Row="1" Grid.Column="0"/>
|
||||
<ScrollViewer Grid.Row="2" Grid.Column="0">
|
||||
<ListBox ItemsSource="{Binding Query}" SelectedItem="{Binding SelectedQuery}">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding}" Foreground="White" />
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</suki:BusyArea>
|
||||
<controls:BusyArea IsBusy="{Binding IsBusy}"
|
||||
BusyText="Loading...">
|
||||
<Grid RowDefinitions="auto,auto,*" ColumnDefinitions="*">
|
||||
<TextBox Watermark="Search" Margin="0 4" Text="{Binding Search}" Grid.Row="1" Grid.Column="0"/>
|
||||
<ScrollViewer Grid.Row="2" Grid.Column="0">
|
||||
<ItemsRepeater ItemsSource="{Binding Query}">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Button Command="{Binding #EndpointsControl.((vm:EndpointsViewModel)DataContext).OpenEndpointCommand}"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Left"
|
||||
CommandParameter="{Binding}"
|
||||
Content="{Binding}"
|
||||
Theme="{StaticResource TransparentButton}"/>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</controls:BusyArea>
|
||||
</UserControl>
|
||||
@@ -2,74 +2,62 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:theme="clr-namespace:SukiUI.Theme;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
xmlns:controls="using:Needlework.Net.Desktop.Controls"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.HomeView"
|
||||
x:DataType="vm:HomeViewModel">
|
||||
<!-- TOP LEVEL -->
|
||||
<ScrollViewer>
|
||||
<WrapPanel Margin="8"
|
||||
theme:WrapPanelExtensions.AnimatedScroll="true"
|
||||
Orientation="Horizontal">
|
||||
<!-- WELCOME -->
|
||||
<StackPanel>
|
||||
<suki:GlassCard Margin="8">
|
||||
<Border Margin="12">
|
||||
<StackPanel>
|
||||
<TextBlock Classes="h3">Welcome to Needlework.Net</TextBlock>
|
||||
<TextBlock Theme="{StaticResource TitleTextBlockStyle}">
|
||||
Welcome to Needlework.Net
|
||||
</TextBlock>
|
||||
<TextBlock>Get started with LCU development by clicking on the endpoints tab in the left panel.</TextBlock>
|
||||
</StackPanel>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="8" Classes="Accent">
|
||||
</Border>
|
||||
<controls:Card Margin="12">
|
||||
<TextBlock TextWrapping="Wrap">THE PROGRAM IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGMENT, OR OF FITNESS FOR A PARTICULAR PURPOSE. LICENSOR DOES NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE PROGRAM WILL MEET YOUR REQUIREMENTS OR THAT OPERATION WILL BE UNINTERRUPTED OR ERROR FREE. LICENSOR MAKES NO WARRANTIES RESPECTING ANY HARM THAT MAY BE CAUSED BY MALICIOUS USE OF THIS SOFTWARE. LICENSOR FURTHER EXPRESSLY DISCLAIMS ANY WARRANTY OR REPRESENTATION TO AUTHORIZED USERS OR TO ANY THIRD PARTY.</TextBlock>
|
||||
</suki:GlassCard>
|
||||
</controls:Card>
|
||||
</StackPanel>
|
||||
<!-- STATUS -->
|
||||
<StackPanel>
|
||||
<suki:GlassCard Margin="8" Width="250">
|
||||
<suki:GroupBox Header="Status">
|
||||
<TextBlock FontSize="24" FontWeight="Bold" Margin="0 4" Foreground="{Binding StatusForeground}" Text="{Binding StatusText}" />
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="8" Width="250">
|
||||
<suki:GroupBox Header="Address">
|
||||
<TextBlock Text="{Binding StatusAddress}"/>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
</StackPanel>
|
||||
<!-- LEGAL -->
|
||||
<suki:GlassCard Margin="8" Width="300">
|
||||
<suki:GroupBox Header="Disclaimer">
|
||||
<TextBlock TextWrapping="Wrap">Needlework.Net isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.</TextBlock>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
<!-- FOOTER -->
|
||||
<StackPanel>
|
||||
<suki:GlassCard Margin="8" Width="400">
|
||||
<controls:Card Margin="12" Width="300">
|
||||
<StackPanel>
|
||||
<TextBlock>© 2024 - Blossomi Shymae</TextBlock>
|
||||
<TextBlock>MIT License</TextBlock>
|
||||
</StackPanel>
|
||||
</suki:GlassCard>
|
||||
<suki:GlassCard Margin="8" Width="400">
|
||||
<suki:GroupBox Header="Resources">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||
<TextBlock
|
||||
Theme="{StaticResource SubtitleTextBlockStyle}"
|
||||
Margin="0 0 0 8">Resources</TextBlock>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button">
|
||||
<Setter Property="Command" Value="{Binding OpenUrlCommand}"/>
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button CommandParameter="https://hextechdocs.dev/tag/lcu/" Margin="0 0 16 0">
|
||||
<Button CommandParameter="https://hextechdocs.dev/tag/lcu/" Margin="0 0 8 0">
|
||||
Hextech Docs
|
||||
</Button>
|
||||
<Button CommandParameter="https://hextechdocs.dev/getting-started-with-the-lcu-api/">
|
||||
Getting Started
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</suki:GroupBox>
|
||||
</suki:GlassCard>
|
||||
</StackPanel>
|
||||
</controls:Card>
|
||||
<controls:Card Margin="12" Width="300">
|
||||
<StackPanel>
|
||||
<TextBlock>© 2024 - Blossomi Shymae</TextBlock>
|
||||
<TextBlock>MIT License</TextBlock>
|
||||
</StackPanel>
|
||||
</controls:Card>
|
||||
</StackPanel>
|
||||
<!-- LEGAL -->
|
||||
<controls:Card Margin="12" Width="300">
|
||||
<TextBlock TextWrapping="Wrap">Needlework.Net isn't endorsed by Riot Games and doesn't reflect the views or opinions of Riot Games or anyone officially involved in producing or managing Riot Games properties. Riot Games, and all associated properties are trademarks or registered trademarks of Riot Games, Inc.</TextBlock>
|
||||
</controls:Card>
|
||||
</WrapPanel>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<suki:SukiWindow
|
||||
<Window
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
xmlns:uip="using:FluentAvalonia.UI.Controls.Primitives"
|
||||
xmlns:materialIcons="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
|
||||
xmlns:i="https://github.com/projektanker/icons.avalonia"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
@@ -14,64 +15,85 @@
|
||||
Icon="/Assets/app.ico"
|
||||
Width="1280"
|
||||
Height="720">
|
||||
<suki:SukiWindow.LogoContent>
|
||||
<Image Source="/Assets/app.png"
|
||||
Width="20"
|
||||
Height="20"
|
||||
VerticalAlignment="Center"/>
|
||||
</suki:SukiWindow.LogoContent>
|
||||
<!-- TOP LEVEL -->
|
||||
<suki:SukiSideMenu ItemsSource="{Binding Pages}">
|
||||
<!-- ITEMS -->
|
||||
<suki:SukiSideMenu.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<suki:SukiSideMenuItem Header="{Binding DisplayName}">
|
||||
<suki:SukiSideMenuItem.Icon>
|
||||
<materialIcons:MaterialIcon Kind="{Binding Icon}" />
|
||||
</suki:SukiSideMenuItem.Icon>
|
||||
</suki:SukiSideMenuItem>
|
||||
</DataTemplate>
|
||||
</suki:SukiSideMenu.ItemTemplate>
|
||||
<!-- FOOTER -->
|
||||
<suki:SukiSideMenu.FooterContent>
|
||||
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button.Basic">
|
||||
<Setter Property="Command" Value="{Binding OpenUrlCommand}" />
|
||||
</Style>
|
||||
<Style Selector="materialIcons|MaterialIcon">
|
||||
<Setter Property="Width" Value="25" />
|
||||
<Setter Property="Height" Value="25" />
|
||||
</Style>
|
||||
<Style Selector="i|Icon">
|
||||
<Setter Property="FontSize" Value="25" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button Classes="Flat"
|
||||
Content="{Binding Version}"
|
||||
FontSize="12"
|
||||
Margin="0 0 4 0"
|
||||
Padding="12 4 12 4"
|
||||
VerticalAlignment="Center"/>
|
||||
<Button Classes="Basic"
|
||||
VerticalAlignment="Center"
|
||||
CommandParameter="https://github.com/BlossomiShymae/Needlework.Net"
|
||||
ToolTip.Tip="Open on GitHub."
|
||||
Margin="0 0 4 0">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<materialIcons:MaterialIcon Kind="Github" Margin="0 0 4 0" />
|
||||
<TextBlock FontSize="12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="White">Star</TextBlock>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
<Button Classes="Basic"
|
||||
VerticalAlignment="Center"
|
||||
CommandParameter="https://discord.gg/chEvEX5J4E"
|
||||
ToolTip.Tip="Open Discord server.">
|
||||
<i:Icon Value="fa-brand fa-discord" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</suki:SukiSideMenu.FooterContent>
|
||||
</suki:SukiSideMenu>
|
||||
</suki:SukiWindow>
|
||||
<Grid RowDefinitions="auto,*">
|
||||
<Grid ColumnDefinitions="auto,auto,*,auto"
|
||||
Background="Transparent"
|
||||
Height="40"
|
||||
Grid.Row="0">
|
||||
<Image Margin="12 4"
|
||||
IsHitTestVisible="False"
|
||||
Source="/Assets/app.png"
|
||||
Width="18"
|
||||
Height="18"
|
||||
DockPanel.Dock="Left"
|
||||
Grid.Column="0"/>
|
||||
<TextBlock FontSize="12"
|
||||
IsHitTestVisible="False"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="1">
|
||||
Needlework.Net
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<ui:NavigationView AlwaysShowHeader="False"
|
||||
PaneDisplayMode="Left"
|
||||
IsSettingsVisible="False"
|
||||
Grid.Row="1"
|
||||
MenuItemsSource="{Binding MenuItems}"
|
||||
SelectedItem="{Binding SelectedMenuItem}">
|
||||
<ui:NavigationView.PaneFooter>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel.Styles>
|
||||
<Style Selector="Button.Basic">
|
||||
<Setter Property="Command" Value="{Binding OpenUrlCommand}" />
|
||||
</Style>
|
||||
<Style Selector="materialIcons|MaterialIcon">
|
||||
<Setter Property="Width" Value="20" />
|
||||
<Setter Property="Height" Value="20" />
|
||||
</Style>
|
||||
<Style Selector="i|Icon">
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
</Style>
|
||||
</StackPanel.Styles>
|
||||
<Button
|
||||
Theme="{StaticResource TransparentButton}"
|
||||
VerticalAlignment="Center"
|
||||
CommandParameter="https://github.com/BlossomiShymae/Needlework.Net"
|
||||
ToolTip.Tip="Open on GitHub."
|
||||
Margin="4">
|
||||
<materialIcons:MaterialIcon Kind="Github" />
|
||||
</Button>
|
||||
<Button
|
||||
Theme="{StaticResource TransparentButton}"
|
||||
VerticalAlignment="Center"
|
||||
CommandParameter="https://discord.gg/chEvEX5J4E"
|
||||
ToolTip.Tip="Open Discord server."
|
||||
Margin="4">
|
||||
<i:Icon Value="fa-brand fa-discord" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</ui:NavigationView.PaneFooter>
|
||||
<Grid>
|
||||
<TransitioningContentControl Content="{Binding CurrentPage}"/>
|
||||
<Button Content="{Binding Version}"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="16"/>
|
||||
<ItemsRepeater ItemsSource="{Binding InfoBarItems}"
|
||||
VerticalAlignment="Bottom">
|
||||
<ItemsRepeater.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Border Margin="4">
|
||||
<ui:InfoBar
|
||||
Title="{Binding Title}"
|
||||
IsOpen="{Binding IsOpen}"
|
||||
Severity="{Binding Severity}"
|
||||
Message="{Binding Message}"
|
||||
ActionButton="{Binding ActionButton}"/>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
</ItemsRepeater.ItemTemplate>
|
||||
</ItemsRepeater>
|
||||
</Grid>
|
||||
</ui:NavigationView>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using SukiUI.Controls;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
|
||||
namespace Needlework.Net.Desktop.Views;
|
||||
|
||||
public partial class MainWindow : SukiWindow
|
||||
public partial class MainWindow : AppWindow
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TitleBar.ExtendsContentIntoTitleBar = true;
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,8 @@
|
||||
<suki:SukiWindow
|
||||
<Window
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.OopsiesWindow"
|
||||
@@ -12,34 +11,59 @@
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="560"
|
||||
Height="200">
|
||||
<Grid RowDefinitions="auto,auto,auto" ColumnDefinitions="auto,auto"
|
||||
<Grid RowDefinitions="auto,*">
|
||||
<Grid ColumnDefinitions="auto,auto,*,auto"
|
||||
Background="Transparent"
|
||||
Height="40"
|
||||
Grid.Row="0">
|
||||
<Image Margin="12 4"
|
||||
IsHitTestVisible="False"
|
||||
Source="/Assets/app.png"
|
||||
Width="18"
|
||||
Height="18"
|
||||
DockPanel.Dock="Left"
|
||||
Grid.Column="0"/>
|
||||
<TextBlock FontSize="12"
|
||||
IsHitTestVisible="False"
|
||||
VerticalAlignment="Center"
|
||||
Grid.Column="1">
|
||||
Needlework.Net - Oopsies
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
<Grid RowDefinitions="auto,auto,auto"
|
||||
ColumnDefinitions="auto,auto"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="8"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center">
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2">
|
||||
This response is too large for Needlework.Net to handle for performance reasons.
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0 0 0 12">
|
||||
It can be viewed in an external editor or viewer.
|
||||
</TextBlock>
|
||||
<Button Command="{Binding OpenDefaultEditorCommand}"
|
||||
Grid.Row="2"
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="0 0 8 0">
|
||||
Open
|
||||
</Button>
|
||||
<Button Command="{Binding CloseDialogCommand}"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="8 0 0 0">
|
||||
Cancel
|
||||
</Button>
|
||||
Grid.ColumnSpan="2">
|
||||
This response is too large for Needlework.Net to handle for performance reasons.
|
||||
</TextBlock>
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0 0 0 12">
|
||||
It can be viewed in an external editor or viewer.
|
||||
</TextBlock>
|
||||
<Button Command="{Binding OpenDefaultEditorCommand}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Margin="0 0 8 0">
|
||||
Open
|
||||
</Button>
|
||||
<Button Command="{Binding CloseDialogCommand}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="8 0 0 0">
|
||||
Cancel
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</suki:SukiWindow>
|
||||
</Window>
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using SukiUI.Controls;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
|
||||
namespace Needlework.Net.Desktop.Views;
|
||||
|
||||
public partial class OopsiesWindow : SukiWindow
|
||||
public partial class OopsiesWindow : AppWindow
|
||||
{
|
||||
public OopsiesWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
TitleBar.ExtendsContentIntoTitleBar = true;
|
||||
}
|
||||
}
|
||||
@@ -3,67 +3,58 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:avaloniaEdit="https://github.com/avaloniaui/avaloniaedit"
|
||||
xmlns:suki="clr-namespace:SukiUI.Controls;assembly=SukiUI"
|
||||
xmlns:vm="using:Needlework.Net.Desktop.ViewModels"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Needlework.Net.Desktop.Views.WebsocketView"
|
||||
x:DataType="vm:WebsocketViewModel">
|
||||
<Grid RowDefinitions="*,2,*" Margin="16">
|
||||
<Grid RowDefinitions="*,auto,*" Margin="16">
|
||||
<Border Grid.Row="0"
|
||||
Padding="0 0 0 8">
|
||||
<suki:GlassCard>
|
||||
<Grid RowDefinitions="auto,*" ColumnDefinitions="*">
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
RowDefinitions="*"
|
||||
ColumnDefinitions="auto,*,auto,auto">
|
||||
<Button Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Command="{Binding ClearCommand}"
|
||||
Margin="0 0 8 0">Clear</Button>
|
||||
<TextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Margin="0 0 8 0"
|
||||
Text="{Binding Search, Mode=TwoWay}"/>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Margin="0 0 8 0">
|
||||
<ToggleSwitch Margin="0 0 0 8"
|
||||
IsChecked="{Binding IsAttach}"/>
|
||||
<TextBlock Margin="0 6 0 0"
|
||||
FontSize="18">Attach</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal"
|
||||
Grid.Row="0"
|
||||
Grid.Column="3">
|
||||
<ToggleSwitch Margin="0 0 0 8"
|
||||
IsChecked="{Binding IsTail}"/>
|
||||
<TextBlock Margin="0 6 0 0"
|
||||
FontSize="18">Tail</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ListBox Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Name="EventViewer"
|
||||
ItemsSource="{Binding FilteredEventLog}"
|
||||
SelectedItem="{Binding SelectedEventLog}"/>
|
||||
<Grid RowDefinitions="auto,*" ColumnDefinitions="*">
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
RowDefinitions="*"
|
||||
ColumnDefinitions="auto,*,auto,auto">
|
||||
<Button Margin="0 0 8 0"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Command="{Binding ClearCommand}">Clear</Button>
|
||||
<TextBox Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Text="{Binding Search}"
|
||||
MaxLines="1"
|
||||
Margin="0 0 8 0"/>
|
||||
<CheckBox
|
||||
Margin="0 0 8 0"
|
||||
Grid.Row="0"
|
||||
Grid.Column="2"
|
||||
Content="Attach"
|
||||
IsChecked="{Binding IsAttach}"/>
|
||||
<CheckBox
|
||||
Grid.Row="0"
|
||||
Grid.Column="3"
|
||||
Content="Tail"
|
||||
IsChecked="{Binding IsTail}"/>
|
||||
</Grid>
|
||||
</suki:GlassCard>
|
||||
<ListBox Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Name="EventViewer"
|
||||
Margin="0 8 0 0"
|
||||
ItemsSource="{Binding FilteredEventLog}"
|
||||
SelectedItem="{Binding SelectedEventLog}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<GridSplitter Grid.Row="1" ResizeDirection="Rows" Background="Gray"/>
|
||||
<Border Grid.Row="2"
|
||||
Padding="0 8 0 0">
|
||||
<suki:GlassCard>
|
||||
<avaloniaEdit:TextEditor
|
||||
Name="ResponseEditor"
|
||||
ShowLineNumbers="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
Text=""
|
||||
FontSize="12"/>
|
||||
</suki:GlassCard>
|
||||
<avaloniaEdit:TextEditor
|
||||
Name="ResponseEditor"
|
||||
ShowLineNumbers="True"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Visible"
|
||||
Text=""
|
||||
FontSize="12"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -3,12 +3,10 @@ using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Styling;
|
||||
using AvaloniaEdit;
|
||||
using AvaloniaEdit.TextMate;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using Needlework.Net.Desktop.Extensions;
|
||||
using Needlework.Net.Desktop.Messages;
|
||||
using Needlework.Net.Desktop.ViewModels;
|
||||
using SukiUI;
|
||||
using TextMateSharp.Grammars;
|
||||
|
||||
namespace Needlework.Net.Desktop.Views;
|
||||
@@ -41,7 +39,6 @@ public partial class WebsocketView : UserControl, IRecipient<ResponseUpdatedMess
|
||||
WeakReferenceMessenger.Default.Register(this, nameof(WebsocketViewModel));
|
||||
|
||||
OnBaseThemeChanged(Application.Current!.ActualThemeVariant);
|
||||
SukiTheme.GetInstance().OnBaseThemeChanged += OnBaseThemeChanged;
|
||||
}
|
||||
|
||||
private void OnBaseThemeChanged(ThemeVariant currentTheme)
|
||||
@@ -49,9 +46,5 @@ public partial class WebsocketView : UserControl, IRecipient<ResponseUpdatedMess
|
||||
|
||||
var registryOptions = new RegistryOptions(
|
||||
currentTheme == ThemeVariant.Dark ? ThemeName.DarkPlus : ThemeName.LightPlus);
|
||||
|
||||
var responseTmi = _responseEditor.InstallTextMate(registryOptions);
|
||||
responseTmi.SetGrammar(registryOptions.GetScopeByLanguageId(registryOptions
|
||||
.GetLanguageByExtension(".json").Id));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user