diff --git a/DbFirst.API/Controllers/DefaultDashboardController.cs b/DbFirst.API/Controllers/DefaultDashboardController.cs
new file mode 100644
index 0000000..960a05e
--- /dev/null
+++ b/DbFirst.API/Controllers/DefaultDashboardController.cs
@@ -0,0 +1,14 @@
+using DevExpress.DashboardAspNetCore;
+using DevExpress.DashboardWeb;
+using Microsoft.AspNetCore.DataProtection;
+
+namespace BlazorDashboardApp.Server
+{
+ public class DefaultDashboardController : DashboardController
+ {
+ public DefaultDashboardController(DashboardConfigurator configurator, IDataProtectionProvider? dataProtectionProvider = null)
+ : base(configurator, dataProtectionProvider)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/DbFirst.API/Data/Dashboards/DefaultDashboard.xml b/DbFirst.API/Data/Dashboards/DefaultDashboard.xml
new file mode 100644
index 0000000..a13c39d
--- /dev/null
+++ b/DbFirst.API/Data/Dashboards/DefaultDashboard.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/DbFirst.API/DbFirst.API.csproj b/DbFirst.API/DbFirst.API.csproj
index 433fe77..4f70300 100644
--- a/DbFirst.API/DbFirst.API.csproj
+++ b/DbFirst.API/DbFirst.API.csproj
@@ -9,6 +9,7 @@
+
@@ -25,4 +26,8 @@
+
+
+
+
diff --git a/DbFirst.API/Program.cs b/DbFirst.API/Program.cs
index 2fb8a22..6996abe 100644
--- a/DbFirst.API/Program.cs
+++ b/DbFirst.API/Program.cs
@@ -4,6 +4,11 @@ using DbFirst.Application.Repositories;
using DbFirst.Domain;
using DbFirst.Infrastructure;
using DbFirst.Infrastructure.Repositories;
+using DevExpress.AspNetCore;
+using DevExpress.DashboardAspNetCore;
+using DevExpress.DashboardCommon;
+using DevExpress.DashboardWeb;
+using DevExpress.DataAccess.Json;
var builder = WebApplication.CreateBuilder(args);
@@ -44,6 +49,33 @@ builder.Services.AddApplication();
builder.Services.AddScoped();
+builder.Services.AddDevExpressControls();
+builder.Services.AddScoped((IServiceProvider serviceProvider) => {
+ var dashboardsPath = Path.Combine(builder.Environment.ContentRootPath, "Data", "Dashboards");
+ Directory.CreateDirectory(dashboardsPath);
+
+ var defaultDashboardPath = Path.Combine(dashboardsPath, "DefaultDashboard.xml");
+ if (!File.Exists(defaultDashboardPath))
+ {
+ var defaultDashboard = new Dashboard();
+ defaultDashboard.Title.Text = "Default Dashboard";
+ defaultDashboard.SaveToXml(defaultDashboardPath);
+ }
+
+ DashboardConfigurator configurator = new DashboardConfigurator();
+ // Register Dashboard Storage
+ configurator.SetDashboardStorage(new DashboardFileStorage(dashboardsPath));
+ // Create a sample JSON data source
+ DataSourceInMemoryStorage dataSourceStorage = new DataSourceInMemoryStorage();
+ DashboardJsonDataSource jsonDataSourceUrl = new DashboardJsonDataSource("JSON Data Source (URL)");
+ jsonDataSourceUrl.JsonSource = new UriJsonSource(
+ new Uri("https://raw.githubusercontent.com/DevExpress-Examples/DataSources/master/JSON/customers.json"));
+ jsonDataSourceUrl.RootElement = "Customers";
+ dataSourceStorage.RegisterDataSource("jsonDataSourceUrl", jsonDataSourceUrl.SaveToXml());
+ configurator.SetDataSourceStorage(dataSourceStorage);
+ return configurator;
+});
+
var app = builder.Build();
// Configure the HTTP request pipeline.
@@ -55,10 +87,13 @@ if (app.Environment.IsDevelopment())
app.UseMiddleware();
+app.UseDevExpressControls();
app.UseHttpsRedirection();
app.UseCors();
app.UseAuthorization();
+app.MapDashboardRoute("api/dashboard", "DefaultDashboard");
+
app.MapControllers();
app.Run();
diff --git a/DbFirst.BlazorWasm/App.razor b/DbFirst.BlazorWasm/App.razor
index 6f372a0..3d316ad 100644
--- a/DbFirst.BlazorWasm/App.razor
+++ b/DbFirst.BlazorWasm/App.razor
@@ -4,7 +4,8 @@
• Der Router-Komponent in App.razor entscheidet, welche Blazor-Komponente basierend auf der URL geladen wird.
kurz: Steuert die Navigation und das Rendering der Blazor-Komponenten.
*@
-
+@DxResourceManager.RegisterTheme(Themes.Fluent)
+@DxResourceManager.RegisterScripts()
diff --git a/DbFirst.BlazorWasm/DbFirst.BlazorWasm.csproj b/DbFirst.BlazorWasm/DbFirst.BlazorWasm.csproj
index 67b3338..cdcb88f 100644
--- a/DbFirst.BlazorWasm/DbFirst.BlazorWasm.csproj
+++ b/DbFirst.BlazorWasm/DbFirst.BlazorWasm.csproj
@@ -7,9 +7,12 @@
+
+
+
+
-
diff --git a/DbFirst.BlazorWasm/Layout/NavMenu.razor b/DbFirst.BlazorWasm/Layout/NavMenu.razor
index c170642..8c006ab 100644
--- a/DbFirst.BlazorWasm/Layout/NavMenu.razor
+++ b/DbFirst.BlazorWasm/Layout/NavMenu.razor
@@ -21,6 +21,11 @@
Catalogs
+
+
+ Web Dashboard
+
+
diff --git a/DbFirst.BlazorWasm/Pages/Dashboard.razor b/DbFirst.BlazorWasm/Pages/Dashboard.razor
new file mode 100644
index 0000000..0b228d0
--- /dev/null
+++ b/DbFirst.BlazorWasm/Pages/Dashboard.razor
@@ -0,0 +1,12 @@
+@page "/dashboard"
+@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
+
+
+
+
+@code {
+ private string DashboardEndpoint => $"{Configuration["ApiBaseUrl"]?.TrimEnd('/')}/api/dashboard";
+}
+
+@*
+ *@
\ No newline at end of file
diff --git a/DbFirst.BlazorWasm/_Imports.razor b/DbFirst.BlazorWasm/_Imports.razor
index fb7bcf1..27c188c 100644
--- a/DbFirst.BlazorWasm/_Imports.razor
+++ b/DbFirst.BlazorWasm/_Imports.razor
@@ -11,3 +11,5 @@
@using DbFirst.BlazorWasm.Models
@using DbFirst.BlazorWasm.Services
@using DevExpress.Blazor
+@using DevExpress.DashboardBlazor
+@using DevExpress.DashboardWeb
\ No newline at end of file
diff --git a/DbFirst.BlazorWasm/wwwroot/index.html b/DbFirst.BlazorWasm/wwwroot/index.html
index f146c9f..840769e 100644
--- a/DbFirst.BlazorWasm/wwwroot/index.html
+++ b/DbFirst.BlazorWasm/wwwroot/index.html
@@ -17,6 +17,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/DbFirst.BlazorWebApp/Components/App.razor b/DbFirst.BlazorWebApp/Components/App.razor
index 93223a9..5972a1e 100644
--- a/DbFirst.BlazorWebApp/Components/App.razor
+++ b/DbFirst.BlazorWebApp/Components/App.razor
@@ -5,6 +5,18 @@
+ @DxResourceManager.RegisterTheme(Themes.Fluent)
+ @DxResourceManager.RegisterScripts()
+
+
+
+
+
+
+
+
+
+
diff --git a/DbFirst.BlazorWebApp/Components/Layout/NavMenu.razor b/DbFirst.BlazorWebApp/Components/Layout/NavMenu.razor
index 1a81832..4363fd0 100644
--- a/DbFirst.BlazorWebApp/Components/Layout/NavMenu.razor
+++ b/DbFirst.BlazorWebApp/Components/Layout/NavMenu.razor
@@ -25,6 +25,11 @@
Weather
+
+
+ Web Dashboard
+
+
diff --git a/DbFirst.BlazorWebApp/Components/Pages/Dashboard.razor b/DbFirst.BlazorWebApp/Components/Pages/Dashboard.razor
new file mode 100644
index 0000000..0b228d0
--- /dev/null
+++ b/DbFirst.BlazorWebApp/Components/Pages/Dashboard.razor
@@ -0,0 +1,12 @@
+@page "/dashboard"
+@inject Microsoft.Extensions.Configuration.IConfiguration Configuration
+
+
+
+
+@code {
+ private string DashboardEndpoint => $"{Configuration["ApiBaseUrl"]?.TrimEnd('/')}/api/dashboard";
+}
+
+@*
+ *@
\ No newline at end of file
diff --git a/DbFirst.BlazorWebApp/Components/_Imports.razor b/DbFirst.BlazorWebApp/Components/_Imports.razor
index 0e069fa..2fc8dc7 100644
--- a/DbFirst.BlazorWebApp/Components/_Imports.razor
+++ b/DbFirst.BlazorWebApp/Components/_Imports.razor
@@ -8,3 +8,6 @@
@using Microsoft.JSInterop
@using DbFirst.BlazorWebApp
@using DbFirst.BlazorWebApp.Components
+@using DevExpress.Blazor
+@using DevExpress.DashboardBlazor
+@using DevExpress.DashboardWeb
\ No newline at end of file
diff --git a/DbFirst.BlazorWebApp/DbFirst.BlazorWebApp.csproj b/DbFirst.BlazorWebApp/DbFirst.BlazorWebApp.csproj
index 7756477..f2de668 100644
--- a/DbFirst.BlazorWebApp/DbFirst.BlazorWebApp.csproj
+++ b/DbFirst.BlazorWebApp/DbFirst.BlazorWebApp.csproj
@@ -7,7 +7,10 @@
-
+
+
+
+
diff --git a/DbFirst.BlazorWebApp/Program.cs b/DbFirst.BlazorWebApp/Program.cs
index 9a6fe6b..d244f42 100644
--- a/DbFirst.BlazorWebApp/Program.cs
+++ b/DbFirst.BlazorWebApp/Program.cs
@@ -1,4 +1,5 @@
using DbFirst.BlazorWebApp.Components;
+using DevExpress.Blazor;
var builder = WebApplication.CreateBuilder(args);
@@ -6,6 +7,8 @@ var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
+builder.Services.AddDevExpressBlazor();
+
var app = builder.Build();
// Configure the HTTP request pipeline.
diff --git a/DbFirst.BlazorWebApp/appsettings.Development.json b/DbFirst.BlazorWebApp/appsettings.Development.json
index 0c208ae..702a28b 100644
--- a/DbFirst.BlazorWebApp/appsettings.Development.json
+++ b/DbFirst.BlazorWebApp/appsettings.Development.json
@@ -4,5 +4,6 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
- }
+ },
+ "ApiBaseUrl": "https://localhost:7204/"
}
diff --git a/DbFirst.BlazorWebApp/appsettings.json b/DbFirst.BlazorWebApp/appsettings.json
index 10f68b8..73c9700 100644
--- a/DbFirst.BlazorWebApp/appsettings.json
+++ b/DbFirst.BlazorWebApp/appsettings.json
@@ -5,5 +5,6 @@
"Microsoft.AspNetCore": "Warning"
}
},
+ "ApiBaseUrl": "https://localhost:7204/",
"AllowedHosts": "*"
}