Hi,
Sorry I didn't get it.
When you set Layout = null
, the layout is now empty:
@{
Layout = null;
}
BTW, we have a empty layout , you can use:
@inject IThemeManager ThemeManager
@{
Layout = ThemeManager.CurrentTheme.GetEmptyLayout();
}
Hi,
Backend:
.....
app.UseAuthorization();
app.Use(async (httpContext, next) =>
{
var currentUser = httpContext.RequestServices.GetRequiredService<ICurrentUser>();
var currentPrincipal = httpContext.RequestServices.GetRequiredService<ICurrentPrincipalAccessor>();
var claimsIdentity = currentPrincipal.Principal.Identities.FirstOrDefault();
if (currentUser.IsAuthenticated)
{
claimsIdentity?.AddClaim(new Claim("test","test"));
}
using (currentPrincipal.Change(claimsIdentity))
{
await next.Invoke();
}
});
Blazor:
public class MyHubFilter : IHubFilter
{
public virtual async ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext,
Func<HubInvocationContext, ValueTask<object>> next)
{
var currentUser = invocationContext.ServiceProvider.GetRequiredService<ICurrentUser>();
if (!currentUser.IsAuthenticated)
{
return await next(invocationContext);
}
var currentPrincipalAccessor = invocationContext.ServiceProvider.GetRequiredService<ICurrentPrincipalAccessor>();
var claimsIdentity = currentPrincipalAccessor.Principal.Identities.First();
claimsIdentity.AddClaim(new Claim("test","test"));
using (currentPrincipalAccessor.Change(claimsIdentity))
{
return await next(invocationContext);
}
}
}
Configure<HubOptions>(options =>
{
options.AddFilter<MyHubFilter >();
});
Hi,
We will fix the problem, and your ticket refunded.
You can use the event bus (domain event or your custom event) to save data to DB or Elastic search.
If you already have some data, then you may need to do a data migration.
We have some usage of elasticsearch: https://github.com/abpframework/abp/blob/dev/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/DocumentChangedEventHandler.cs https://github.com/abpframework/abp/blob/dev/modules/docs/src/Volo.Docs.Domain/Volo/Docs/Documents/FullSearch/Elastic/ElasticDocumentFullSearch.cs
Hi,
With independent services, the reporting module is more like an infrastructure, you can use it anywhere.
When you have hundreds of tenant independent databases, it's not good to query this data from the tenant's database context. It is better to use a separate database table for reporting.
Do you have any useful links/references that may help us clarify this approach
Sorry, I don't have such links. it's more like our audit logging module, you can check it.
I will make an example for you.
Thanks, we will check it.
Hi,
JWT token is designed to be immutable, but you can create a middleware
to change the ICurrentPrincipalAccessor to add the claims.
It should work on the current HTTP request.
But for Blazor server UI. It uses SignalR to synchronize operations, you can create a hub filter.
Hi,
I will check it
Hi,
Why not create a reporting service(module), it has a separate database or NoSQL database, like Elasticsearch? in this way you don't have to query hundreds of tenant databases to get reports.
About performance,
You can create a background worker to generate reports periodically, when you query, it's ready immediately. (not used for real-time reporting)