Added theme saving. Added interfaces for overview pages. Renamed sidebar interface function

This commit is contained in:
2025-02-26 13:09:31 +01:00
parent f4a0aabb61
commit cdc4744f28
20 changed files with 224 additions and 117 deletions

View File

@@ -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"
},
]
);
}
}