Added policy validation, ordering and virtual listing properties

This commit is contained in:
2025-01-16 20:23:28 +01:00
parent 4908947217
commit e9f686cf19
17 changed files with 321 additions and 93 deletions

View File

@@ -1,4 +1,6 @@
@using HopFrame.Core.Services
@using HopFrame.Core.Config
@using HopFrame.Core.Services
<FluentAppBar Orientation="Orientation.Vertical" Style="background-color: var(--neutral-layer-2); height: auto">
<FluentAppBarItem Href="/admin"
Match="NavLinkMatch.All"
@@ -9,7 +11,7 @@
<br>
@foreach (var table in Explorer.GetTableNames()) {
@foreach (var table in _tables.OrderBy(t => t.Order).Select(t => t.DisplayName)) {
<FluentAppBarItem Href="@("/admin/" + table.ToLower())"
Match="NavLinkMatch.All"
IconActive="new Icons.Filled.Size24.Database()"
@@ -20,3 +22,18 @@
</FluentAppBar>
@inject IContextExplorer Explorer
@inject IHopFrameAuthHandler Handler
@code {
private readonly List<TableConfig> _tables = [];
protected override async Task OnInitializedAsync() {
foreach (var table in Explorer.GetTables()) {
if (table.Ignored) continue;
if (!await Handler.IsAuthenticatedAsync(table.ViewPolicy)) continue;
_tables.Add(table);
}
}
}