Compare commits

..

3 Commits

Author SHA1 Message Date
gapodo f13db85eb2 save 2023-12-04 16:37:48 +01:00
gapodo 77c4ac51cb add docker dev build 2023-12-04 16:30:15 +01:00
gapodo a30b2544ad update gitignore 2023-12-04 14:03:47 +01:00
52 changed files with 306 additions and 5286 deletions

8
.dockerignore Normal file
View File

@ -0,0 +1,8 @@
**/node_modules/
**/dist
**/obj
**/bin
_Build/
Docs/
LANCommander.PowerShell/
LANCommander.PowerShell.Tests/

8
.gitignore vendored
View File

@ -354,3 +354,11 @@ LANCommander/Settings.yml
LANCommander/Saves/
LANCommander/Media/
LANCommander/Uploads/
# Build artefacts
_Build/
LANCommander/dist/
LANCommander/wwwroot/scripts/dist
# Jetbrains Rider
.idea/

33
Dockerfile.dev Normal file
View File

@ -0,0 +1,33 @@
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS builderbase
RUN apt update && apt install -y \
curl wget git ca-certificates gnupg && \
mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
NODE_MAJOR=20 && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt update && apt install nodejs -y && \
rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
echo -e "cache=/npmcache\nfund=false\nreplace-registry-host=never\n" > /etc/npmrc
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1
FROM builderbase as builder
ARG VERSION=0.2.3
WORKDIR /opt/LANCommander
RUN --mount=type=bind,source=./,target=/opt/LANCommander,rw \
--mount=type=cache,id=lancomnpm,target=/npmcache \
--mount=type=cache,id=lancomnuget,target=/root/.nuget/packages \
--mount=type=bind,source=./npmrc,target=/root/.npmrc \
cd LANCommander/wwwroot/scripts && npm install && cd /opt/LANCommander && \
dotnet build "./LANCommander/LANCommander.csproj" /p:Version="${VERSION}" && \
dotnet publish "./LANCommander/LANCommander.csproj" -c Release -o /_Build --self-contained --os linux -p:PublishSingleFile=true
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim
COPY --from=builder /_Build /opt/LANCommander
WORKDIR /opt/LANCommander
EXPOSE 1337
CMD /opt/LANCommander/LANCommander

View File

@ -1,16 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.53" />
<PackageReference Include="System.Text.Json" Version="7.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.54" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj" />
</ItemGroup>
</Project>

View File

