diff --git a/.gitignore b/.gitignore index 6aa1064..360b42d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target/ **/*.rs.bk Cargo.lock +.vscode diff --git a/FrontendAvalonia/.gitignore b/FrontendAvalonia/.gitignore deleted file mode 100644 index 8afdcb6..0000000 --- a/FrontendAvalonia/.gitignore +++ /dev/null @@ -1,454 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# JetBrains Rider -.idea/ -*.sln.iml - -## -## Visual Studio Code -## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json diff --git a/FrontendAvalonia/App.axaml b/FrontendAvalonia/App.axaml deleted file mode 100644 index ddc0b60..0000000 --- a/FrontendAvalonia/App.axaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/FrontendAvalonia/App.axaml.cs b/FrontendAvalonia/App.axaml.cs deleted file mode 100644 index de00bbe..0000000 --- a/FrontendAvalonia/App.axaml.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; - -namespace FrontendAvalonia; - -public partial class App : Application -{ - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - desktop.MainWindow = new MainWindow(); - } - - base.OnFrameworkInitializationCompleted(); - } -} \ No newline at end of file diff --git a/FrontendAvalonia/Directory.Build.props b/FrontendAvalonia/Directory.Build.props deleted file mode 100644 index 5a014d1..0000000 --- a/FrontendAvalonia/Directory.Build.props +++ /dev/null @@ -1,6 +0,0 @@ - - - enable - 11.0.0-rc1.1 - - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/FrontendAvalonia.Android.csproj b/FrontendAvalonia/FrontendAvalonia.Android/FrontendAvalonia.Android.csproj deleted file mode 100644 index 21a38ae..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/FrontendAvalonia.Android.csproj +++ /dev/null @@ -1,27 +0,0 @@ - - - Exe - net7.0-android - 21 - enable - com.CompanyName.FrontendAvalonia - 1 - 1.0 - apk - False - - - - - Resources\drawable\Icon.png - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/Icon.png b/FrontendAvalonia/FrontendAvalonia.Android/Icon.png deleted file mode 100644 index 41a2a61..0000000 Binary files a/FrontendAvalonia/FrontendAvalonia.Android/Icon.png and /dev/null differ diff --git a/FrontendAvalonia/FrontendAvalonia.Android/MainActivity.cs b/FrontendAvalonia/FrontendAvalonia.Android/MainActivity.cs deleted file mode 100644 index 264b801..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/MainActivity.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Android.App; -using Android.Content.PM; -using Avalonia.Android; - -namespace FrontendAvalonia.Android; - -[Activity(Label = "FrontendAvalonia.Android", Theme = "@style/MyTheme.NoActionBar", Icon = "@drawable/icon", LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] -public class MainActivity : AvaloniaMainActivity -{ -} diff --git a/FrontendAvalonia/FrontendAvalonia.Android/Properties/AndroidManifest.xml b/FrontendAvalonia/FrontendAvalonia.Android/Properties/AndroidManifest.xml deleted file mode 100644 index 8d25d30..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/Properties/AndroidManifest.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/Resources/drawable/splash_screen.xml b/FrontendAvalonia/FrontendAvalonia.Android/Resources/drawable/splash_screen.xml deleted file mode 100644 index 2e920b4..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/Resources/drawable/splash_screen.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/Resources/values-night/colors.xml b/FrontendAvalonia/FrontendAvalonia.Android/Resources/values-night/colors.xml deleted file mode 100644 index 3d47b6f..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/Resources/values-night/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #212121 - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/Resources/values/colors.xml b/FrontendAvalonia/FrontendAvalonia.Android/Resources/values/colors.xml deleted file mode 100644 index 59279d5..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/Resources/values/colors.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - #FFFFFF - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/Resources/values/styles.xml b/FrontendAvalonia/FrontendAvalonia.Android/Resources/values/styles.xml deleted file mode 100644 index 2759d29..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/Resources/values/styles.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Android/SplashActivity.cs b/FrontendAvalonia/FrontendAvalonia.Android/SplashActivity.cs deleted file mode 100644 index a2cda26..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Android/SplashActivity.cs +++ /dev/null @@ -1,32 +0,0 @@ -//using Android.App; -//using Android.Content; -//using Android.OS; -//using Application = Android.App.Application; -//using Avalonia; -//using Avalonia.Android; -//using Avalonia.ReactiveUI; - -//namespace FrontendAvalonia.Android; - -//[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] -//public class SplashActivity : AvaloniaSplashActivity -//{ -// protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) -// { -// return base.CustomizeAppBuilder(builder) -// .WithInterFont() -// .UseReactiveUI(); -// } - -// protected override void OnCreate(Bundle? savedInstanceState) -// { -// base.OnCreate(savedInstanceState); -// } - -// protected override void OnResume() -// { -// base.OnResume(); - -// StartActivity(new Intent(Application.Context, typeof(MainActivity))); -// } -//} diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/Logo.svg b/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/Logo.svg deleted file mode 100644 index 9685a23..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/Logo.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/app.css b/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/app.css deleted file mode 100644 index a424538..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/app.css +++ /dev/null @@ -1,74 +0,0 @@ -:root { - --sat: env(safe-area-inset-top); - --sar: env(safe-area-inset-right); - --sab: env(safe-area-inset-bottom); - --sal: env(safe-area-inset-left); -} - -/* HTML styles for the splash screen */ - -.highlight { - color: white; - font-size: 2.5rem; - display: block; -} - -.purple { - color: #8b44ac; -} - -.icon { - opacity: 0.05; - height: 35%; - width: 35%; - position: absolute; - background-repeat: no-repeat; - right: 0px; - bottom: 0px; - margin-right: 3%; - margin-bottom: 5%; - z-index: 5000; - background-position: right bottom; - pointer-events: none; -} - -#avalonia-splash a { - color: whitesmoke; - text-decoration: none; -} - -.center { - display: flex; - justify-content: center; - align-items: center; - height: 100vh; -} - -#avalonia-splash { - position: relative; - height: 100%; - width: 100%; - color: whitesmoke; - background: #1b2a4e; - font-family: 'Nunito', sans-serif; - background-position: center; - background-size: cover; - background-repeat: no-repeat; - justify-content: center; - align-items: center; -} - -.splash-close { - animation: fadeout 0.25s linear forwards; -} - -@keyframes fadeout { - 0% { - opacity: 100%; - } - - 100% { - opacity: 0; - visibility: collapse; - } -} diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/favicon.ico b/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/favicon.ico deleted file mode 100644 index da8d49f..0000000 Binary files a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/favicon.ico and /dev/null differ diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/index.html b/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/index.html deleted file mode 100644 index 1ff09ae..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/index.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - FrontendAvalonia.Browser - - - - - - - - - - -
-
-
-

- Powered by - Avalonia UI -

-
- Avalonia Logo -
-
- - - - \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/main.js b/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/main.js deleted file mode 100644 index 0dbe2e4..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/AppBundle/main.js +++ /dev/null @@ -1,13 +0,0 @@ -import { dotnet } from './dotnet.js' - -const is_browser = typeof window != "undefined"; -if (!is_browser) throw new Error(`Expected to be running in a browser`); - -const dotnetRuntime = await dotnet - .withDiagnosticTracing(false) - .withApplicationArgumentsFromQuery() - .create(); - -const config = dotnetRuntime.getConfig(); - -await dotnetRuntime.runMainAndExit(config.mainAssemblyName, [window.location.search]); \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/FrontendAvalonia.Browser.csproj b/FrontendAvalonia/FrontendAvalonia.Browser/FrontendAvalonia.Browser.csproj deleted file mode 100644 index 70e35b6..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/FrontendAvalonia.Browser.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - net7.0 - browser-wasm - AppBundle\main.js - Exe - - - - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/Program.cs b/FrontendAvalonia/FrontendAvalonia.Browser/Program.cs deleted file mode 100644 index 16eecc7..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.Versioning; -using System.Threading.Tasks; -using Avalonia; -using Avalonia.Browser; -using Avalonia.ReactiveUI; -using FrontendAvalonia; - -[assembly: SupportedOSPlatform("browser")] - -internal partial class Program -{ - private static async Task Main(string[] args) => await BuildAvaloniaApp() - .WithInterFont() - .UseReactiveUI() - .StartBrowserAppAsync("out"); - - public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure(); -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/Properties/launchSettings.json b/FrontendAvalonia/FrontendAvalonia.Browser/Properties/launchSettings.json deleted file mode 100644 index cefdffd..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/Properties/launchSettings.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "profiles": { - "FrontendAvalonia.Browser": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/debug?browser={browserInspectUri}" - } - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Browser/runtimeconfig.template.json b/FrontendAvalonia/FrontendAvalonia.Browser/runtimeconfig.template.json deleted file mode 100644 index c6990ba..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Browser/runtimeconfig.template.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "wasmHostProperties": { - "perHostConfig": [ - { - "name": "browser", - "html-path": "index.html", - "Host": "browser" - } - ] - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Desktop/.avalonia-build-tasks/id b/FrontendAvalonia/FrontendAvalonia.Desktop/.avalonia-build-tasks/id deleted file mode 100644 index 0105b2b..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Desktop/.avalonia-build-tasks/id +++ /dev/null @@ -1 +0,0 @@ -Åÿg/‘L¼õ“Ѓ^/™ \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Desktop/FrontendAvalonia.Desktop.csproj b/FrontendAvalonia/FrontendAvalonia.Desktop/FrontendAvalonia.Desktop.csproj deleted file mode 100644 index 4d5cf0d..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Desktop/FrontendAvalonia.Desktop.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - WinExe - - net7.0 - enable - true - - - - app.manifest - - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.Desktop/Program.cs b/FrontendAvalonia/FrontendAvalonia.Desktop/Program.cs deleted file mode 100644 index 711d4c0..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Desktop/Program.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Avalonia; -using Avalonia.ReactiveUI; - -namespace FrontendAvalonia.Desktop; - -class Program -{ - // Initialization code. Don't use any Avalonia, third-party APIs or any - // SynchronizationContext-reliant code before AppMain is called: things aren't initialized - // yet and stuff might break. - [STAThread] - public static void Main(string[] args) => BuildAvaloniaApp() - .StartWithClassicDesktopLifetime(args); - - // Avalonia configuration, don't remove; also used by visual designer. - public static AppBuilder BuildAvaloniaApp() - => AppBuilder.Configure() - .UsePlatformDetect() - .WithInterFont() - .LogToTrace() - .UseReactiveUI(); -} diff --git a/FrontendAvalonia/FrontendAvalonia.Desktop/Properties/launchSettings.json b/FrontendAvalonia/FrontendAvalonia.Desktop/Properties/launchSettings.json deleted file mode 100644 index dacc6e2..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Desktop/Properties/launchSettings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "profiles": { - "FrontendAvalonia.Desktop": { - "commandName": "Project" - }, - "WSL": { - "commandName": "WSL2", - "distributionName": "" - } - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia.Desktop/app.manifest b/FrontendAvalonia/FrontendAvalonia.Desktop/app.manifest deleted file mode 100644 index bd198f9..0000000 --- a/FrontendAvalonia/FrontendAvalonia.Desktop/app.manifest +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.csproj b/FrontendAvalonia/FrontendAvalonia.csproj deleted file mode 100644 index dceb682..0000000 --- a/FrontendAvalonia/FrontendAvalonia.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - WinExe - net6.0 - enable - true - app.manifest - - - - - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.iOS/AppDelegate.cs b/FrontendAvalonia/FrontendAvalonia.iOS/AppDelegate.cs deleted file mode 100644 index c5c2ef7..0000000 --- a/FrontendAvalonia/FrontendAvalonia.iOS/AppDelegate.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Foundation; -using UIKit; -using Avalonia; -using Avalonia.Controls; -using Avalonia.iOS; -using Avalonia.Media; -using Avalonia.ReactiveUI; - -namespace FrontendAvalonia.iOS; - -// The UIApplicationDelegate for the application. This class is responsible for launching the -// User Interface of the application, as well as listening (and optionally responding) to -// application events from iOS. -[Register("AppDelegate")] -public partial class AppDelegate : AvaloniaAppDelegate -{ - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - return base.CustomizeAppBuilder(builder) - .WithInterFont() - .UseReactiveUI(); - } -} diff --git a/FrontendAvalonia/FrontendAvalonia.iOS/Entitlements.plist b/FrontendAvalonia/FrontendAvalonia.iOS/Entitlements.plist deleted file mode 100644 index 0c67376..0000000 --- a/FrontendAvalonia/FrontendAvalonia.iOS/Entitlements.plist +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.iOS/FrontendAvalonia.iOS.csproj b/FrontendAvalonia/FrontendAvalonia.iOS/FrontendAvalonia.iOS.csproj deleted file mode 100644 index c8e91c2..0000000 --- a/FrontendAvalonia/FrontendAvalonia.iOS/FrontendAvalonia.iOS.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - Exe - net7.0-ios - 10.0 - manual - enable - iossimulator-x64 - - - - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.iOS/Info.plist b/FrontendAvalonia/FrontendAvalonia.iOS/Info.plist deleted file mode 100644 index 742b690..0000000 --- a/FrontendAvalonia/FrontendAvalonia.iOS/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDisplayName - FrontendAvalonia - CFBundleIdentifier - companyName.FrontendAvalonia - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - MinimumOSVersion - 10.0 - UIDeviceFamily - - 1 - 2 - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIStatusBarHidden - - UIViewControllerBasedStatusBarAppearance - - - diff --git a/FrontendAvalonia/FrontendAvalonia.iOS/Main.cs b/FrontendAvalonia/FrontendAvalonia.iOS/Main.cs deleted file mode 100644 index 77d1306..0000000 --- a/FrontendAvalonia/FrontendAvalonia.iOS/Main.cs +++ /dev/null @@ -1,14 +0,0 @@ -using UIKit; - -namespace FrontendAvalonia.iOS; - -public class Application -{ - // This is the main entry point of the application. - static void Main(string[] args) - { - // if you want to use a different Application Delegate class from "AppDelegate" - // you can specify it here. - UIApplication.Main(args, null, typeof(AppDelegate)); - } -} diff --git a/FrontendAvalonia/FrontendAvalonia.iOS/Resources/LaunchScreen.xib b/FrontendAvalonia/FrontendAvalonia.iOS/Resources/LaunchScreen.xib deleted file mode 100644 index efe278d..0000000 --- a/FrontendAvalonia/FrontendAvalonia.iOS/Resources/LaunchScreen.xib +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia.sln b/FrontendAvalonia/FrontendAvalonia.sln deleted file mode 100644 index e8931b2..0000000 --- a/FrontendAvalonia/FrontendAvalonia.sln +++ /dev/null @@ -1,54 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.32811.315 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendAvalonia", "FrontendAvalonia\FrontendAvalonia.csproj", "{EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendAvalonia.Desktop", "FrontendAvalonia.Desktop\FrontendAvalonia.Desktop.csproj", "{ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendAvalonia.Browser", "FrontendAvalonia.Browser\FrontendAvalonia.Browser.csproj", "{1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendAvalonia.iOS", "FrontendAvalonia.iOS\FrontendAvalonia.iOS.csproj", "{EBD9022F-BC83-4846-9A11-6F7F3772DC64}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FrontendAvalonia.Android", "FrontendAvalonia.Android\FrontendAvalonia.Android.csproj", "{7AD1DAC8-7FBE-49D5-8614-7321233DB82E}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3DA99C4E-89E3-4049-9C22-0A7EC60D83D8}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EBFA8512-1EA5-4D8C-B4AC-AB5B48A6D568}.Release|Any CPU.Build.0 = Release|Any CPU - {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABC31E74-02FF-46EB-B3B2-4E6AE43B456C}.Release|Any CPU.Build.0 = Release|Any CPU - {1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C1A049E-235C-4CD0-B6FA-D53AC418F4DA}.Release|Any CPU.Build.0 = Release|Any CPU - {EBD9022F-BC83-4846-9A11-6F7F3772DC64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EBD9022F-BC83-4846-9A11-6F7F3772DC64}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EBD9022F-BC83-4846-9A11-6F7F3772DC64}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EBD9022F-BC83-4846-9A11-6F7F3772DC64}.Release|Any CPU.Build.0 = Release|Any CPU - {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7AD1DAC8-7FBE-49D5-8614-7321233DB82E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {83CB65B8-011F-4ED7-BCD3-A6CFA935EF7E} - EndGlobalSection -EndGlobal diff --git a/FrontendAvalonia/FrontendAvalonia/.avalonia-build-tasks/id b/FrontendAvalonia/FrontendAvalonia/.avalonia-build-tasks/id deleted file mode 100644 index 61fd20c..0000000 --- a/FrontendAvalonia/FrontendAvalonia/.avalonia-build-tasks/id +++ /dev/null @@ -1 +0,0 @@ -À¼óÂ˵šBºNèÓÑ_Θ \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/App.axaml b/FrontendAvalonia/FrontendAvalonia/App.axaml deleted file mode 100644 index a0753df..0000000 --- a/FrontendAvalonia/FrontendAvalonia/App.axaml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/App.axaml.cs b/FrontendAvalonia/FrontendAvalonia/App.axaml.cs deleted file mode 100644 index 15663c3..0000000 --- a/FrontendAvalonia/FrontendAvalonia/App.axaml.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using Avalonia; -using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Markup.Xaml; -using FrontendAvalonia.Extensions; -using FrontendAvalonia.Models; -using FrontendAvalonia.Services.GamenightApi; -using FrontendAvalonia.ViewModels; -using FrontendAvalonia.Views; -using ReactiveUI; -using Refit; -using Splat; - -namespace FrontendAvalonia; - -public partial class App : Application -{ - public override void Initialize() - { - AvaloniaXamlLoader.Load(this); - } - - public override void OnFrameworkInitializationCompleted() - { - var mutable = Locator.CurrentMutable; - var locator = Locator.Current ?? throw new InvalidOperationException("Locator should not be null here."); - mutable.RegisterLazySingleton(() => new GamenightModel()); - - mutable.RegisterLazySingleton(() => new MainScreenViewModel()); - mutable.RegisterLazySingleton(() => RestService.For("http://localhost:8080")); - - mutable.Register(() => new AddGamenightViewModel( - locator.GetRequiredService(), - locator.GetRequiredService())); - mutable.Register(() => new LoginViewModel( - locator.GetRequiredService(), - locator.GetRequiredService(), - locator.GetRequiredService())); - mutable.Register(() => new GamenightsViewModel( - locator.GetRequiredService(), - locator.GetRequiredService(), - locator.GetRequiredService(), - locator.GetRequiredService())); - mutable.Register(() => new MainViewModel( - locator.GetRequiredService(), - locator.GetRequiredService(), - locator.GetRequiredService(), - locator.GetRequiredService(), - locator.GetRequiredService())); - - - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - desktop.MainWindow = new MainWindow - { - DataContext = Locator.Current.GetService() - }; - } - else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) - { - singleViewPlatform.MainView = new MainView - { - DataContext = Locator.Current.GetService() - }; - } - - Locator.Current.GetService()?.Router.Navigate.Execute(Locator.Current.GetService() ?? throw new InvalidOperationException("Could not find initial viewmodel to navigate to")); - - base.OnFrameworkInitializationCompleted(); - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/Assets/avalonia-logo.ico b/FrontendAvalonia/FrontendAvalonia/Assets/avalonia-logo.ico deleted file mode 100644 index da8d49f..0000000 Binary files a/FrontendAvalonia/FrontendAvalonia/Assets/avalonia-logo.ico and /dev/null differ diff --git a/FrontendAvalonia/FrontendAvalonia/Extensions/SplatExtensions.cs b/FrontendAvalonia/FrontendAvalonia/Extensions/SplatExtensions.cs deleted file mode 100644 index 96498a9..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Extensions/SplatExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Splat; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace FrontendAvalonia.Extensions -{ - public static class SplatExtensions - { - public static T GetRequiredService(this IReadonlyDependencyResolver resolver, string? contract = null) - { - if (resolver is null) - { - throw new ArgumentNullException(nameof(resolver)); - } - - return resolver.GetService(contract) ?? throw new InvalidOperationException($"Service {typeof(T).Name} was required but was not registered."); - } - } -} diff --git a/FrontendAvalonia/FrontendAvalonia/FrontendAvalonia.csproj b/FrontendAvalonia/FrontendAvalonia/FrontendAvalonia.csproj deleted file mode 100644 index 99f812d..0000000 --- a/FrontendAvalonia/FrontendAvalonia/FrontendAvalonia.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - net7.0 - enable - latest - true - - - - - - - - - - - - - - - - - - - - True - True - Gamenight.yaml - - - LoginView.axaml - - - GamenightsView.axaml - - - AddGamenight.axaml - - - - - - RefitterCodeGenerator - Gamenight.cs - - - diff --git a/FrontendAvalonia/FrontendAvalonia/Models/GamenightModel.cs b/FrontendAvalonia/FrontendAvalonia/Models/GamenightModel.cs deleted file mode 100644 index 0cc78a9..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Models/GamenightModel.cs +++ /dev/null @@ -1,16 +0,0 @@ - -using ReactiveUI; - -namespace FrontendAvalonia.Models -{ - public class GamenightModel : ReactiveObject - { - private string? _userToken; - - public string? UserToken - { - get => _userToken; - set => this.RaiseAndSetIfChanged(ref _userToken, value); - } - } -} diff --git a/FrontendAvalonia/FrontendAvalonia/Services/GamenightApi/Gamenight.cs b/FrontendAvalonia/FrontendAvalonia/Services/GamenightApi/Gamenight.cs deleted file mode 100644 index 509ea44..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Services/GamenightApi/Gamenight.cs +++ /dev/null @@ -1,240 +0,0 @@ - -//---------------------- -// -// Generated REST API Client Code Generator v1.7.17.0 on 6/26/2023 11:20:46 AM -// Using the tool Refitter v0.6.0 -// -//---------------------- - - -// -// This code was generated by Refitter. -// - -using Refit; -using System.Collections.Generic; -using System.Text.Json.Serialization; -using System.Threading; -using System.Threading.Tasks; - -namespace FrontendAvalonia.Services.GamenightApi -{ - public interface IGamenight - { - /// - /// Submit your credentials to get a JWT-token to use with the rest of the api. - /// - [Post("/token")] - Task> GetToken([Body] object body, CancellationToken cancellationToken = default); - - /// - /// Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match. - /// - [Post("/user")] - Task PostRegister([Body] object body, CancellationToken cancellationToken = default); - - /// - /// Retrieve the list of gamenights on this gamenight server. Requires authorization. - /// - [Get("/gamenights")] - Task>> GetGamenights(CancellationToken cancellationToken = default); - - /// - /// Add a gamenight by providing a name and a date, only available when providing an JWT token. - /// - [Post("/gamenight")] - Task PostGamenight([Body] object body, [Authorize("Bearer")] string token, CancellationToken cancellationToken = default); - - [Get("/gamenight")] - Task> GetGamenight([Body] object body, CancellationToken cancellationToken = default); - - - } -} - - -//---------------------- -// -// Generated using the NSwag toolchain v13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0)) (http://NSwag.org) -// -//---------------------- - -#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." -#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." -#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' -#pragma warning disable 612 // Disable "CS0612 '...' is obsolete" -#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... -#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." -#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" -#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" -#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" - -namespace FrontendAvalonia.Services.GamenightApi -{ - using System = global::System; - - - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class Gamenight - { - - [JsonPropertyName("id")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Id { get; set; } - - [JsonPropertyName("name")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Name { get; set; } - - [JsonPropertyName("datetime")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Datetime { get; set; } - - [JsonPropertyName("owner_id")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Owner_id { get; set; } - - private IDictionary _additionalProperties; - - [JsonExtensionData] - public IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class Failure - { - - [JsonPropertyName("message")] - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - public string Message { get; set; } - - private IDictionary _additionalProperties; - - [JsonExtensionData] - public IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class Token - { - - [JsonPropertyName("jwt_token")] - - [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] - public string Jwt_token { get; set; } - - private IDictionary _additionalProperties; - - [JsonExtensionData] - public IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class Login - { - - [JsonPropertyName("username")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Username { get; set; } - - [JsonPropertyName("password")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Password { get; set; } - - private IDictionary _additionalProperties; - - [JsonExtensionData] - public IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } - set { _additionalProperties = value; } - } - - } - - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.19.0.0 (NJsonSchema v10.9.0.0 (Newtonsoft.Json v13.0.3.0))")] - public partial class Registration - { - - [JsonPropertyName("username")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Username { get; set; } - - [JsonPropertyName("email")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Email { get; set; } - - [JsonPropertyName("password")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Password { get; set; } - - [JsonPropertyName("password_repeat")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Password_repeat { get; set; } - - [JsonPropertyName("registration_token")] - - [JsonIgnore(Condition = JsonIgnoreCondition.Never)] - [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)] - public string Registration_token { get; set; } - - private IDictionary _additionalProperties; - - [JsonExtensionData] - public IDictionary AdditionalProperties - { - get { return _additionalProperties ?? (_additionalProperties = new Dictionary()); } - set { _additionalProperties = value; } - } - - } - - -} - -#pragma warning restore 108 -#pragma warning restore 114 -#pragma warning restore 472 -#pragma warning restore 612 -#pragma warning restore 1573 -#pragma warning restore 1591 -#pragma warning restore 8073 -#pragma warning restore 3016 -#pragma warning restore 8603 diff --git a/FrontendAvalonia/FrontendAvalonia/Services/GamenightApi/Gamenight.yaml b/FrontendAvalonia/FrontendAvalonia/Services/GamenightApi/Gamenight.yaml deleted file mode 100644 index ea992bc..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Services/GamenightApi/Gamenight.yaml +++ /dev/null @@ -1,224 +0,0 @@ -openapi: 3.0.0 -x-stoplight: - id: w776sltk0h1bo -info: - title: Gamenight - version: '1.0' - contact: - name: Dennis Brentjes - email: dennis@brentj.es - url: 'https://brentj.es' - description: Api specifaction for a Gamenight server - license: - name: MIT -servers: - - url: 'http://localhost:8080' - description: Gamenight -paths: - /token: - post: - summary: '' - operationId: get-token - responses: - '200': - $ref: '#/components/responses/TokenResponse' - '401': - $ref: '#/components/responses/FailureResponse' - requestBody: - $ref: '#/components/requestBodies/LoginRequest' - description: Submit your credentials to get a JWT-token to use with the rest of the api. - parameters: [] - /user: - post: - summary: '' - operationId: post-register - requestBody: - $ref: '#/components/requestBodies/RegisterRequest' - responses: - '200': - description: '' - '422': - $ref: '#/components/responses/FailureResponse' - description: 'Create a new user given a registration token and user information, username and email must be unique, and password and password_repeat must match.' - parameters: [] - /gamenights: - get: - summary: Your GET endpoint - responses: - '200': - $ref: '#/components/responses/GamenightsResponse' - '400': - $ref: '#/components/responses/FailureResponse' - '401': - $ref: '#/components/responses/FailureResponse' - operationId: get-gamenights - security: - - JWT-Auth: [] - description: Retrieve the list of gamenights on this gamenight server. Requires authorization. - /gamenight: - post: - summary: '' - operationId: post-gamenight - responses: - '200': - description: OK - '401': - $ref: '#/components/responses/FailureResponse' - '422': - $ref: '#/components/responses/FailureResponse' - security: - - JWT-Auth: [] - requestBody: - $ref: '#/components/requestBodies/AddGamenight' - description: 'Add a gamenight by providing a name and a date, only available when providing an JWT token.' - get: - summary: '' - operationId: get-gamenight - responses: - '200': - $ref: '#/components/responses/GamenightResponse' - '401': - $ref: '#/components/responses/FailureResponse' - '422': - $ref: '#/components/responses/FailureResponse' - requestBody: - $ref: '#/components/requestBodies/GetGamenight' - security: - - JWT-Auth: [] -components: - schemas: - Gamenight: - title: Gamenight - x-stoplight: - id: 0nmru75ph5wh3 - type: object - properties: - id: - type: string - name: - type: string - datetime: - type: string - owner_id: - type: string - required: - - id - - name - - datetime - - owner_id - Failure: - title: Failure - type: object - properties: - message: - type: string - description: '' - Token: - title: Token - x-stoplight: - id: 8pz19kigm1jer - type: object - properties: - jwt_token: - type: string - Login: - title: Login - type: object - properties: - username: - type: string - password: - type: string - required: - - username - - password - Registration: - title: Registration - type: object - properties: - username: - type: string - email: - type: string - password: - type: string - password_repeat: - type: string - registration_token: - type: string - required: - - username - - email - - password - - password_repeat - - registration_token - requestBodies: - LoginRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/Login' - RegisterRequest: - content: - application/json: - schema: - $ref: '#/components/schemas/Registration' - AddGamenight: - content: - application/json: - schema: - type: object - properties: - name: - type: string - datetime: - type: string - GetGamenight: - content: - application/json: - schema: - type: object - properties: - id: - type: string - responses: - TokenResponse: - description: Example response - content: - application/json: - schema: - $ref: '#/components/schemas/Token' - FailureResponse: - description: Example response - content: - application/json: - schema: - $ref: '#/components/schemas/Failure' - application/xml: - schema: - type: object - properties: - message: - type: string - required: - - message - GamenightsResponse: - description: Example response - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Gamenight' - GamenightResponse: - description: Example response - content: - application/json: - schema: - $ref: '#/components/schemas/Gamenight' - securitySchemes: - JWT-Auth: - type: http - scheme: bearer - bearerFormat: JWT - description: '' diff --git a/FrontendAvalonia/FrontendAvalonia/ViewLocator.cs b/FrontendAvalonia/FrontendAvalonia/ViewLocator.cs deleted file mode 100644 index 7849ce6..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewLocator.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Runtime.Serialization; -using Avalonia.Controls; -using Avalonia.Controls.Templates; -using FrontendAvalonia.ViewModels; -using FrontendAvalonia.Views; -using ReactiveUI; - -namespace FrontendAvalonia; - -public class ViewLocator : IViewLocator -{ - public IViewFor? ResolveView(T? viewModel, string? contract = null) - { - return viewModel switch - { - GamenightsViewModel context => new GamenightsView { DataContext = context }, - LoginViewModel context => new LoginView { DataContext = context }, - _ => throw new InvalidOperationException($"Cannot find view for {viewModel?.GetType().Name}") - }; - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/AddGamenightViewModel.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/AddGamenightViewModel.cs deleted file mode 100644 index 8e1b05a..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/AddGamenightViewModel.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Runtime.InteropServices.JavaScript; -using System.Threading; -using System.Threading.Tasks; -using System.Windows.Input; -using FrontendAvalonia.Models; -using FrontendAvalonia.Services.GamenightApi; -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class AddGamenightViewModel : ViewModelBase -{ - private IGamenight Gamenight { get; } - - private GamenightModel GamenightModel { get; } - - private bool _expanded; - - public bool Expanded - { - get => _expanded; - set => this.RaiseAndSetIfChanged(ref _expanded, value); - } - - public AddGamenightViewModel(IGamenight gamenight, GamenightModel gamenightModel) - { - Gamenight = gamenight; - GamenightModel = gamenightModel; - StartDate = DateTime.Now.Date; - EndDate = DateTime.Now.Date; - AddCommand = ReactiveCommand.CreateFromTask(AddGamenight); - } - - private async Task AddGamenight(CancellationToken ct) - { - var body = new Gamenight - { - Name = Name, - Datetime = (StartDate + StartTime).ToString("u").Replace(" ", "T"), - }; - await Gamenight.PostGamenight(body, GamenightModel.UserToken, ct); - } - - private string _name = string.Empty; - - public string Name - { - get => _name; - set => this.RaiseAndSetIfChanged(ref _name, value); - } - - private DateTimeOffset _startDate; - - public DateTimeOffset StartDate - { - get => _startDate; - set => this.RaiseAndSetIfChanged(ref _startDate, value); - } - - private TimeSpan _startTime; - - public TimeSpan StartTime - { - get => _startTime; - set => this.RaiseAndSetIfChanged(ref _startTime, value); - } - - private DateTimeOffset _endDate; - - public DateTimeOffset EndDate - { - get => _endDate; - set => this.RaiseAndSetIfChanged(ref _endDate, value); - } - - private TimeSpan _endTime; - - public TimeSpan EndTime - { - get => _endTime; - set => this.RaiseAndSetIfChanged(ref _endTime, value); - } - - public ICommand AddCommand { get; } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/GamenightsViewModel.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/GamenightsViewModel.cs deleted file mode 100644 index 754c7b4..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/GamenightsViewModel.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using DynamicData.Binding; -using FrontendAvalonia.Models; -using FrontendAvalonia.Services.GamenightApi; -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class GamenightsViewModel : PageViewModelBase -{ - private IGamenight Gamenight { get; } - private GamenightModel Model { get; } - private LoginViewModel LoginViewModel { get; } - - public AddGamenightViewModel AddGamenightViewModel { get; } - - private ObservableCollectionExtended _gamenightItems = new ObservableCollectionExtended(); - public ObservableCollectionExtended GamenightItems { - get => _gamenightItems; - set => this.RaiseAndSetIfChanged(ref _gamenightItems, value); - } - - public GamenightsViewModel(IScreen screen, IGamenight gamenight, GamenightModel model, LoginViewModel loginViewModel) - : base(screen) - { - Gamenight = gamenight; - Model = model; - LoginViewModel = loginViewModel; - AddGamenightViewModel = new AddGamenightViewModel(Gamenight, model); - this._gamenightItems.Add(AddGamenightViewModel); - this.WhenActivated(OnActivated); - } - - private IEnumerable OnActivated() - { - if (Model.UserToken == null) - { - HostScreen.Router.Navigate.Execute(LoginViewModel); - } - return Enumerable.Empty(); - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/LoginViewModel.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/LoginViewModel.cs deleted file mode 100644 index d4e25d8..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/LoginViewModel.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Threading.Tasks; -using System.Windows.Input; -using FrontendAvalonia.Models; -using FrontendAvalonia.Services.GamenightApi; -using FrontendAvalonia.Views; -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class LoginViewModel : PageViewModelBase -{ - private IGamenight GamenightApi { get; } - private GamenightModel Model { get; } - - public string Username { get; set; } = string.Empty; - public string Password { get; set; } = string.Empty; - public ICommand LoginCommand { get; } - - public LoginViewModel(IScreen screen, IGamenight gamenightApi, GamenightModel model) - :base(screen) - { - GamenightApi = gamenightApi; - Model = model; - - LoginCommand = ReactiveCommand.CreateFromTask(Login); - } - - private async Task Login() - { - var result = await GamenightApi.GetToken(new Login { Username = Username, Password = Password }); - if (result is { IsSuccessStatusCode: true }) - { - Model.UserToken = result.Content?.Jwt_token; - HostScreen.Router.NavigateBack.Execute(); - } - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/MainScreenViewModel.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/MainScreenViewModel.cs deleted file mode 100644 index eb5789a..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/MainScreenViewModel.cs +++ /dev/null @@ -1,8 +0,0 @@ -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class MainScreenViewModel : IScreen -{ - public RoutingState Router { get; } = new(); -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/MainViewModel.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/MainViewModel.cs deleted file mode 100644 index 97b4e6d..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/MainViewModel.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reactive; -using System.Threading.Tasks; -using System.Windows.Input; -using Avalonia.Controls; -using Avalonia.Input; -using DynamicData.Binding; -using FrontendAvalonia.Models; -using FrontendAvalonia.Services.GamenightApi; -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class MainViewModel : PageViewModelBase -{ - private GamenightModel GamenightModel { get; } - - private List _MenuItems = new(); - - public List MenuItems - { - get => _MenuItems; - set => this.RaiseAndSetIfChanged(ref _MenuItems, value); - } - - public IGamenight? Gamenight { get; } - - private LoginViewModel LoginViewModel { get; } - - private GamenightsViewModel GamenightsViewModel { get; } - - public MainViewModel(IScreen screen, GamenightModel gamenightModel, IGamenight gamenight, LoginViewModel loginViewModel, GamenightsViewModel gamenightsViewModel) - :base(screen) - { - GamenightModel = gamenightModel; - MenuItems = new List(); - Gamenight = gamenight; - LoginViewModel = loginViewModel; - GamenightsViewModel = gamenightsViewModel; - - gamenightModel.WhenAnyValue(m => m.UserToken).Subscribe(CreateMenuItems); - } - - private Task NavigateToLoginPage() - { - return Task.FromResult(HostScreen.Router.Navigate.Execute(LoginViewModel)); - } - - private Task NavigateToGamenightsPage() - { - return Task.FromResult(HostScreen.Router.NavigateAndReset.Execute(GamenightsViewModel)); - } - - private void CreateMenuItems(string? userToken) - { - if (userToken != null) - { - MenuItems = new List - { - new() - { - Header = "_Logout", - Command = ReactiveCommand.Create(async () => - { - GamenightModel.UserToken = null; - await NavigateToGamenightsPage(); - }), - CommandParameter = null!, - Items = new List(), - } - }; - } - else - { - MenuItems = new List - { - new() - { - Header = "_Login", - Command = ReactiveCommand.CreateFromTask(NavigateToLoginPage), - CommandParameter = null!, - Items = new List(), - } - }; - } - } - - // The command that navigates a user back. - public ReactiveCommand GoBack => HostScreen.Router.NavigateBack; -} diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/MenuItemViewModel.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/MenuItemViewModel.cs deleted file mode 100644 index 7ad6ec1..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/MenuItemViewModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using System.Windows.Input; -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels -{ - public class MenuItemViewModel : ViewModelBase - { - public string Header { get; set; } = "Placeholder"; - public ICommand Command { get; set; } = ReactiveCommand.Create(() => { }); - public object? CommandParameter { get; set; } = null; - public IList Items { get; set; } = new List(); - } -} diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/PageViewModelBase.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/PageViewModelBase.cs deleted file mode 100644 index 66d8bd9..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/PageViewModelBase.cs +++ /dev/null @@ -1,16 +0,0 @@ -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class PageViewModelBase : ViewModelBase, IRoutableViewModel, IActivatableViewModel -{ - public PageViewModelBase(IScreen screen) - { - UrlPathSegment = GetType().Name.Replace("ViewModel", ""); - HostScreen = screen; - } - - public string? UrlPathSegment { get; } - public IScreen HostScreen { get; } - public ViewModelActivator Activator { get; } = new(); -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/ViewModels/ViewModelBase.cs b/FrontendAvalonia/FrontendAvalonia/ViewModels/ViewModelBase.cs deleted file mode 100644 index 65e9afc..0000000 --- a/FrontendAvalonia/FrontendAvalonia/ViewModels/ViewModelBase.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Microsoft.CodeAnalysis.CSharp.Syntax; -using ReactiveUI; - -namespace FrontendAvalonia.ViewModels; - -public class ViewModelBase : ReactiveObject -{ -} diff --git a/FrontendAvalonia/FrontendAvalonia/Views/AddGamenight.axaml b/FrontendAvalonia/FrontendAvalonia/Views/AddGamenight.axaml deleted file mode 100644 index 53bdfc8..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Views/AddGamenight.axaml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - diff --git a/FrontendAvalonia/FrontendAvalonia/Views/LoginView.axaml.cs b/FrontendAvalonia/FrontendAvalonia/Views/LoginView.axaml.cs deleted file mode 100644 index c23f90f..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Views/LoginView.axaml.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Avalonia.ReactiveUI; -using FrontendAvalonia.ViewModels; -using ReactiveUI; - -namespace FrontendAvalonia.Views; - -public partial class LoginView : ReactiveUserControl -{ - public LoginView() - { - this.WhenActivated(disposables => { }); - InitializeComponent(); - } -} \ No newline at end of file diff --git a/FrontendAvalonia/FrontendAvalonia/Views/MainView.axaml b/FrontendAvalonia/FrontendAvalonia/Views/MainView.axaml deleted file mode 100644 index cdab6ab..0000000 --- a/FrontendAvalonia/FrontendAvalonia/Views/MainView.axaml +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ); - } else { - return ( - setExpanded(true)}> - - - ); - } -} - -export default AddGameNight \ No newline at end of file diff --git a/frontend/src/components/AdminPanel.jsx b/frontend/src/components/AdminPanel.jsx deleted file mode 100644 index 2a1b50b..0000000 --- a/frontend/src/components/AdminPanel.jsx +++ /dev/null @@ -1,178 +0,0 @@ -import {useState, useEffect} from 'react'; -import Checkbox from '@mui/material/Checkbox'; -import Table from '@mui/material/Table'; -import TableBody from '@mui/material/TableBody'; -import TableCell from '@mui/material/TableCell'; -import TableContainer from '@mui/material/TableContainer'; -import TableHead from '@mui/material/TableHead'; -import TablePagination from '@mui/material/TablePagination'; -import TableRow from '@mui/material/TableRow'; -import Button from '@mui/material/Button'; -import TextField from '@mui/material/TextField'; -import IconButton from '@mui/material/IconButton'; -import DeleteIcon from '@mui/icons-material/Delete'; -import { DateTimePicker } from '@mui/x-date-pickers'; -import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'; -import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; - -import moment from 'moment'; -import {get_registration_tokens, add_registration_token, delete_registration_token, unpack_api_result} from '../api/Api'; - -function AdminPanel(props) { - - const [page, setPage] = useState(0); - const [rowsPerPage, setRowsPerPage] = useState(10); - const [registrationTokens, setRegistrationTokens] = useState([]); - const [expires, setExpires] = useState(null); - const [isSingleUse, setIsSingleUse] = useState(false); - - const handleChangePage = (event, newPage) => { - setPage(newPage); - }; - - const handleChangeRowsPerPage = (event) => { - setRowsPerPage(+event.target.value); - setPage(0); - }; - - const refetchTokens = () => { - if(props.user !== null) { - unpack_api_result(get_registration_tokens(props.user.jwt), props.setFlash) - .then(result => setRegistrationTokens(result.registration_tokens)); - } - } - - const deleteToken = (id) => { - if(props.user !== null) { - unpack_api_result(delete_registration_token(props.user.jwt, id), props.setFlash) - .then(() => refetchTokens()) - } - } - - const handleAddToken = () => { - let input = { - single_use: isSingleUse, - expires: expires, - } - - if(props.user !== null) { - unpack_api_result(add_registration_token(props.user.jwt, input), props.setFlash) - .then(() => refetchTokens()) - } - } - - useEffect(() => { - refetchTokens() - }, []) - - let columns = [ - { - id: 'single_use', - label: 'Single Use', - minWidth: 30, - format: value => (value ? "Yes" : "No") - }, - { id: 'token', label: 'Token', minwidht: 300}, - { - id: 'expires', - label: 'Expires', - minwidth: 200, - format: value => (moment(value).format('LL HH:mm')) - }, - { - id: 'delete_button', - label: '', - minwidth: 20, - } - ]; - - return ( - <> - -
-
{ e.preventDefault(); }}> - }/> - - setIsSingleUse(e.target.checked)}/> - - - -
-
- - - - - - {columns.map((column) => ( - - {column.label} - - ))} - - - - {registrationTokens - .slice(page * rowsPerPage, page * rowsPerPage + rowsPerPage) - .map((row) => { - return ( - - {columns.map((column) => { - const value = row[column.id]; - return ( - - {column.format - ? column.format(value) - : value} - - ); - })} - - { - e.stopPropagation(); - deleteToken(row.id) - }}> - - - - - ); - })} - -
-
- {registrationTokens.length > rowsPerPage && - } - - ); -} - -export default AdminPanel diff --git a/frontend/src/components/GameAdder.jsx b/frontend/src/components/GameAdder.jsx deleted file mode 100644 index 8d45dfe..0000000 --- a/frontend/src/components/GameAdder.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import * as React from 'react'; -import TextField from '@mui/material/TextField'; -import Chip from '@mui/material/Chip'; -import Autocomplete from '@mui/material/Autocomplete'; - -export default function GameAdder(props) { - - const [value, setValue] = React.useState([]); - - const emptyUuid = "00000000-0000-0000-0000-000000000000"; - - return ( - option.name} - freeSolo - selectOnFocus - renderTags={(value, getTagProps) => - value.map((option, index) => ( - - )) - } - renderInput={(params) => ( - - )} - onChange={(event, newValue) => { - newValue = newValue.map(option => { - if (typeof option === 'string') { - var match = props.games.find(g => g.name.toLowerCase() === option.toLowerCase()); - if(match !== undefined) { - return match - } else { - return {id: emptyUuid, name: option}; - } - } - else { - return option; - } - }); - - newValue = newValue.filter((value, index, self) => - index === self.findIndex((t) => ( - t.id === value.id && t.name === value.name - )) - ); - setValue(newValue); - props.onChange(newValue); - }} - - /> - ); -} \ No newline at end of file diff --git a/frontend/src/components/Gamenight.jsx b/frontend/src/components/Gamenight.jsx deleted file mode 100644 index 624196e..0000000 --- a/frontend/src/components/Gamenight.jsx +++ /dev/null @@ -1,127 +0,0 @@ -import React, { useState, useEffect } from 'react'; -import List from '@mui/material/List'; -import ListItem from '@mui/material/ListItem'; -import ListItemText from '@mui/material/ListItemText'; -import ListSubheader from '@mui/material/ListSubheader'; -import ArrowBackIcon from '@mui/icons-material/ArrowBack'; -import IconButton from '@mui/material/IconButton'; -import Typography from '@mui/material/Typography'; -import Button from '@mui/material/Button'; - -import moment from 'moment'; -import {unpack_api_result, get_gamenight, patch_gamenight} from '../api/Api'; - -function Gamenight(props) { - - const [dense, setDense] = useState(true); - const [gamenight, setGamenight] = useState(null); - - const fetchGamenight = () => { - if (props.user !== null) { - unpack_api_result(get_gamenight(props.gamenightId, props.user.jwt), props.setFlash) - .then(result => setGamenight(result.gamenight)); - } - } - - useEffect(fetchGamenight, []); - - let games = gamenight?.game_list.map(g => - ( - - - - ) - ); - - const participants = gamenight?.participants.map(p => - ( - - - - ) - ); - - const Join = () => { - const input = { - action: 'AddParticipant' - }; - - unpack_api_result(patch_gamenight(gamenight.id, input, props.user.jwt), props.setFlash) - .then(() => fetchGamenight()); - }; - - const Leave = () => { - const input = { - action: 'RemoveParticipant', - }; - - unpack_api_result(patch_gamenight(gamenight.id, input, props.user.jwt), props.setFlash) - .then(() => fetchGamenight()); - }; - - let join_or_leave_button; - if(gamenight?.participants.find(p => p.id === props.user.id) === undefined) { - join_or_leave_button = ( - - ) - } else { - join_or_leave_button = ( - - ) - } - - return ( -
- props.onDismis()}> - - - - - {gamenight?.name} - - - When: {moment(gamenight?.datetime).format('LL HH:mm')} - - - - Games: - - }> - {games} - - - Participants: - - }> - {participants} - - {join_or_leave_button} -
- ) -} - -export default Gamenight diff --git a/frontend/src/components/Gamenights.jsx b/frontend/src/components/Gamenights.jsx deleted file mode 100644 index a86903c..0000000 --- a/frontend/src/components/Gamenights.jsx +++ /dev/null @@ -1,74 +0,0 @@ -import * as React from 'react'; -import List from '@mui/material/List'; -import ListItem from '@mui/material/ListItem'; -import ListItemAvatar from '@mui/material/ListItemAvatar'; -import ListItemText from '@mui/material/ListItemText'; -import Avatar from '@mui/material/Avatar'; -import IconButton from '@mui/material/IconButton'; -import GamesIcon from '@mui/icons-material/Games'; -import DeleteIcon from '@mui/icons-material/Delete'; - -import AddGameNight from './AddGameNight'; -import {delete_gamenight, unpack_api_result} from '../api/Api'; - -function Gamenights(props) { - const [dense, setDense] = React.useState(false); - - const DeleteGamenight = (game_id) => { - if (props.user !== null) { - const input = { game_id: game_id }; - unpack_api_result(delete_gamenight(input, props.user.jwt), props.setFlash) - .then(() => props.refetchGamenights()); - } - } - - let gamenights = props.gamenights.map(g => { - let secondaryAction; - if(props.user.id === g.owner_id || props.user.role === 'Admin') { - secondaryAction = ( - { - e.stopPropagation(); - DeleteGamenight(g.id) - }}> - - - ) - } - return ( - props.onSelectGamenight(g)} - secondaryAction={ - secondaryAction - }> - - - - - - - - ) - }); - - return ( - <> - - - {gamenights} - - - ); -} - -export default Gamenights diff --git a/frontend/src/components/Login.jsx b/frontend/src/components/Login.jsx deleted file mode 100644 index 2a061ed..0000000 --- a/frontend/src/components/Login.jsx +++ /dev/null @@ -1,42 +0,0 @@ -import React, { useState } from 'react'; - -function Login(props) { - const [username, setUsername] = useState(""); - const [password, setPassword] = useState(""); - - const handleUsernameChange = (event) => { - setUsername(event.target.value); - }; - - const handlePasswordChange = (event) => { - setPassword(event.target.value); - }; - - const handleLogin = (event) => { - props.onChange({ username: username, password: password }); - event.preventDefault(); - }; - - return ( -
-
-
- Login - - - - - - - -
-
-
- ); -} - -export default Login diff --git a/frontend/src/components/MenuBar.jsx b/frontend/src/components/MenuBar.jsx deleted file mode 100644 index 93258b5..0000000 --- a/frontend/src/components/MenuBar.jsx +++ /dev/null @@ -1,64 +0,0 @@ -import * as React from 'react'; -import AppBar from '@mui/material/AppBar'; -import Toolbar from '@mui/material/Toolbar'; -import Typography from '@mui/material/Typography'; -import Button from '@mui/material/Button'; -import IconButton from '@mui/material/IconButton'; -import MenuIcon from '@mui/icons-material/Menu'; - -function MenuBar(props) { - - let adminPanelButton = null; - if (props.user?.role === 'Admin') { - adminPanelButton = ( - - ); - } - - let userButton = null; - if (props.user != null) { - userButton = ( - - ); - } - - return ( - - - - - - - Gamenight! - - {userButton !== null && userButton} - {adminPanelButton !== null && adminPanelButton} - - - - ); -} - -export default MenuBar; diff --git a/frontend/src/index.css b/frontend/src/index.css deleted file mode 100644 index ec2585e..0000000 --- a/frontend/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', - monospace; -} diff --git a/frontend/src/index.js b/frontend/src/index.js deleted file mode 100644 index d563c0f..0000000 --- a/frontend/src/index.js +++ /dev/null @@ -1,17 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; - -const root = ReactDOM.createRoot(document.getElementById('root')); -root.render( - - - -); - -// If you want to start measuring performance in your app, pass a function -// to log results (for example: reportWebVitals(console.log)) -// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals -reportWebVitals(); diff --git a/frontend/src/logo.svg b/frontend/src/logo.svg deleted file mode 100644 index 9dfc1c0..0000000 --- a/frontend/src/logo.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/reportWebVitals.js b/frontend/src/reportWebVitals.js deleted file mode 100644 index 5253d3a..0000000 --- a/frontend/src/reportWebVitals.js +++ /dev/null @@ -1,13 +0,0 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } -}; - -export default reportWebVitals; diff --git a/frontend/src/setupTests.js b/frontend/src/setupTests.js deleted file mode 100644 index 8f2609b..0000000 --- a/frontend/src/setupTests.js +++ /dev/null @@ -1,5 +0,0 @@ -// jest-dom adds custom jest matchers for asserting on DOM nodes. -// allows you to do things like: -// expect(element).toHaveTextContent(/react/i) -// learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom'; diff --git a/gamenight-api-client-rs/.gitignore b/gamenight-api-client-rs/.gitignore index 6aa1064..00298ec 100644 --- a/gamenight-api-client-rs/.gitignore +++ b/gamenight-api-client-rs/.gitignore @@ -1,3 +1,9 @@ /target/ +git_push.sh **/*.rs.bk Cargo.lock +docs +src +.travis.yml +.openapi-generator +.openapi-generator-ignore diff --git a/gamenight-database/migrations/2022-05-28-142526_gamenight participants/down.sql b/gamenight-database/migrations/2022-05-28-142526_gamenight participant/down.sql similarity index 100% rename from gamenight-database/migrations/2022-05-28-142526_gamenight participants/down.sql rename to gamenight-database/migrations/2022-05-28-142526_gamenight participant/down.sql diff --git a/gamenight-database/migrations/2022-05-28-142526_gamenight participants/up.sql b/gamenight-database/migrations/2022-05-28-142526_gamenight participant/up.sql similarity index 100% rename from gamenight-database/migrations/2022-05-28-142526_gamenight participants/up.sql rename to gamenight-database/migrations/2022-05-28-142526_gamenight participant/up.sql diff --git a/gamenight-database/src/gamenight_participants.rs b/gamenight-database/src/gamenight_participants.rs index e3bd08b..c878931 100644 --- a/gamenight-database/src/gamenight_participants.rs +++ b/gamenight-database/src/gamenight_participants.rs @@ -11,7 +11,7 @@ use super::DbConnection; #[diesel(belongs_to(Gamenight))] #[diesel(belongs_to(User))] #[diesel(table_name = gamenight_participant)] -pub struct GamenightParticipants { +pub struct GamenightParticipant { pub gamenight_id: Uuid, pub user_id: Uuid, } diff --git a/gamenight-database/src/schema/schema.rs b/gamenight-database/src/schema/schema.rs new file mode 100644 index 0000000..cd1f2af --- /dev/null +++ b/gamenight-database/src/schema/schema.rs @@ -0,0 +1,83 @@ +// @generated automatically by Diesel CLI. + +pub mod sql_types { + #[derive(diesel::sql_types::SqlType)] + #[diesel(postgres_type(name = "role"))] + pub struct Role; +} + +diesel::table! { + gamenight (id) { + id -> Uuid, + name -> Varchar, + datetime -> Timestamptz, + owner_id -> Uuid, + } +} + +diesel::table! { + gamenight_gamelist (gamenight_id, game_id) { + gamenight_id -> Uuid, + game_id -> Uuid, + } +} + +diesel::table! { + gamenight_participant (gamenight_id, user_id) { + gamenight_id -> Uuid, + user_id -> Uuid, + } +} + +diesel::table! { + known_games (id) { + id -> Uuid, + name -> Varchar, + } +} + +diesel::table! { + pwd (user_id) { + user_id -> Uuid, + password -> Varchar, + } +} + +diesel::table! { + registration_tokens (id) { + id -> Uuid, + #[max_length = 32] + token -> Bpchar, + single_use -> Bool, + expires -> Nullable, + } +} + +diesel::table! { + use diesel::sql_types::*; + use super::sql_types::Role; + + users (id) { + id -> Uuid, + username -> Varchar, + email -> Varchar, + role -> Role, + } +} + +diesel::joinable!(gamenight -> users (owner_id)); +diesel::joinable!(gamenight_gamelist -> gamenight (gamenight_id)); +diesel::joinable!(gamenight_gamelist -> known_games (game_id)); +diesel::joinable!(gamenight_participant -> gamenight (gamenight_id)); +diesel::joinable!(gamenight_participant -> users (user_id)); +diesel::joinable!(pwd -> users (user_id)); + +diesel::allow_tables_to_appear_in_same_query!( + gamenight, + gamenight_gamelist, + gamenight_participant, + known_games, + pwd, + registration_tokens, + users, +);