@hilin thanks for the feedback. we have reported your concerns to the team and they'll investigate on that.
@maliming is working on your issue. and it's holiday in their country now. @liang will help you while he's off.
this is not a bug, it's just not implemented in v4x. it'll be available in 5.0
if you don't want to overlap the jobs, there's a very basic solution; add a static variable bool IsTheLastJobStillRunning = false
then check this flag if it's true then return else set this true do your work set this false.
Hi rick,
please keep the conversation here.
thanks for the feedback
this is a consultancy topic and not direclty related to ABP code base. if you face a concrete problem in ABP code we would like to help you.
Create the below extension class in your web project.
Set the ForwardedHeaderName
to whatever HTTP header the real IP address is in.
public static class ApplicationBuilderExtensions
{
public static IApplicationBuilder UseCustomHttpHeaders(this IApplicationBuilder builder)
{
var options = new ForwardedHeadersOptions
{
ForwardedForHeaderName = ForwardedHeadersDefaults.XOriginalHostHeaderName, //"X-Original-Host"
ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto
};
options.KnownNetworks.Clear();
options.KnownProxies.Clear();
return builder.UseForwardedHeaders(options);
}
}
Open your web module class.
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseCustomHttpHeaders();
}
else
{
app.UseErrorPage();
app.UseCustomHttpHeaders();
app.UseHsts();
app.UseAllElasticApm(context.GetConfiguration());
}
//...
Create a simple controller to test it.
public class Test : Controller
{
public string Index()
{
return "Client IP Address: " + HttpContext.Connection.RemoteIpAddress.ToString();
}
}
Open Postman and make a GET request to TestController
PS: If you want to use X-Forwarded-For
header, then remove ForwardedForHeaderName = "X-Original-Host"
.
References:
On the angular side, we have a service, a guard and a directive responsible for permission management. All you need to do is to replace the service with your own. Here is how you can do it
First, create a service of your own. Let's call it CustomPermissionService
and extend PermissionService
from @abp/ng.core
as follows:
import { ConfigStateService, PermissionService } from '@abp/ng.core';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class CustomPermissionService extends PermissionService {
constructor(configStateService: ConfigStateService) {
super(configStateService);
}
getGrantedPolicy$(key: string) {
return super.getGrantedPolicy$(key);
}
}
And in app.module.ts
, provide this service as follows:
@NgModule({
// ...
providers: [
// ...
{
provide: PermissionService,
useExisting: CustomPermissionService,
},
],
// ...
})
export class AppModule {}
That's it. Now, when a directive/guard asks for PermissionService
from angular, it will inject your service.
For more information about the PermissionService, you can examine it here. https://github.com/abpframework/abp/blob/dev/npm/ng-packs/packages/core/src/lib/services/permission.service.ts
wait for 4.4.3 (this week)