Add blazor & MVC Support (#602)

* Add initial code for Razor pages support

* Remove finalizer

* Try fully loading blazor

This is most likely entirely broken because of a rebase now

* UseSptBlazor after app.Use

* Fix up StaticWebAsset loading, add MudBlazor

* Implement page

* Update comment

* Replaced existing status page with razor

* Track background video in LFS

* Update attributes

* Improved status page theming

* Fix up wwwroot publish folder to SPT_Data/wwwroot

* Added name to page

* Remove unnecessary code

* Begin fixing up MVC & Blazor for modding

* Update TestMod

* Cleanup todo

* Further work out mod support

* Re-order initialization and use logger

* Rename library to SPTarkov.Server.Web

---------

Co-authored-by: Chomp <dev@dev.sp-tarkov.com>
Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
This commit is contained in:
Jesse
2025-10-02 21:03:27 +02:00
committed by GitHub
parent cf29c7bde3
commit 687b4f7a49
23 changed files with 820 additions and 73 deletions
+15 -7
View File
@@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\Build.props" />
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>TestMod2</AssemblyName>
<AssemblyName>TestMod</AssemblyName>
<OutputType>Library</OutputType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Libraries\SPTarkov.Common\SPTarkov.Common.csproj" />
@@ -10,20 +11,27 @@
<ProjectReference Include="..\..\Libraries\SPTarkov.Reflection\SPTarkov.Reflection.csproj" />
<ProjectReference Include="..\..\Libraries\SPTarkov.Server.Assets\SPTarkov.Server.Assets.csproj" />
<ProjectReference Include="..\..\Libraries\SPTarkov.Server.Core\SPTarkov.Server.Core.csproj" />
<ProjectReference Include="..\..\Libraries\SPTarkov.Server.Web\SPTarkov.Server.Web.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="wwwroot\" />
</ItemGroup>
<Target Name="CopyToServer" AfterTargets="PostBuildEvent">
<ItemGroup>
<OutputDLL Include="$(ProjectDir)$(OutDir)$(TargetName).dll" />
<Resources Include="$(ProjectDir)Resources\**\*.*" />
<WebAssets Include="$(ProjectDir)wwwroot\**\*.*" />
</ItemGroup>
<!-- Copies the output dll -->
<Copy
SourceFiles="@(OutputDLL);"
DestinationFolder="$(SolutionDir)\SPTarkov.Server\bin\$(Configuration)\net9.0\user\mods\$(TargetName)"
/>
<Copy SourceFiles="@(OutputDLL);" DestinationFolder="$(SolutionDir)\SPTarkov.Server\bin\$(Configuration)\net9.0\user\mods\TestMod" />
<Copy
SourceFiles="@(Resources);"
DestinationFolder="$(SolutionDir)\SPTarkov.Server\bin\$(Configuration)\net9.0\user\mods\$(TargetName)\Resources\%(RecursiveDir)"
DestinationFolder="$(SolutionDir)\SPTarkov.Server\bin\$(Configuration)\net9.0\user\mods\TestMod\Resources\%(RecursiveDir)"
/>
<!-- Copy the wwwroot folder -->
<Copy
SourceFiles="@(WebAssets)"
DestinationFolder="$(SolutionDir)\SPTarkov.Server\bin\$(Configuration)\net9.0\user\mods\TestMod\wwwroot\%(RecursiveDir)"
/>
</Target>
</Project>