Added policy validation, ordering and virtual listing properties
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user