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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user