DAdmin 0.1.2
dotnet add package DAdmin --version 0.1.2
NuGet\Install-Package DAdmin -Version 0.1.2
<PackageReference Include="DAdmin" Version="0.1.2" />
<PackageVersion Include="DAdmin" Version="0.1.2" />
<PackageReference Include="DAdmin" />
paket add DAdmin --version 0.1.2
#r "nuget: DAdmin, 0.1.2"
#:package DAdmin@0.1.2
#addin nuget:?package=DAdmin&version=0.1.2
#tool nuget:?package=DAdmin&version=0.1.2
DAdmin Component Library
Introduction
This library provides a suite of Blazor components designed to create powerful and visually appealing admin panels with ease. It leverages EF DbContext and its entities to automate much of the admin panel creation. Key components include AdminPanel
, MenuItem
, DataResource
, Aggregator
, and TimeChart
.
Getting Started
To use these components, first ensure that you have referenced this library in your Blazor Server application. The library uses Entity Framework (EF) DbContext and its entities to generate data grids and other components dynamically.
Program.cs
builder.Services.DAdmin<YourDbContext>();
_imports.razor
@using DAdmin
Components
AdminPanel
The AdminPanel
component is the container for your administrative interface. It can automatically use DbContext entities to create a data grid for all DbContext entities when UseContextEntities
is set to true
.
Usage
- Basic Usage:
<AdminPanel/>
creates a default admin panel using integrated EF DbContext. - Advanced Usage: Set
UseContextEntities="true"
to enable automatic generation of data grids for each entity in your DbContext.
<AdminPanel UseContextEntities="true">
<MenuItem Name="Transactions" MenuSection="MenuSection.Resources">
<DataResource TEntity="Transaction" ExcludedProperties="@(new[] { "Status", "Username" })">
<Aggregators>
<Aggregator TEntity="Transaction" AggregationSelector="x => x.Amount" Aggregate="DataGridAggregateType.Sum"/>
</Aggregators>
</DataResource>
</MenuItem>
<MenuItem Name="Transactions Charts" MenuSection="MenuSection.Charts">
<TimeChart TEntity="Transaction"
Name="Transaction Activity"
ChartType="ChartType.Line"
AggregationType="AggregationType.Count"
AggregationSelector="entity => entity.Id"
LabelSelector="entity => entity.CreatedAt"
TimeInterval="ChartTimeInterval.Monthly"
QueryLogic="query => query"/>
</MenuItem>
</AdminPanel>
MenuItem
MenuItem defines an individual item in the admin panel, typically linked to a data resource.
Usage
<MenuItem Name="Transactions" MenuSection="MenuSection.Resources" IconClass="fa fa-table">
</MenuItem>
DataResource
DataResource connects a data entity to a menu item, allowing for data-driven components within the admin panel.
Usage
<DataResource TEntity="Transaction" ResourceName="Transactions" ExcludedProperties="@(new[] { "Status", "Username" })">
</DataResource>
Aggregator
Aggregator is used within DataResource for aggregating data like sums or averages.
Usage
<Aggregator TEntity="Transaction" AggregationSelector="x => x.Amount" Aggregate="DataGridAggregateType.Sum"/>
TimeChart
TimeChart provides a way to visualize data over time, such as line charts or bar graphs.
Usage
<TimeChart TEntity="Transaction"
Name="Transaction Activity"
ChartType="ChartType.Line"
AggregationType="AggregationType.Count"
AggregationSelector="entity => entity.Id"
LabelSelector="entity => entity.CreatedAt"
TimeInterval="ChartTimeInterval.Monthly"
QueryLogic="query => query"/>
We welcome contributions to this library. Please follow the standard procedures for submitting issues and pull requests.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Blazorise.Bootstrap (>= 1.3.2)
- Blazorise.DataGrid (>= 1.3.2)
- Blazorise.Icons.FontAwesome (>= 1.3.2)
- Bogus (>= 34.0.2)
- Microsoft.EntityFrameworkCore (>= 7.0.13)
-
net7.0
- Blazorise.Bootstrap (>= 1.3.2)
- Blazorise.DataGrid (>= 1.3.2)
- Blazorise.Icons.FontAwesome (>= 1.3.2)
- Bogus (>= 34.0.2)
- Microsoft.AspNetCore.Components (>= 7.0.14)
- Microsoft.AspNetCore.Components.Web (>= 7.0.14)
- Microsoft.EntityFrameworkCore (>= 7.0.13)
- Microsoft.JSInterop (>= 7.0.14)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.