Images WIP

This commit is contained in:
RobertBeekman committed 2023-11-05 21:27:41 +01:00
1 parent 6b4e84c95a
commit 0667d58ed8
56 files changed
+783 -454

No files matched your search

@@ -6,6 +6,7 @@ using Artemis.UI.Screens.Debugger.Logs;
using Artemis.UI.Screens.Debugger.Performance;
using Artemis.UI.Screens.Debugger.Render;
using Artemis.UI.Screens.Debugger.Routing;
using Artemis.UI.Screens.Debugger.Workshop;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared;
using PropertyChanged.SourceGenerator;
@@ -17,9 +18,9 @@ public partial class DebugViewModel : ActivatableViewModelBase, IScreen
{
[Notify] private ViewModelBase _selectedItem;
public DebugViewModel(IDebugService debugService, RenderDebugViewModel render, DataModelDebugViewModel dataModel, PerformanceDebugViewModel performance, RoutingDebugViewModel routing, LogsDebugViewModel logs)
public DebugViewModel(IDebugService debugService, RenderDebugViewModel render, DataModelDebugViewModel dataModel, PerformanceDebugViewModel performance, RoutingDebugViewModel routing, WorkshopDebugViewModel workshop, LogsDebugViewModel logs)
{
Items = new ObservableCollection<ViewModelBase> {render, dataModel, performance, routing, logs};
Items = new ObservableCollection<ViewModelBase> {render, dataModel, performance, routing, workshop, logs};
_selectedItem = render;
this.WhenActivated(d => Disposable.Create(debugService.ClearDebugger).DisposeWith(d));
@@ -0,0 +1,32 @@
<UserControl 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:workshop="clr-namespace:Artemis.UI.Screens.Debugger.Workshop"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Debugger.Workshop.WorkshopDebugView"
x:DataType="workshop:WorkshopDebugViewModel">
<ScrollViewer Classes="with-padding">
<StackPanel>
<Label>Workshop Status</Label>
<Border Classes="card-condensed">
<SelectableTextBlock Text="{CompiledBinding WorkshopStatus}" FontFamily="{StaticResource RobotoMono}" FontSize="13" />
</Border>
<Label Margin="0 10 0 0">Auth token (DO NOT SHARE)</Label>
<Border Classes="card-condensed">
<SelectableTextBlock Text="{CompiledBinding Token}" FontFamily="{StaticResource RobotoMono}" FontSize="13" TextWrapping="Wrap" />
</Border>
<Label Margin="0 10 0 0">Email verified</Label>
<Border Classes="card-condensed">
<SelectableTextBlock Text="{CompiledBinding EmailVerified}" FontFamily="{StaticResource RobotoMono}" FontSize="13" />
</Border>
<Label Margin="0 10 0 0">Claims</Label>
<Border Classes="card-condensed">
<SelectableTextBlock Text="{CompiledBinding Claims}" FontFamily="{StaticResource RobotoMono}" FontSize="13" />
</Border>
</StackPanel>
</ScrollViewer>
</UserControl>
@@ -0,0 +1,14 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.ReactiveUI;
namespace Artemis.UI.Screens.Debugger.Workshop;
public partial class WorkshopDebugView : ReactiveUserControl<WorkshopDebugViewModel>
{
public WorkshopDebugView()
{
InitializeComponent();
}
}
@@ -0,0 +1,30 @@
using System.Threading;
using Artemis.UI.Extensions;
using Artemis.UI.Shared;
using Artemis.WebClient.Workshop.Services;
using Newtonsoft.Json;
using PropertyChanged.SourceGenerator;
namespace Artemis.UI.Screens.Debugger.Workshop;
public partial class WorkshopDebugViewModel : ActivatableViewModelBase
{
[Notify] private string? _token;
[Notify] private bool _emailVerified;
[Notify] private string? _claims;
[Notify] private IWorkshopService.WorkshopStatus? _workshopStatus;
public WorkshopDebugViewModel(IWorkshopService workshopService, IAuthenticationService authenticationService)
{
DisplayName = "Workshop";
this.WhenActivatedAsync(async _ =>
{
Token = await authenticationService.GetBearer();
EmailVerified = authenticationService.GetIsEmailVerified();
Claims = JsonConvert.SerializeObject(authenticationService.Claims, Formatting.Indented);
WorkshopStatus = await workshopService.GetWorkshopStatus(CancellationToken.None);
});
}
}