Implemented basic ui for server sharing. Extracted server authorization. Refactoring and small improvements
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user