Added base structure
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Moonlight.Client.App.Interfaces;
|
||||
using Moonlight.Client.App.Models;
|
||||
|
||||
namespace MoonlightServers.Client.Implementations;
|
||||
|
||||
public class ServersSidebarProvider : ISidebarItemProvider
|
||||
{
|
||||
public SidebarItem[] GetItems()
|
||||
{
|
||||
return [new ()
|
||||
{
|
||||
Name = "Servers",
|
||||
Target = "/servers",
|
||||
Icon = "bi bi-hdd-rack",
|
||||
Priority = 5
|
||||
},
|
||||
new()
|
||||
{
|
||||
Name = "Servers",
|
||||
Target = "/admin/servers",
|
||||
Priority = 5,
|
||||
Icon = "bi bi-hdd-rack",
|
||||
Group = "Admin",
|
||||
Permission = "admin.servers.get"
|
||||
}];
|
||||
}
|
||||
}
|
||||
42
MoonlightServers.Client/MoonlightServers.Client.csproj
Normal file
42
MoonlightServers.Client/MoonlightServers.Client.csproj
Normal file
@@ -0,0 +1,42 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Moonlight Dependencies">
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0"/>
|
||||
<PackageReference Include="MoonCore" Version="1.5.3" />
|
||||
<PackageReference Include="MoonCore.Blazor" Version="1.2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Shared references">
|
||||
<ProjectReference Include="..\MoonlightServers.Shared\MoonlightServers.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Label="Reference moonlight builds">
|
||||
<Reference Include="Moonlight.Client">
|
||||
<HintPath>..\..\Moonlight\Moonlight\Client\bin\Debug\net8.0\Moonlight.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moonlight.Shared">
|
||||
<HintPath>..\..\Moonlight\Moonlight\Shared\bin\Debug\net8.0\Moonlight.Shared.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Helpers\" />
|
||||
<Folder Include="Models\" />
|
||||
<Folder Include="Services\" />
|
||||
<Folder Include="UI\Components\" />
|
||||
<Folder Include="UI\Views\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
31
MoonlightServers.Client/MoonlightServersClientPlugin.cs
Normal file
31
MoonlightServers.Client/MoonlightServersClientPlugin.cs
Normal file
@@ -0,0 +1,31 @@
|
||||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Moonlight.Client.App.Interfaces;
|
||||
using Moonlight.Client.App.PluginApi;
|
||||
using MoonlightServers.Client.Implementations;
|
||||
|
||||
namespace MoonlightServers.Client;
|
||||
|
||||
public class MoonlightServersClientPlugin : MoonlightClientPlugin
|
||||
{
|
||||
public MoonlightServersClientPlugin(ILogger logger, PluginService pluginService) : base(logger, pluginService)
|
||||
{
|
||||
}
|
||||
|
||||
public override Task OnLoaded()
|
||||
{
|
||||
PluginService.RegisterImplementation<ISidebarItemProvider, ServersSidebarProvider>();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnAppBuilding(WebAssemblyHostBuilder builder)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnAppConfiguring(WebAssemblyHost app)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
15
MoonlightServers.Client/_Imports.razor
Normal file
15
MoonlightServers.Client/_Imports.razor
Normal file
@@ -0,0 +1,15 @@
|
||||
@using System.Net.Http
|
||||
@using System.Net.Http.Json
|
||||
@using Microsoft.AspNetCore.Components.Routing
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using Microsoft.AspNetCore.Components.WebAssembly.Http
|
||||
@using Microsoft.JSInterop
|
||||
|
||||
@using MoonCore.Services
|
||||
@using MoonCore.Helpers
|
||||
|
||||
@using Moonlight.Client
|
||||
@using Moonlight.Client.App.UI
|
||||
@using Moonlight.Client.App.UI.Components
|
||||
@using Moonlight.Client.App.UI.Layouts
|
||||
@using Moonlight.Client.App.Attributes
|
||||
Reference in New Issue
Block a user