Implemented basic ui for server sharing. Extracted server authorization. Refactoring and small improvements

This commit is contained in:
2025-06-11 21:59:49 +02:00
parent cfed1aefde
commit b53140e633
35 changed files with 1098 additions and 213 deletions

View File

@@ -1,22 +1,29 @@
using MoonlightServers.Frontend.UI.Components.Servers.ServerTabs;
using MoonlightServers.Shared.Models;
namespace MoonlightServers.Frontend.Models;
public class ServerTab
public record ServerTab
{
public string Name { get; private set; }
public string Path { get; private set; }
public int Priority { get; set; }
public Func<ServerSharePermission, bool>? PermissionFilter { get; private set; }
public int Priority { get; private set; }
public Type ComponentType { get; private set; }
public static ServerTab CreateFromComponent<T>(string name, string path, int priority) where T : BaseServerTab
public static ServerTab CreateFromComponent<T>(
string name,
string path,
int priority,
Func<ServerSharePermission, bool>? filter = null) where T : BaseServerTab
{
return new()
{
Name = name,
Path = path,
Priority = priority,
ComponentType = typeof(T)
ComponentType = typeof(T),
PermissionFilter = filter
};
}
}