Add Catalogs page and simplify dashboard navigation

- Added a new Catalogs.razor page with a CatalogsGrid component and navigation link.
- Simplified Dashboard.razor to only show the default dashboard in designer mode; removed catalog grid options.
- Updated dashboard parameter logic to always redirect to "dashboards/default" unless already selected.
This commit is contained in:
OlgunR
2026-02-03 12:51:20 +01:00
parent 9db55fd2fd
commit 7ca37dbfca
4 changed files with 19 additions and 38 deletions

View File

@@ -49,25 +49,10 @@
<aside class="dashboard-nav">
<div class="dashboard-nav-title">Dashboards</div>
<NavLink class="dashboard-nav-link" href="dashboards/default">Default Dashboard (Designer)</NavLink>
<NavLink class="dashboard-nav-link" href="dashboards/catalog-grid">Catalogs (Dashboard Grid)</NavLink>
<NavLink class="dashboard-nav-link" href="dashboards/custom-grid">Catalogs (Custom Grid)</NavLink>
</aside>
<section class="dashboard-content">
@if (SelectedDashboardId == "default")
{
<DxDashboard Endpoint="@DashboardEndpoint" InitialDashboardId="DefaultDashboard" WorkingMode="WorkingMode.Designer" style="width: 100%; height: 800px;">
</DxDashboard>
}
else if (SelectedDashboardId == "catalog-grid")
{
<DxDashboard Endpoint="@DashboardEndpoint" InitialDashboardId="CatalogsGrid" WorkingMode="WorkingMode.ViewerOnly" style="width: 100%; height: 800px;">
</DxDashboard>
}
else if (SelectedDashboardId == "custom-grid")
{
<h3>Catalogs (Custom Grid)</h3>
<CatalogsGrid />
}
<DxDashboard Endpoint="@DashboardEndpoint" InitialDashboardId="DefaultDashboard" WorkingMode="WorkingMode.Designer" style="width: 100%; height: 800px;">
</DxDashboard>
</section>
</div>
@@ -75,11 +60,10 @@
[Parameter] public string? DashboardId { get; set; }
private string DashboardEndpoint => $"{Configuration["ApiBaseUrl"]?.TrimEnd('/')}/api/dashboard";
private string SelectedDashboardId => string.IsNullOrWhiteSpace(DashboardId) ? "default" : DashboardId;
protected override void OnParametersSet()
{
if (string.IsNullOrWhiteSpace(DashboardId))
if (!string.Equals(DashboardId, "default", StringComparison.OrdinalIgnoreCase))
{
Navigation.NavigateTo("dashboards/default", replace: true);
}

View File

@@ -25,6 +25,12 @@
<span class="bi bi-list-nested-nav-menu" aria-hidden="true"></span> Weather
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="catalogs">
<span class="bi bi-collection-nav-menu" aria-hidden="true"></span> Catalogs
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="dashboards/default">
<span class="oi oi-list-rich" aria-hidden="true"></span> Dashboards

View File

@@ -0,0 +1,7 @@
@page "/catalogs"
<PageTitle>Catalogs</PageTitle>
<h1>Catalogs</h1>
<CatalogsGrid />

View File

@@ -49,25 +49,10 @@
<aside class="dashboard-nav">
<div class="dashboard-nav-title">Dashboards</div>
<NavLink class="dashboard-nav-link" href="dashboards/default">Default Dashboard (Designer)</NavLink>
<NavLink class="dashboard-nav-link" href="dashboards/catalog-grid">Catalogs (Dashboard Grid)</NavLink>
<NavLink class="dashboard-nav-link" href="dashboards/custom-grid">Catalogs (Custom Grid)</NavLink>
</aside>
<section class="dashboard-content">
@if (SelectedDashboardId == "default")
{
<DxDashboard Endpoint="@DashboardEndpoint" InitialDashboardId="DefaultDashboard" WorkingMode="WorkingMode.Designer" style="width: 100%; height: 800px;">
</DxDashboard>
}
else if (SelectedDashboardId == "catalog-grid")
{
<DxDashboard Endpoint="@DashboardEndpoint" InitialDashboardId="CatalogsGrid" WorkingMode="WorkingMode.ViewerOnly" style="width: 100%; height: 800px;">
</DxDashboard>
}
else if (SelectedDashboardId == "custom-grid")
{
<h3>Catalogs (Custom Grid)</h3>
<CatalogsGrid />
}
<DxDashboard Endpoint="@DashboardEndpoint" InitialDashboardId="DefaultDashboard" WorkingMode="WorkingMode.Designer" style="width: 100%; height: 800px;">
</DxDashboard>
</section>
</div>
@@ -75,11 +60,10 @@
[Parameter] public string? DashboardId { get; set; }
private string DashboardEndpoint => $"{Configuration["ApiBaseUrl"]?.TrimEnd('/')}/api/dashboard";
private string SelectedDashboardId => string.IsNullOrWhiteSpace(DashboardId) ? "default" : DashboardId;
protected override void OnParametersSet()
{
if (string.IsNullOrWhiteSpace(DashboardId))
if (!string.Equals(DashboardId, "default", StringComparison.OrdinalIgnoreCase))
{
Navigation.NavigateTo("dashboards/default", replace: true);
}