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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
7
DbFirst.BlazorWebApp/Components/Pages/Catalogs.razor
Normal file
7
DbFirst.BlazorWebApp/Components/Pages/Catalogs.razor
Normal file
@@ -0,0 +1,7 @@
|
||||
@page "/catalogs"
|
||||
|
||||
<PageTitle>Catalogs</PageTitle>
|
||||
|
||||
<h1>Catalogs</h1>
|
||||
|
||||
<CatalogsGrid />
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user