Added theme saving. Added interfaces for overview pages. Renamed sidebar interface function
This commit is contained in:
@@ -8,6 +8,7 @@ public class CoreStartup : IPluginStartup
|
||||
public Task BuildApplication(WebAssemblyHostBuilder builder)
|
||||
{
|
||||
builder.Services.AddSingleton<ISidebarItemProvider, DefaultSidebarItemProvider>();
|
||||
builder.Services.AddSingleton<IOverviewElementProvider, DefaultOverviewElementProvider>();
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
using Moonlight.Client.Interfaces;
|
||||
|
||||
namespace Moonlight.Client.Implementations;
|
||||
|
||||
public class DefaultAdminOverviewElementProvider : IAdminOverviewElementProvider
|
||||
{
|
||||
public void ModifyOverview(List<Type> overviewComponents)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using Moonlight.Client.Interfaces;
|
||||
using Moonlight.Client.UI.Components;
|
||||
|
||||
namespace Moonlight.Client.Implementations;
|
||||
|
||||
public class DefaultOverviewElementProvider : IOverviewElementProvider
|
||||
{
|
||||
public void ModifyOverview(List<Type> overviewComponents)
|
||||
{
|
||||
overviewComponents.Add(typeof(WelcomeOverviewElement));
|
||||
}
|
||||
}
|
||||
@@ -5,61 +5,62 @@ namespace Moonlight.Client.Implementations;
|
||||
|
||||
public class DefaultSidebarItemProvider : ISidebarItemProvider
|
||||
{
|
||||
public SidebarItem[] Get()
|
||||
public void ModifySidebar(List<SidebarItem> items)
|
||||
{
|
||||
return
|
||||
[
|
||||
// User
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-chart-no-axes-gantt",
|
||||
Name = "Overview",
|
||||
Path = "/",
|
||||
Priority = 0,
|
||||
RequiresExactMatch = true
|
||||
},
|
||||
|
||||
// Admin
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-chart-no-axes-gantt",
|
||||
Name = "Overview",
|
||||
Group = "Admin",
|
||||
Path = "/admin",
|
||||
Priority = 0,
|
||||
RequiresExactMatch = true,
|
||||
Permission = "admin.overview"
|
||||
},
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-users",
|
||||
Name = "Users",
|
||||
Group = "Admin",
|
||||
Path = "/admin/users",
|
||||
Priority = 1,
|
||||
RequiresExactMatch = false,
|
||||
Permission = "admin.users.read"
|
||||
},
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-key-square",
|
||||
Name = "API",
|
||||
Group = "Admin",
|
||||
Path = "/admin/api",
|
||||
Priority = 2,
|
||||
RequiresExactMatch = false,
|
||||
Permission = "admin.api.read"
|
||||
},
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-settings",
|
||||
Name = "System",
|
||||
Group = "Admin",
|
||||
Path = "/admin/system",
|
||||
Priority = 3,
|
||||
RequiresExactMatch = false,
|
||||
Permission = "admin.system.overview"
|
||||
},
|
||||
];
|
||||
items.AddRange(
|
||||
[
|
||||
// User
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-chart-no-axes-gantt",
|
||||
Name = "Overview",
|
||||
Path = "/",
|
||||
Priority = 0,
|
||||
RequiresExactMatch = true
|
||||
},
|
||||
|
||||
// Admin
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-chart-no-axes-gantt",
|
||||
Name = "Overview",
|
||||
Group = "Admin",
|
||||
Path = "/admin",
|
||||
Priority = 0,
|
||||
RequiresExactMatch = true,
|
||||
Permission = "admin.overview"
|
||||
},
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-users",
|
||||
Name = "Users",
|
||||
Group = "Admin",
|
||||
Path = "/admin/users",
|
||||
Priority = 1,
|
||||
RequiresExactMatch = false,
|
||||
Permission = "admin.users.read"
|
||||
},
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-key-square",
|
||||
Name = "API",
|
||||
Group = "Admin",
|
||||
Path = "/admin/api",
|
||||
Priority = 2,
|
||||
RequiresExactMatch = false,
|
||||
Permission = "admin.api.read"
|
||||
},
|
||||
new SidebarItem()
|
||||
{
|
||||
Icon = "icon-settings",
|
||||
Name = "System",
|
||||
Group = "Admin",
|
||||
Path = "/admin/system",
|
||||
Priority = 3,
|
||||
RequiresExactMatch = false,
|
||||
Permission = "admin.system.overview"
|
||||
},
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
using MoonCore.Blazor.Tailwind.Fm.Models;
|
||||
using MoonCore.Helpers;
|
||||
using Moonlight.Shared.Http.Requests.Admin.Sys.Files;
|
||||
using Moonlight.Shared.Http.Responses.Admin.Sys.Files;
|
||||
using Moonlight.Shared.Http.Responses.Admin.Sys;
|
||||
|
||||
namespace Moonlight.Client.Implementations;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user