@ -1,169 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F9EB13D4-8FD9-4095-B934-F7EC681E6901}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LANCommander.PlaynitePlugin</RootNamespace>
<AssemblyName>LANCommander.PlaynitePlugin</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\..\..\Games\Playnite\Extensions\LANCommander\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BeaconLib, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\rix0rrr.BeaconLib.1.0.2\lib\net40\BeaconLib.dll</HintPath>
</Reference>
<Reference Include="ByteSize, Version=2.1.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ByteSize.2.1.1\lib\net45\ByteSize.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.8.0.0\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Playnite.SDK, Version=6.10.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\PlayniteSDK.6.10.0\lib\net462\Playnite.SDK.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.34.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.34.2\lib\net462\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\PowerShellStandard.Library.5.1.1\lib\net452\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encoding.CodePages, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encoding.CodePages.8.0.0\lib\net462\System.Text.Encoding.CodePages.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.8.0.0\lib\net462\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.8.0.0\lib\net462\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Reference Include="YamlDotNet, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.5.4.0\lib\net45\YamlDotNet.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ZstdSharp, Version=0.7.2.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
<HintPath>..\packages\ZstdSharp.Port.0.7.2\lib\net461\ZstdSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Extensions\MultiplayerInfoExtensions.cs" />
<Compile Include="PlayniteLogger.cs" />
<Compile Include="SaveController.cs" />
<Compile Include="UninstallController.cs" />
<Compile Include="InstallController.cs" />
<Compile Include="LANCommanderLibraryPlugin.cs" />
<Compile Include="ViewModels\LANCommanderSettingsViewModel.cs" />
<Compile Include="Views\LANCommanderSettingsView.xaml.cs">
<DependentUpon>Views\LANCommanderSettingsView.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ViewModels\Authentication.cs" />
<Compile Include="Views\Authentication.xaml.cs">
<DependentUpon>Authentication.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Content Include="icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="app.config" />
<Content Include="extension.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Page Include="App.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Localization\en_US.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\LANCommanderSettingsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\Authentication.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.PowerShell\LANCommander.PowerShell.csproj">
<Project>{807943bf-0c7d-4ed3-8393-cfee64e3138c}</Project>
<Name>LANCommander.PowerShell</Name>
</ProjectReference>
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj">
<Project>{4c2a71fd-a30b-4d62-888a-4ef843d8e506}</Project>
<Name>LANCommander.SDK</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\..\..\..\Games\Playnite\Extensions\LANCommander\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Content Include="icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="extension.yaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.PowerShell\LANCommander.PowerShell.csproj" />
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="Microsoft.AspNetCore.SystemWebAdapters" Version="1.3.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="8.0.0" />
<PackageReference Include="System.Text.Json" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ByteSize" Version="2.1.1" />
<PackageReference Include="NuGet.CommandLine" Version="6.8.0" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="rix0rrr.BeaconLib" Version="1.0.2" />
<PackageReference Include="SharpCompress" Version="0.34.2" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
<PackageReference Include="ZstdSharp.Port" Version="0.7.4" />
</ItemGroup>
</Project>

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LANCommander.PlaynitePlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LANCommander.PlaynitePlugin")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("f9eb13d4-8fd9-4095-b934-f7ec681e6901")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -2,6 +2,7 @@
using Playnite.SDK;
using Playnite.SDK.Models;
using Playnite.SDK.Plugins;
using Microsoft.AspNetCore.Mvc;
namespace LANCommander.PlaynitePlugin
{

View File

@ -37,14 +37,4 @@ Packages:
- Installation progress dialog now shows the download percentage and transfer speed
- Full game download will be skipped if the game files already exist, see full release notes for more details
- Play sessions are now recorded to the server with user ID, start time, and end time
- Connection status now updates correctly when authenticating through addon settings
- Version: 0.3.0
RequiredApiVersion: 6.0.0
ReleaseDate: 2023-12-03
PackageUrl: https://github.com/LANCommander/LANCommander/releases/download/v0.3.0/LANCommander.PlaynitePlugin_48e1bac7-e0a0-45d7-ba83-36f5e9e959fc_0_3_0.pext
Changelog:
- Save paths now support regex patterns (experimental)
- Fixed redistributable archive downloading
- Fixed redistributable scripts not being able to run as admin if marked as such
- Fixed game save downloading
- Fixed addon loading of YamlDotNet library
- Connection status now updates correctly when authenticating through addon settings

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="ByteSize" version="2.1.1" targetFramework="net462" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="8.0.0" targetFramework="net462" />
<package id="Microsoft.Extensions.DependencyInjection.Abstractions" version="8.0.0" targetFramework="net462" />
<package id="Microsoft.Extensions.Logging.Abstractions" version="8.0.0" targetFramework="net462" />
<package id="NuGet.CommandLine" version="6.8.0" targetFramework="net462" developmentDependency="true" />
<package id="PlayniteSDK" version="6.10.0" targetFramework="net462" />
<package id="PowerShellStandard.Library" version="5.1.1" targetFramework="net462" />
<package id="RestSharp" version="106.15.0" targetFramework="net462" />
<package id="rix0rrr.BeaconLib" version="1.0.2" targetFramework="net462" />
<package id="SharpCompress" version="0.34.2" targetFramework="net462" />
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
<package id="System.Text.Encoding.CodePages" version="8.0.0" targetFramework="net462" />
<package id="System.Text.Encodings.Web" version="8.0.0" targetFramework="net462" />
<package id="System.Text.Json" version="8.0.0" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net462" />
<package id="YamlDotNet" version="5.4.0" targetFramework="net462" />
<package id="ZstdSharp.Port" version="0.7.2" targetFramework="net462" />
</packages>

View File

@ -1,115 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D7069A13-F0AA-4CBF-9013-4276F130A6DD}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LANCommander.PowerShell.Tests</RootNamespace>
<AssemblyName>LANCommander.PowerShell.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\MSTest.TestFramework.2.2.10\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
</Reference>
<Reference Include="RestSharp, Version=106.15.0.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
<HintPath>..\packages\RestSharp.106.15.0\lib\net452\RestSharp.dll</HintPath>
</Reference>
<Reference Include="SharpCompress, Version=0.34.2.0, Culture=neutral, PublicKeyToken=afb0a02973931d96, processorArchitecture=MSIL">
<HintPath>..\packages\SharpCompress.0.34.2\lib\net462\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encoding.CodePages, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encoding.CodePages.8.0.0\lib\net462\System.Text.Encoding.CodePages.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="YamlDotNet, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\YamlDotNet.5.4.0\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
<Reference Include="ZstdSharp, Version=0.7.4.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
<HintPath>..\packages\ZstdSharp.Port.0.7.4\lib\net462\ZstdSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Cmdlets.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.PowerShell\LANCommander.PowerShell.csproj">
<Project>{807943bf-0c7d-4ed3-8393-cfee64e3138c}</Project>
<Name>LANCommander.PowerShell</Name>
</ProjectReference>
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj">
<Project>{4c2a71fd-a30b-4d62-888a-4ef843d8e506}</Project>
<Name>LANCommander.SDK</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.props'))" />
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets'))" />
</Target>
<Import Project="..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.2.2.10\build\net46\MSTest.TestAdapter.targets')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<AssemblyTitle>LANCommander.PowerShell.Tests</AssemblyTitle>
<Product>LANCommander.PowerShell.Tests</Product>
<Copyright>Copyright © 2023</Copyright>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.PowerShell\LANCommander.PowerShell.csproj" />
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.*" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="RestSharp" Version="106.15.0" />
<PackageReference Include="SharpCompress" Version="0.34.2" />
<PackageReference Include="YamlDotNet" Version="5.4.0" />
<PackageReference Include="ZstdSharp.Port" Version="0.7.4" />
<PackageReference Include="Microsoft.AspNetCore.SystemWebAdapters" Version="1.3.0" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -1,20 +1,9 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
[assembly: AssemblyTitle("LANCommander.PowerShell.Tests")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LANCommander.PowerShell.Tests")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("d7069a13-f0aa-4cbf-9013-4276f130a6dd")]
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net462" />
<package id="MSTest.TestAdapter" version="2.2.10" targetFramework="net462" />
<package id="MSTest.TestFramework" version="2.2.10" targetFramework="net462" />
<package id="RestSharp" version="106.15.0" targetFramework="net462" />
<package id="SharpCompress" version="0.34.2" targetFramework="net462" />
<package id="System.Buffers" version="4.5.1" targetFramework="net462" />
<package id="System.Memory" version="4.5.5" targetFramework="net462" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net462" />
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net462" />
<package id="System.Text.Encoding.CodePages" version="8.0.0" targetFramework="net462" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net462" />
<package id="YamlDotNet" version="5.4.0" targetFramework="net462" />
<package id="ZstdSharp.Port" version="0.7.4" targetFramework="net462" />
</packages>

View File

@ -1,75 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{807943BF-0C7D-4ED3-8393-CFEE64E3138C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LANCommander.PowerShell</RootNamespace>
<AssemblyName>LANCommander.PowerShell</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\PowerShellStandard.Library.5.1.1\lib\net452\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Cmdlets\ConvertTo-SerializedBase64.cs" />
<Compile Include="Cmdlets\ConvertFrom-SerializedBase64.cs" />
<Compile Include="Cmdlets\Edit-PatchBinary.cs" />
<Compile Include="Cmdlets\Uninstall-Game.cs" />
<Compile Include="Cmdlets\Install-Game.cs" />
<Compile Include="Cmdlets\Write-ReplaceContentInFile.cs" />
<Compile Include="Cmdlets\ConvertTo-StringBytes.cs" />
<Compile Include="Cmdlets\Get-PrimaryDisplay.cs" />
<Compile Include="Cmdlets\Convert-AspectRatio.cs" />
<Compile Include="Cmdlets\Get-GameManifest.cs" />
<Compile Include="Cmdlets\Write-GameManifest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="LANCommander.PowerShell.psd1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj">
<Project>{4c2a71fd-a30b-4d62-888a-4ef843d8e506}</Project>
<Name>LANCommander.SDK</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<OutputType>Library</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
</PropertyGroup>
<ItemGroup>
<None Update="LANCommander.PowerShell.psd1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LANCommander.SDK\LANCommander.SDK.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
</ItemGroup>
</Project>

View File

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("LANCommander.PowerShell")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LANCommander.PowerShell")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("807943bf-0c7d-4ed3-8393-cfee64e3138c")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="PowerShellStandard.Library" version="5.1.1" targetFramework="net472" />
</packages>

View File

@ -48,7 +48,7 @@ namespace LANCommander.SDK
var response = ApiClient.Post<T>(request);
return response.Data;
return response;
}
private T PostRequest<T>(string route)
@ -58,7 +58,7 @@ namespace LANCommander.SDK
var response = ApiClient.Post<T>(request);
return response.Data;
return response;
}
private T GetRequest<T>(string route)
@ -68,7 +68,7 @@ namespace LANCommander.SDK
var response = ApiClient.Get<T>(request);
return response.Data;
return response;
}
private string DownloadRequest(string route, Action<DownloadProgressChangedEventArgs> progressHandler, Action<AsyncCompletedEventArgs> completeHandler)
@ -82,7 +82,7 @@ namespace LANCommander.SDK
client.DownloadProgressChanged += (s, e) => progressHandler(e);
client.DownloadFileCompleted += (s, e) => completeHandler(e);
client.DownloadFileAsync(new Uri($"{ApiClient.BaseUrl}{route}"), tempFile);
client.DownloadFileAsync(new Uri($"{ApiClient.Options.BaseUrl}{route}"), tempFile);
return tempFile;
}
@ -96,18 +96,20 @@ namespace LANCommander.SDK
client.Headers.Add("Authorization", $"Bearer {Token.AccessToken}");
var ws = client.OpenRead(new Uri($"{ApiClient.BaseUrl}{route}"));
var ws = client.OpenRead(new Uri($"{ApiClient.Options.BaseUrl}{route}"));
return new TrackableStream(ws, true, Convert.ToInt64(client.ResponseHeaders["Content-Length"]));
}
public async Task<AuthToken> AuthenticateAsync(string username, string password)
{
var response = await ApiClient.ExecuteAsync<AuthResponse>(new RestRequest("/api/Auth", Method.POST).AddJsonBody(new AuthRequest()
{
UserName = username,
Password = password
}));
var response = await ApiClient.ExecutePostAsync<AuthResponse>(new RestRequest("/api/Auth").AddJsonBody(
new AuthRequest()
{
UserName = username,
Password = password
}));
switch (response.StatusCode)
{
@ -133,7 +135,7 @@ namespace LANCommander.SDK
public async Task<AuthToken> RegisterAsync(string username, string password)
{
var response = await ApiClient.ExecuteAsync<AuthResponse>(new RestRequest("/api/auth/register", Method.POST).AddJsonBody(new AuthRequest()
var response = await ApiClient.ExecutePostAsync<AuthResponse>(new RestRequest("/api/auth/register").AddJsonBody(new AuthRequest()
{
UserName = username,
Password = password
@ -163,7 +165,7 @@ namespace LANCommander.SDK
public async Task<bool> PingAsync()
{
var response = await ApiClient.ExecuteAsync(new RestRequest("/api/Ping", Method.GET));
var response = await ApiClient.ExecuteGetAsync(new RestRequest("/api/Ping"));
return response.StatusCode == HttpStatusCode.OK;
}
@ -177,14 +179,11 @@ namespace LANCommander.SDK
var response = ApiClient.Post<AuthResponse>(request);
if (response.StatusCode != HttpStatusCode.OK)
throw new WebException(response.ErrorMessage);
Token = new AuthToken
{
AccessToken = response.Data.AccessToken,
RefreshToken = response.Data.RefreshToken,
Expiration = response.Data.Expiration
AccessToken = response.AccessToken,
RefreshToken = response.RefreshToken,
Expiration = response.Expiration
};
return Token;
@ -286,19 +285,19 @@ namespace LANCommander.SDK
{
Logger?.LogTrace("Uploading save...");
var request = new RestRequest($"/api/Saves/Upload/{gameId}", Method.POST)
var request = new RestRequest($"/api/Saves/Upload/{gameId}", Method.Post)
.AddHeader("Authorization", $"Bearer {Token.AccessToken}");
request.AddFile(gameId, data, gameId);
var response = ApiClient.Post<GameSave>(request);
return response.Data;
return response;
}
public string GetMediaUrl(Media media)
{
return (new Uri(ApiClient.BaseUrl, $"/api/Media/{media.Id}/Download?fileId={media.FileId}").ToString());
return (new Uri(ApiClient.Options.BaseUrl, $"/api/Media/{media.Id}/Download?fileId={media.FileId}").ToString());
}
public string GetKey(Guid id)

View File

@ -1,15 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="RestSharp" Version="106.15.0" />
<PackageReference Include="SharpCompress" Version="0.34.2" />
<PackageReference Include="YamlDotNet" Version="5.4.0" />
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="PowerShellStandard.Library" Version="5.1.1" />
<PackageReference Include="RestSharp" Version="110.2.0" />
<PackageReference Include="SharpCompress" Version="0.34.2" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
</ItemGroup>
</Project>

View File

@ -1,55 +1,55 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32328.378
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander", "LANCommander\LANCommander.csproj", "{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LANCommander.PlaynitePlugin", "LANCommander.Playnite.Extension\LANCommander.PlaynitePlugin.csproj", "{F9EB13D4-8FD9-4095-B934-F7EC681E6901}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.SDK", "LANCommander.SDK\LANCommander.SDK.csproj", "{4C2A71FD-A30B-4D62-888A-4EF843D8E506}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.PCGamingWiki", "LANCommander.PCGamingWiki\LANCommander.PCGamingWiki.csproj", "{2436B817-4475-4E70-9BB2-E1E7866DB79F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LANCommander.PowerShell", "LANCommander.PowerShell\LANCommander.PowerShell.csproj", "{807943BF-0C7D-4ED3-8393-CFEE64E3138C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LANCommander.PowerShell.Tests", "LANCommander.PowerShell.Tests\LANCommander.PowerShell.Tests.csproj", "{D7069A13-F0AA-4CBF-9013-4276F130A6DD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.Build.0 = Release|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Release|Any CPU.Build.0 = Release|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Release|Any CPU.Build.0 = Release|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Release|Any CPU.Build.0 = Release|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Release|Any CPU.Build.0 = Release|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CBA5868D-8784-40B3-8E3D-46C24FDDC425}
EndGlobalSection
EndGlobal
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.1.32328.378
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander", "LANCommander\LANCommander.csproj", "{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.PlaynitePlugin", "LANCommander.Playnite.Extension\LANCommander.PlaynitePlugin.csproj", "{F9EB13D4-8FD9-4095-B934-F7EC681E6901}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.SDK", "LANCommander.SDK\LANCommander.SDK.csproj", "{4C2A71FD-A30B-4D62-888A-4EF843D8E506}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.PCGamingWiki", "LANCommander.PCGamingWiki\LANCommander.PCGamingWiki.csproj", "{2436B817-4475-4E70-9BB2-E1E7866DB79F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.PowerShell", "LANCommander.PowerShell\LANCommander.PowerShell.csproj", "{807943BF-0C7D-4ED3-8393-CFEE64E3138C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LANCommander.PowerShell.Tests", "LANCommander.PowerShell.Tests\LANCommander.PowerShell.Tests.csproj", "{D7069A13-F0AA-4CBF-9013-4276F130A6DD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C64D17A8-CDB3-4D1E-858F-6CF05B6FED4D}.Release|Any CPU.Build.0 = Release|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F9EB13D4-8FD9-4095-B934-F7EC681E6901}.Release|Any CPU.Build.0 = Release|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4C2A71FD-A30B-4D62-888A-4EF843D8E506}.Release|Any CPU.Build.0 = Release|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2436B817-4475-4E70-9BB2-E1E7866DB79F}.Release|Any CPU.Build.0 = Release|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{807943BF-0C7D-4ED3-8393-CFEE64E3138C}.Release|Any CPU.Build.0 = Release|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D7069A13-F0AA-4CBF-9013-4276F130A6DD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CBA5868D-8784-40B3-8E3D-46C24FDDC425}
EndGlobalSection
EndGlobal

View File

@ -126,7 +126,6 @@
Loading="Entries == null"
OnRow="OnRow"
SelectedRowsChanged="SelectedChanged"
RowSelectable="EntrySelectable"
Size="@TableSize.Small">
<Selection Key="@context.Path" Type="@(SelectMultiple ? "checkbox" : "radio")" Disabled="!EntrySelectable.Invoke(context)" Class="@(EntrySelectable.Invoke(context) ? "" : "file-manager-selector-hidden")" />
<Column TData="string" Width="32">

View File

@ -2,7 +2,7 @@
<Select Mode="tags" TItem="Guid" TItemValue="Guid" @bind-Values="@SelectedValues" OnSelectedItemsChanged="OnSelectedItemsChanged" EnableSearch>
<SelectOptions>
@foreach (var entity in Entities.OrderBy(OptionLabelSelector))
@foreach (var entity in Entities)
{
<SelectOption TItemValue="Guid" TItem="Guid" Value="@entity.Id" Label="@OptionLabelSelector.Invoke(entity)" />
}

View File

@ -41,7 +41,7 @@ namespace LANCommander.Controllers
var relativePath = path.Substring(httpPath.Path.TrimStart('/').Length).Replace('/', Path.DirectorySeparatorChar).TrimStart('\\');
var localPath = Path.Combine(httpPath.LocalPath, relativePath).TrimEnd('\\');
var localPath = Path.Combine(httpPath.LocalPath, relativePath).TrimEnd(Path.DirectorySeparatorChar);
var attrs = System.IO.File.GetAttributes(localPath);
if ((attrs & FileAttributes.Directory) == FileAttributes.Directory)

View File

@ -20,7 +20,6 @@ namespace LANCommander.Data
builder.ConfigureBaseRelationships<Data.Models.Action>();
builder.ConfigureBaseRelationships<Archive>();
builder.ConfigureBaseRelationships<Category>();
builder.ConfigureBaseRelationships<Collection>();
builder.ConfigureBaseRelationships<Company>();
builder.ConfigureBaseRelationships<Game>();
builder.ConfigureBaseRelationships<GameSave>();
@ -181,28 +180,6 @@ namespace LANCommander.Data
.IsRequired(false)
.OnDelete(DeleteBehavior.Cascade);
#endregion
#region Collection Relationships
builder.Entity<Collection>()
.HasMany(c => c.Games)
.WithMany(g => g.Collections)
.UsingEntity<Dictionary<string, object>>(
"CollectionGame",
cg => cg.HasOne<Game>().WithMany().HasForeignKey("GameId"),
cg => cg.HasOne<Collection>().WithMany().HasForeignKey("CollectionId")
);
#endregion
#region Role Relationships
builder.Entity<Role>()
.HasMany(r => r.Collections)
.WithMany(c => c.Roles)
.UsingEntity<Dictionary<string, object>>(
"RoleCollection",
rc => rc.HasOne<Collection>().WithMany().HasForeignKey("CollectionId"),
rc => rc.HasOne<Role>().WithMany().HasForeignKey("RoleId")
);
#endregion
}
public DbSet<Game>? Games { get; set; }

View File

@ -1,15 +0,0 @@
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
namespace LANCommander.Data.Models
{
[Table("Collections")]
public class Collection : BaseModel
{
public string Name { get; set; }
[JsonIgnore]
public virtual ICollection<Game> Games { get; set; }
[JsonIgnore]
public virtual ICollection<Role> Roles { get; set; }
}
}

View File

@ -39,6 +39,5 @@ namespace LANCommander.Data.Models
public string? ValidKeyRegex { get; set; }
public virtual ICollection<Key>? Keys { get; set; }
public virtual ICollection<Collection> Collections { get; set; }
}
}

View File

@ -6,6 +6,5 @@ namespace LANCommander.Data.Models
[Table("Roles")]
public class Role : IdentityRole<Guid>
{
public virtual ICollection<Collection> Collections { get; set; }
}
}

View File

@ -22,17 +22,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AntDesign" Version="0.16.1" />
<PackageReference Include="AntDesign.Charts" Version="0.3.2" />
<PackageReference Include="Blazor-ApexCharts" Version="1.0.1" />
<PackageReference Include="AntDesign" Version="0.16.3" />
<PackageReference Include="AntDesign.Charts" Version="0.4.0" />
<PackageReference Include="Blazor-ApexCharts" Version="2.1.0" />
<PackageReference Include="BlazorMonaco" Version="3.1.0" />
<PackageReference Include="ByteSize" Version="2.1.1" />
<PackageReference Include="CoreRCON" Version="5.0.5" />
<PackageReference Include="CoreRCON" Version="5.2.1" />
<PackageReference Include="craftersmine.SteamGridDB.Net" Version="1.1.5" />
<PackageReference Include="Hangfire.AspNetCore" Version="1.8.6" />
<PackageReference Include="Hangfire.Core" Version="1.8.6" />
<PackageReference Include="Hangfire.InMemory" Version="0.6.0" />
<PackageReference Include="IGDB" Version="2.3.2" />
<PackageReference Include="IGDB" Version="3.0.0" />
<PackageReference Include="IPXRelayDotNet" Version="1.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.0" />
@ -45,13 +45,13 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.2.2">
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.3.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
<PackageReference Include="NLog" Version="5.2.5" />
<PackageReference Include="NLog" Version="5.2.7" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.5" />
<PackageReference Include="RegParserDotNet" Version="1.0.4" />
<PackageReference Include="rix0rrr.BeaconLib" Version="1.0.2" />
@ -59,7 +59,7 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="System.Diagnostics.PerformanceCounter" Version="8.0.0" />
<PackageReference Include="XtermBlazor" Version="1.10.0" />
<PackageReference Include="YamlDotNet" Version="13.3.1" />
<PackageReference Include="YamlDotNet" Version="13.7.1" />
</ItemGroup>
<ItemGroup>

File diff suppressed because it is too large Load Diff

View File

@ -1,23 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
/// <inheritdoc />
public partial class FixScriptDisplayBounds : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql("UPDATE Scripts SET Contents = REPLACE(Contents, '$Display.Width', '$Display.Bounds.Width')");
migrationBuilder.Sql("UPDATE Scripts SET Contents = REPLACE(Contents, '$Display.Height', '$Display.Bounds.Height')");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,124 +0,0 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace LANCommander.Migrations
{
/// <inheritdoc />
public partial class AddCollections : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Collections",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", nullable: false),
CreatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
CreatedById = table.Column<Guid>(type: "TEXT", nullable: true),
UpdatedOn = table.Column<DateTime>(type: "TEXT", nullable: false),
UpdatedById = table.Column<Guid>(type: "TEXT", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Collections", x => x.Id);
table.ForeignKey(
name: "FK_Collections_AspNetUsers_CreatedById",
column: x => x.CreatedById,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_Collections_AspNetUsers_UpdatedById",
column: x => x.UpdatedById,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
});
migrationBuilder.CreateTable(
name: "CollectionGame",
columns: table => new
{
CollectionId = table.Column<Guid>(type: "TEXT", nullable: false),
GameId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CollectionGame", x => new { x.CollectionId, x.GameId });
table.ForeignKey(
name: "FK_CollectionGame_Collections_CollectionId",
column: x => x.CollectionId,
principalTable: "Collections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_CollectionGame_Games_GameId",
column: x => x.GameId,
principalTable: "Games",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "RoleCollection",
columns: table => new
{
CollectionId = table.Column<Guid>(type: "TEXT", nullable: false),
RoleId = table.Column<Guid>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_RoleCollection", x => new { x.CollectionId, x.RoleId });
table.ForeignKey(
name: "FK_RoleCollection_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_RoleCollection_Collections_CollectionId",
column: x => x.CollectionId,
principalTable: "Collections",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_CollectionGame_GameId",
table: "CollectionGame",
column: "GameId");
migrationBuilder.CreateIndex(
name: "IX_Collections_CreatedById",
table: "Collections",
column: "CreatedById");
migrationBuilder.CreateIndex(
name: "IX_Collections_UpdatedById",
table: "Collections",
column: "UpdatedById");
migrationBuilder.CreateIndex(
name: "IX_RoleCollection_RoleId",
table: "RoleCollection",
column: "RoleId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "CollectionGame");
migrationBuilder.DropTable(
name: "RoleCollection");
migrationBuilder.DropTable(
name: "Collections");
}
}
}

View File

@ -36,21 +36,6 @@ namespace LANCommander.Migrations
b.ToTable("CategoryGame");
});
modelBuilder.Entity("CollectionGame", b =>
{
b.Property<Guid>("CollectionId")
.HasColumnType("TEXT");
b.Property<Guid>("GameId")
.HasColumnType("TEXT");
b.HasKey("CollectionId", "GameId");
b.HasIndex("GameId");
b.ToTable("CollectionGame");
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.Property<Guid>("DeveloperId")
@ -272,37 +257,6 @@ namespace LANCommander.Migrations
b.ToTable("Categories");
});
modelBuilder.Entity("LANCommander.Data.Models.Collection", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid?>("CreatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedOn")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("TEXT");
b.Property<Guid?>("UpdatedById")
.HasColumnType("TEXT");
b.Property<DateTime>("UpdatedOn")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("CreatedById");
b.HasIndex("UpdatedById");
b.ToTable("Collections");
});
modelBuilder.Entity("LANCommander.Data.Models.Company", b =>
{
b.Property<Guid>("Id")
@ -1203,21 +1157,6 @@ namespace LANCommander.Migrations
b.ToTable("AspNetUserTokens", (string)null);
});
modelBuilder.Entity("RoleCollection", b =>
{
b.Property<Guid>("CollectionId")
.HasColumnType("TEXT");
b.Property<Guid>("RoleId")
.HasColumnType("TEXT");
b.HasKey("CollectionId", "RoleId");
b.HasIndex("RoleId");
b.ToTable("RoleCollection");
});
modelBuilder.Entity("CategoryGame", b =>
{
b.HasOne("LANCommander.Data.Models.Category", null)
@ -1233,21 +1172,6 @@ namespace LANCommander.Migrations
.IsRequired();
});
modelBuilder.Entity("CollectionGame", b =>
{
b.HasOne("LANCommander.Data.Models.Collection", null)
.WithMany()
.HasForeignKey("CollectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Game", null)
.WithMany()
.HasForeignKey("GameId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("GameDeveloper", b =>
{
b.HasOne("LANCommander.Data.Models.Company", null)
@ -1408,23 +1332,6 @@ namespace LANCommander.Migrations
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Collection", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
.WithMany()
.HasForeignKey("CreatedById")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("LANCommander.Data.Models.User", "UpdatedBy")
.WithMany()
.HasForeignKey("UpdatedById")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("CreatedBy");
b.Navigation("UpdatedBy");
});
modelBuilder.Entity("LANCommander.Data.Models.Company", b =>
{
b.HasOne("LANCommander.Data.Models.User", "CreatedBy")
@ -1843,21 +1750,6 @@ namespace LANCommander.Migrations
.IsRequired();
});
modelBuilder.Entity("RoleCollection", b =>
{
b.HasOne("LANCommander.Data.Models.Collection", null)
.WithMany()
.HasForeignKey("CollectionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("LANCommander.Data.Models.Role", null)
.WithMany()
.HasForeignKey("RoleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("LANCommander.Data.Models.Category", b =>
{
b.Navigation("Children");

View File

@ -1,7 +0,0 @@
namespace LANCommander.Models
{
public class AddToCollectionOptions
{
public IEnumerable<Guid> GameIds { get; set; }
}
}

View File

@ -1,10 +0,0 @@
namespace LANCommander.Models
{
public class RoleViewModel
{
public string Name { get; set; }
public int Users { get; set; }
public int Collections { get; set; }
}
}

View File

@ -1,145 +0,0 @@
@page "/Collections/{id:guid}"
@page "/Collections/Add"
@using LANCommander.Data.Enums;
@using LANCommander.Extensions
@attribute [Authorize(Roles = "Administrator")]
@inject CollectionService CollectionService
@inject IMessageService MessageService
@inject NavigationManager NavigationManager
<PageHeader>
<PageHeaderTitle>
<Input Size="@InputSize.Large" @bind-Value="@Collection.Name" />
</PageHeaderTitle>
<PageHeaderExtra>
<Button Type="@ButtonType.Primary" OnClick="Save">Save</Button>
</PageHeaderExtra>
</PageHeader>
<Table TItem="Game" DataSource="@Collection.Games" Responsive>
<Column TData="string" Title="Icon">
<Image Src="@GetIcon(context)" Height="32" Width="32" Preview="false"></Image>
</Column>
<PropertyColumn Property="g => g.Title" Sortable Filterable />
<PropertyColumn Property="g => g.ReleasedOn" Format="MM/dd/yyyy" Sortable Filterable />
<PropertyColumn Property="g => g.Singleplayer" Sortable Filterable>
<Checkbox Disabled="true" Checked="context.Singleplayer" />
</PropertyColumn>
<Column TData="bool" Title="Multiplayer">
<Checkbox Disabled="true" Checked="context.MultiplayerModes?.Count > 0" />
</Column>
<Column TData="string[]" Title="Developers">
@foreach (var dev in context.Developers)
{
<Tag>@dev.Name</Tag>
}
</Column>
<Column TData="string[]" Title="Publishers">
@foreach (var pub in context.Publishers)
{
<Tag>@pub.Name</Tag>
}
</Column>
<Column TData="string[]" Title="Genres">
@foreach (var genre in context.Genres)
{
<Tag>@genre.Name</Tag>
}
</Column>
<Column TData="Data.Enums.MultiplayerType[]" Title="Multiplayer Modes">
@foreach (var mode in context.MultiplayerModes.Select(mm => mm.Type).Distinct())
{
<Tag>@mode.GetDisplayName()</Tag>
}
</Column>
<ActionColumn Title="" Style="text-align: right">
<ChildContent>
<Space Direction="DirectionVHType.Horizontal">
<SpaceItem>
<Popconfirm OnConfirm="() => RemoveGame(context)" Title="Are you sure you want to remove this game from the collection?">
<Button Icon="@IconType.Outline.Close" Type="@ButtonType.Text" Danger />
</Popconfirm>
</SpaceItem>
</Space>
</ChildContent>
</ActionColumn>
</Table>
@code {
[Parameter] public Guid Id { get; set; }
Collection Collection;
protected override async Task OnInitializedAsync()
{
if (Id == Guid.Empty)
Collection = new Collection();
else
Collection = await CollectionService.Get(Id);
}
private async Task Save()
{
try
{
if (Collection.Id != Guid.Empty)
{
Collection = await CollectionService.Update(Collection);
await MessageService.Success("Collection updated!");
}
else
{
Collection = await CollectionService.Add(Collection);
NavigationManager.LocationChanged += NotifyCollectionAdded;
NavigationManager.NavigateTo($"/Collections/{Collection.Id}");
}
}
catch (Exception ex)
{
await MessageService.Error("Could not save!");
}
}
private void NotifyCollectionAdded(object? sender, LocationChangedEventArgs e)
{
NavigationManager.LocationChanged -= NotifyCollectionAdded;
MessageService.Success("Collection added!");
}
private async Task RemoveGame(Game game)
{
try
{
Collection.Games.Remove(game);
await CollectionService.Update(Collection);
}
catch (Exception ex)
{
MessageService.Error("Game could not be removed from the collection!");
}
}
private string GetIcon(Game game)
{
var media = game?.Media?.FirstOrDefault(m => m.Type == Data.Enums.MediaType.Icon);
if (media != null)
return $"/api/Media/{media.Id}/Download?fileId={media.FileId}";
else
return "/favicon.ico";
}
}

View File

@ -1,110 +0,0 @@
@page "/Collections"
@using Microsoft.EntityFrameworkCore;
@attribute [Authorize(Roles = "Administrator")]
@inject CollectionService CollectionService
@inject NavigationManager NavigationManager
@inject IMessageService MessageService
<PageHeader Title="Collections">
<PageHeaderExtra>
<Space Direction="DirectionVHType.Horizontal">
<SpaceItem>
<Search Placeholder="Search" @bind-Value="Search" BindOnInput DebounceMilliseconds="150" OnChange="() => LoadData()" />
</SpaceItem>
</Space>
</PageHeaderExtra>
</PageHeader>
<TableColumnPicker @ref="Picker" Key="Collections" @bind-Visible="ColumnPickerVisible" />
<Table TItem="Collection" DataSource="@Collections" Loading="@Loading" PageSize="25" Responsive>
<PropertyColumn Property="r => r.Name" Sortable Hidden="@(Picker.IsColumnHidden("Name"))" />
<PropertyColumn Property="s => s.CreatedOn" Format="MM/dd/yyyy hh:mm tt" Sortable Hidden="@(Picker.IsColumnHidden("Created On"))" />
<PropertyColumn Property="s => s.CreatedBy" Sortable Hidden="@(Picker.IsColumnHidden("Created By"))">
@context.CreatedBy?.UserName
</PropertyColumn>
<PropertyColumn Property="g => g.UpdatedOn" Format="MM/dd/yyyy hh:mm tt" Sortable Hidden="@(Picker.IsColumnHidden("Updated On"))" />
<PropertyColumn Property="g => g.UpdatedBy" Sortable Hidden="@(Picker.IsColumnHidden("Updated By"))">
@context.UpdatedBy?.UserName
</PropertyColumn>
<Column Title="Games" TData="int">
@context.Games.Count
</Column>
<ActionColumn Title="" Style="text-align: right; white-space: nowrap">
<TitleTemplate>
<div style="text-align: right">
<Button Icon="@IconType.Outline.Edit" Type="@ButtonType.Text" OnClick="() => OpenColumnPicker()" />
</div>
</TitleTemplate>
<ChildContent>
<Space Direction="DirectionVHType.Horizontal">
<SpaceItem>
<a href="/Collections/@(context.Id)" class="ant-btn ant-btn-primary">Edit</a>
</SpaceItem>
<SpaceItem>
<Popconfirm OnConfirm="() => Delete(context)" Title="Are you sure you want to delete this Collection?">
<Button Icon="@IconType.Outline.Close" Type="@ButtonType.Text" Danger />
</Popconfirm>
</SpaceItem>
</Space>
</ChildContent>
</ActionColumn>
</Table>
@code {
IEnumerable<Collection> Collections { get; set; } = new List<Collection>();
bool Loading = true;
string Search = "";
TableColumnPicker Picker;
bool ColumnPickerVisible = false;
protected override void OnAfterRender(bool firstRender)
{
if (firstRender)
{
LoadData();
Loading = false;
StateHasChanged();
}
}
private async Task LoadData()
{
var fuzzySearch = Search.ToLower().Trim();
Collections = await CollectionService.Get(r => r.Name.ToLower().Contains(fuzzySearch)).OrderBy(r => r.Name).ToListAsync();
}
private void Add()
{
NavigationManager.NavigateTo("/Collections/Add");
}
private async Task Delete(Collection Collection)
{
Collections = new List<Collection>();
Loading = true;
await CollectionService.Delete(Collection);
Collections = await CollectionService.Get(x => true).OrderBy(r => r.Name).ToListAsync();
Loading = false;
}
private async Task OpenColumnPicker()
{
ColumnPickerVisible = true;
}
private async Task CloseColumnPicker()
{
ColumnPickerVisible = false;
}
}

View File

@ -1,65 +0,0 @@
@using AntDesign.Charts
@using ByteSizeLib
@inject PlaySessionService PlaySessionService
<Spin Spinning="Loading">
<Pie Data="Data" Config="Config" JsConfig="@JsConfig" />
</Spin>
@code {
object[] Data;
bool Loading = true;
string JsConfig = @"{
meta: {
value: {
alias: 'Overall Playtime',
formatter: (v) => new Date(v * 1000).toISOString().slice(11, 19)
}
},
label: {
visible: true,
type: 'outer-center'
}
}";
PieConfig Config = new PieConfig
{
Radius = 0.8,
AngleField = "value",
ColorField = "type",
};
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
Dictionary<string, TimeSpan> playtimes = new Dictionary<string, TimeSpan>();
var sessions = await PlaySessionService.Get();
foreach (var gameSessions in sessions.Where(s => s.GameId.HasValue && s.GameId.Value != Guid.Empty).GroupBy(s => s.GameId))
{
var total = new TimeSpan();
foreach (var session in gameSessions.Where(gs => gs.Start != null && gs.End != null))
{
total = total.Add(session.End.Value.Subtract(session.Start.Value));
}
playtimes[gameSessions.First().Game.Title] = total;
}
Data = playtimes.Select(pt => new
{
type = pt.Key,
value = (int)pt.Value.TotalSeconds
}).ToArray();
Loading = false;
StateHasChanged();
}
}
}

View File

@ -6,14 +6,6 @@
<PageHeader Title="Dashboard" Style="margin-bottom: 24px" />
<GridRow Gutter="(16, 16)">
<GridCol Xs="24" Md="12">
<Card Title="Overall Playtime">
<Body>
<OverallPlaytime />
</Body>
</Card>
</GridCol>
<GridCol Xs="24" Md="12">
<Card Title="Storage Usage">
<Body>

View File

@ -1,9 +1,10 @@
@page "/Files"
@using LANCommander.Components.FileManagerComponents
@inject IHostEnvironment Env
@attribute [Authorize(Roles = "Administrator")]
<FileManager WorkingDirectory="@RootPath" />
@code {
string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory());
string RootPath => Env.ContentRootPath;
}

View File

@ -12,7 +12,7 @@
<Input Type="text" @bind-Value="context.Name" />
</PropertyColumn>
<PropertyColumn Property="a => a.Path">
<FilePicker @bind-Value="context.Path" ArchiveId="@ArchiveId" AllowDirectories="true" Prefix="{InstallDir}\" Title="Select Action Executable" />
<FilePicker @bind-Value="context.Path" ArchiveId="@ArchiveId" AllowDirectories="true" />
</PropertyColumn>
<PropertyColumn Property="a => a.Arguments">
<Input Type="text" @bind-Value="context.Arguments" />
@ -90,6 +90,43 @@
Move(action.SortOrder, action.SortOrder + 1);
}
private async void BrowseForActionPath(Data.Models.Action action)
{
var modalOptions = new ModalOptions()
{
Title = "Choose Action Executable",
Maximizable = false,
DefaultMaximized = true,
Closable = true,
OkText = "Select File"
};
var browserOptions = new FilePickerOptions()
{
ArchiveId = ArchiveId,
Select = true,
Multiple = false
};
var modalRef = await ModalService.CreateModalAsync<FilePickerDialog, FilePickerOptions, IEnumerable<IFileManagerEntry>>(modalOptions, browserOptions);
modalRef.OnOk = (results) =>
{
action.Path = results.FirstOrDefault().Path;
var parts = action.Path.Split('/');
if (parts.Length > 1)
{
action.Path = parts.Last();
action.WorkingDirectory = "{InstallDir}/" + String.Join('/', parts.Take(parts.Length - 1));
}
StateHasChanged();
return Task.CompletedTask;
};
}
private void Move(int oldIndex, int newIndex)
{
foreach (var action in Actions)

View File

@ -1,107 +0,0 @@
@using LANCommander.Models
@inherits FeedbackComponent<AddToCollectionOptions, Collection>
@inject CollectionService CollectionService
@inject GameService GameService
@inject IMessageService MessageService
<Select
TItem="Collection"
TItemValue="Guid"
DataSource="@Collections"
@bind-Value="SelectedCollection"
LabelName="@nameof(Collection.Name)"
ValueName="@nameof(Collection.Id)"
Placeholder="Select a Collection"
DropdownRender="@DropdownRender"
OnSelectedItemChanged="OnSelectedItemChanged" />
@code {
ICollection<Collection> Collections = new List<Collection>();
Guid SelectedCollection;
string NewCollectionName;
protected override async Task OnInitializedAsync()
{
await LoadData();
}
private async Task LoadData()
{
Collections = (await CollectionService.Get()).OrderBy(c => c.Name).ToList();
}
private RenderFragment DropdownRender(RenderFragment originNode)
{
RenderFragment customDropdownRender =
@<Template>
<div>
@originNode
<Divider Style="margin: 4px 0"></Divider>
<div style="display: flex; flex-wrap: nowrap; padding: 8px">
<Input Style="flex: auto" @bind-Value="@NewCollectionName" />
<a style="flex: none; padding: 8px; display: block; cursor: pointer" @onclick="AddCollection">
<Icon Type="plus" Theme="outline"></Icon>
Add New Collection
</a>
</div>
</div>
</Template>
;
return customDropdownRender;
}
private async Task AddCollection(MouseEventArgs args)
{
try
{
if (!String.IsNullOrWhiteSpace(NewCollectionName))
{
await CollectionService.Add(new Collection()
{
Name = NewCollectionName
});
await LoadData();
MessageService.Success("Collection added!");
}
}
catch (Exception ex)
{
MessageService.Error("Could not add a new collection!");
}
}
private void OnSelectedItemChanged(Collection collection)
{
SelectedCollection = collection.Id;
}
public override async Task OnFeedbackOkAsync(ModalClosingEventArgs args)
{
var collection = await CollectionService.Get(SelectedCollection);
try
{
foreach (var gameId in Options.GameIds.Where(gid => collection.Games != null && !collection.Games.Any(g => g.Id == gid)))
{
var game = await GameService.Get(gameId);
collection.Games.Add(game);
}
await CollectionService.Update(collection);
MessageService.Success("Added to collection!");
}
catch (Exception ex)
{
MessageService.Error("Could not add to collection!");
}
await base.OkCancelRefWithResult!.OnOk(collection);
}
}

View File

@ -2,26 +2,18 @@
@using AntDesign.TableModels;
@using LANCommander.Extensions;
@using System.ComponentModel.DataAnnotations;
@using LANCommander.Models
@using LANCommander.Pages.Games.Components
@using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
@using Microsoft.EntityFrameworkCore;
@using System.Web
@attribute [Authorize]
@inject GameService GameService
@inject NavigationManager NavigationManager
@inject ModalService ModalService
@inject IMessageService MessageService
<PageHeader Title="Games" Subtitle="@Games.Count().ToString()">
<PageHeaderExtra>
<Space Direction="DirectionVHType.Horizontal">
@if (Selected != null && Selected.Count() > 0)
{
<SpaceItem>
<Button OnClick="() => AddToCollection()" Type="@ButtonType.Primary">Add to Collection</Button>
</SpaceItem>
}
<SpaceItem>
<Search Placeholder="Search" @bind-Value="Search" BindOnInput DebounceMilliseconds="250" OnChange="SearchChanged" />
</SpaceItem>
@ -34,8 +26,7 @@
<TableColumnPicker @ref="Picker" Key="Games" @bind-Visible="ColumnPickerVisible" />
<Table TItem="Game" DataSource="@Games" @bind-SelectedRows="Selected" Loading="@Loading" PageSize="@PageSize" PageIndex="@PageIndex" OnPageIndexChange="PageIndexChanged" OnPageSizeChange="PageSizeChanged" Responsive>
<Selection Key="@(context.Id.ToString())" />
<Table TItem="Game" DataSource="@Games" Loading="@Loading" PageSize="@PageSize" PageIndex="@PageIndex" OnPageIndexChange="PageIndexChanged" OnPageSizeChange="PageSizeChanged" Responsive>
<Column TData="string" Title="Icon" Hidden="@(Picker.IsColumnHidden("Icon"))">
<Image Src="@GetIcon(context)" Height="32" Width="32" Preview="false"></Image>
</Column>
@ -136,8 +127,6 @@
bool Visibility = false;
IEnumerable<Game> Selected;
TableColumnPicker Picker;
bool ColumnPickerVisible = false;
@ -242,31 +231,6 @@
Loading = false;
}
private async void AddToCollection()
{
var modalOptions = new ModalOptions()
{
Title = "Add to Collection",
Maximizable = false,
DefaultMaximized = false,
Closable = true,
OkText = "Add"
};
var options = new AddToCollectionOptions()
{
GameIds = Selected.Select(g => g.Id)
};
var modalRef = await ModalService.CreateModalAsync<AddToCollectionDialog, AddToCollectionOptions, Collection>(modalOptions, options);
modalRef.OnOk = async (collection) =>
{
Selected = null;
await LoadData();
};
}
private async Task OpenColumnPicker()
{
ColumnPickerVisible = true;

View File

@ -10,6 +10,7 @@
@inject ServerProcessService ServerProcessService
@inject IMessageService MessageService
@inject NavigationManager NavigationManager
@inject IHostEnvironment Env
<Layout Class="panel-layout" Style="padding: 24px 0;">
<Sider Width="200">
@ -164,7 +165,7 @@
IEnumerable<Game> Games = new List<Game>();
string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory());
string RootPath => Env.ContentRootPath;
Server Server;
Guid GameId;

View File

@ -4,6 +4,7 @@
@layout SettingsLayout
@inject SettingService SettingService
@inject IMessageService MessageService
@inject IHostEnvironment Env
@attribute [Authorize(Roles = "Administrator")]
<PageHeader Title="Archives" />
@ -27,7 +28,7 @@
@code {
LANCommanderSettings Settings;
string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory());
string RootPath => Env.ContentRootPath;
protected override async Task OnInitializedAsync()
{

View File

@ -4,6 +4,7 @@
@layout SettingsLayout
@inject SettingService SettingService
@inject IMessageService MessageService
@inject IHostEnvironment Env
@attribute [Authorize(Roles = "Administrator")]
<PageHeader Title="Media" />
@ -35,7 +36,7 @@
@code {
LANCommanderSettings Settings;
string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory());
string RootPath => Env.ContentRootPath;
protected override async Task OnInitializedAsync()
{

View File

@ -1,144 +0,0 @@
@page "/Settings/Roles"
@using LANCommander.Models;
@layout SettingsLayout
@inject RoleManager<Role> RoleManager
@inject UserManager<User> UserManager
@inject IMessageService MessageService
@inject NavigationManager NavigationManager
@attribute [Authorize(Roles = "Administrator")]
<PageHeader Title="Roles" Subtitle="@Roles.Count().ToString()">
<PageHeaderExtra>
<Space Direction="DirectionVHType.Horizontal">
<SpaceItem>
<Button OnClick="() => ShowNewRoleDialog()" Type="@ButtonType.Primary">Add Role</Button>
</SpaceItem>
</Space>
</PageHeaderExtra>
</PageHeader>
<div style="padding: 0 24px;">
<Table TItem="RoleViewModel" DataSource="@Roles" Loading="@(Loading)" Responsive>
<PropertyColumn Property="r => r.Name" Title="Name" />
<PropertyColumn Property="r => r.Collections" Title="Collections" />
<PropertyColumn Property="r => r.Users" Title="Users" />
<ActionColumn>
<Space Style="display: flex; justify-content: end">
<SpaceItem>
@if (context.Name != "Administrator")
{
<Popconfirm OnConfirm="() => DeleteRole(context)" Title="Are you sure you want to delete this role?">
<Button Icon="@IconType.Outline.Close" Type="@ButtonType.Text" Danger />
</Popconfirm>
}
else
{
<Tooltip Title="The administrator role cannot be deleted.">
<Button Icon="@IconType.Outline.Close" Type="@ButtonType.Text" Disabled />
</Tooltip>
}
</SpaceItem>
</Space>
</ActionColumn>
</Table>
</div>
<Modal Title="Add a Role" @bind-Visible="AddRoleDialogVisible" OnOk="AddRole" OnCancel="() => AddRoleDialogVisible = false">
<Form Model="NewRole">
<FormItem Label="Name">
<Input @bind-Value="@context.Name" />
</FormItem>
</Form>
</Modal>
@code {
ICollection<RoleViewModel> Roles { get; set; }
LANCommanderSettings Settings = SettingService.GetSettings();
bool Loading = true;
bool AddRoleDialogVisible = false;
RoleViewModel NewRole = new RoleViewModel();
protected override async Task OnInitializedAsync()
{
Roles = new List<RoleViewModel>();
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
await LoadData();
}
private async Task LoadData()
{
Roles = new List<RoleViewModel>();
foreach (var role in RoleManager.Roles)
{
var users = await UserManager.GetUsersInRoleAsync(role.Name);
Roles.Add(new RoleViewModel()
{
Name = role.Name,
Collections = role.Collections != null ? role.Collections.Count : 0,
Users = users != null ? users.Count : 0
});
}
Loading = false;
StateHasChanged();
}
private async Task DeleteRole(RoleViewModel roleViewModel)
{
var role = await RoleManager.FindByNameAsync(roleViewModel.Name);
if (role.Name == "Administrator")
{
await MessageService.Error("Cannot delete the administrator role!");
}
else
{
await RoleManager.DeleteAsync(role);
await LoadData();
await MessageService.Success($"Deleted {role.Name}!");
}
}
private void ShowNewRoleDialog()
{
NewRole = new RoleViewModel();
AddRoleDialogVisible = true;
}
private async Task AddRole()
{
if (await RoleManager.RoleExistsAsync(NewRole.Name))
{
MessageService.Error("A role with that name already exists!");
AddRoleDialogVisible = false;
return;
}
try
{
await RoleManager.CreateAsync(new Role()
{
Name = NewRole.Name
});
await LoadData();
MessageService.Success("Role added!");
}
catch (Exception ex)
{
MessageService.Error("Could not added role!");
}
}
}

View File

@ -7,7 +7,6 @@
<Menu Mode=@MenuMode.Inline Style="height: 100%">
<MenuItem RouterLink="/Settings/General">General</MenuItem>
<MenuItem RouterLink="/Settings/Users">Users</MenuItem>
<MenuItem RouterLink="/Settings/Roles">Roles</MenuItem>
<MenuItem RouterLink="/Settings/Authentication">Authentication</MenuItem>
<MenuItem RouterLink="/Settings/UserSaves">User Saves</MenuItem>
<MenuItem RouterLink="/Settings/Archives">Archives</MenuItem>

View File

@ -4,6 +4,7 @@
@layout SettingsLayout
@inject SettingService SettingService
@inject IMessageService MessageService
@inject IHostEnvironment Env
@attribute [Authorize(Roles = "Administrator")]
<PageHeader Title="User Saves" />
@ -27,7 +28,7 @@
@code {
LANCommanderSettings Settings;
string RootPath = Path.GetPathRoot(Directory.GetCurrentDirectory());
string RootPath => Env.ContentRootPath;
protected override async Task OnInitializedAsync()
{

View File

@ -40,7 +40,7 @@
<SpaceItem>
<Tooltip Title="Change Password">
<Button Icon="@IconType.Outline.Lock" Type="@ButtonType.Text" OnClick="() => ChangePassword(context)" />
<Button Icon="@IconType.Outline.Key" Type="@ButtonType.Text" OnClick="() => ChangePassword(context)" />
</Tooltip>
</SpaceItem>

View File

@ -133,7 +133,6 @@ namespace LANCommander
builder.Services.AddScoped<SettingService>();
builder.Services.AddScoped<ArchiveService>();
builder.Services.AddScoped<CategoryService>();
builder.Services.AddScoped<CollectionService>();
builder.Services.AddScoped<GameService>();
builder.Services.AddScoped<ScriptService>();
builder.Services.AddScoped<GenreService>();

View File

@ -1,12 +0,0 @@
using LANCommander.Data;
using LANCommander.Data.Models;
namespace LANCommander.Services
{
public class CollectionService : BaseDatabaseService<Collection>
{
public CollectionService(DatabaseContext dbContext, IHttpContextAccessor httpContextAccessor) : base(dbContext, httpContextAccessor)
{
}
}
}

View File

@ -17,7 +17,7 @@ namespace LANCommander.Services
return files.Select(f =>
{
var split = f.Split('\\');
var split = f.Split(Path.DirectorySeparatorChar);
return new Snippet()
{

View File

@ -9,7 +9,6 @@
@if (User != null && User.IsInRole("Administrator"))
{
<MenuItem RouterLink="/Games">Games</MenuItem>
<MenuItem RouterLink="/Collections">Collections</MenuItem>
<MenuItem RouterLink="/Redistributables">Redistributables</MenuItem>
<MenuItem RouterLink="/Servers">Servers</MenuItem>
<MenuItem RouterLink="/Files">Files</MenuItem>