Started improving server shares and general api controller structure

This commit is contained in:
2025-07-24 18:28:10 +02:00
parent a2db7be26f
commit 1f94752c54
29 changed files with 318 additions and 201 deletions

View File

@@ -1,4 +1,5 @@
using MoonlightServers.Frontend.UI.Components.Servers.ServerTabs;
using MoonlightServers.Shared.Enums;
using MoonlightServers.Shared.Models;
namespace MoonlightServers.Frontend.Models;
@@ -7,7 +8,8 @@ public record ServerTab
{
public string Name { get; private set; }
public string Path { get; private set; }
public Func<ServerSharePermission, bool>? PermissionFilter { get; private set; }
public string PermissionId { get; set; }
public ServerPermissionLevel PermissionLevel { get; set; }
public int Priority { get; private set; }
public Type ComponentType { get; private set; }
@@ -15,7 +17,7 @@ public record ServerTab
string name,
string path,
int priority,
Func<ServerSharePermission, bool>? filter = null) where T : BaseServerTab
string permissionId = "", ServerPermissionLevel permissionLevel = ServerPermissionLevel.None) where T : BaseServerTab
{
return new()
{
@@ -23,7 +25,8 @@ public record ServerTab
Path = path,
Priority = priority,
ComponentType = typeof(T),
PermissionFilter = filter
PermissionLevel = permissionLevel,
PermissionId = permissionId
};
}
}