mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(core): Fix frontend.settings
external hook execution (#7496)
This commit is contained in:
parent
4e66023cd4
commit
774fe202bf
|
@ -30,11 +30,14 @@ import {
|
||||||
getWorkflowHistoryPruneTime,
|
getWorkflowHistoryPruneTime,
|
||||||
} from '@/workflows/workflowHistory/workflowHistoryHelper.ee';
|
} from '@/workflows/workflowHistory/workflowHistoryHelper.ee';
|
||||||
import { UserManagementMailer } from '@/UserManagement/email';
|
import { UserManagementMailer } from '@/UserManagement/email';
|
||||||
|
import type { CommunityPackagesService } from '@/services/communityPackages.service';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class FrontendService {
|
export class FrontendService {
|
||||||
settings: IN8nUISettings;
|
settings: IN8nUISettings;
|
||||||
|
|
||||||
|
private communityPackagesService?: CommunityPackagesService;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private readonly loadNodesAndCredentials: LoadNodesAndCredentials,
|
private readonly loadNodesAndCredentials: LoadNodesAndCredentials,
|
||||||
private readonly credentialTypes: CredentialTypes,
|
private readonly credentialTypes: CredentialTypes,
|
||||||
|
@ -44,6 +47,13 @@ export class FrontendService {
|
||||||
private readonly instanceSettings: InstanceSettings,
|
private readonly instanceSettings: InstanceSettings,
|
||||||
) {
|
) {
|
||||||
this.initSettings();
|
this.initSettings();
|
||||||
|
|
||||||
|
if (config.getEnv('nodes.communityPackages.enabled')) {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
|
void import('@/services/communityPackages.service').then(({ CommunityPackagesService }) => {
|
||||||
|
this.communityPackagesService = Container.get(CommunityPackagesService);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private initSettings() {
|
private initSettings() {
|
||||||
|
@ -198,7 +208,7 @@ export class FrontendService {
|
||||||
this.writeStaticJSON('credentials', credentials);
|
this.writeStaticJSON('credentials', credentials);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSettings(): Promise<IN8nUISettings> {
|
getSettings(): IN8nUISettings {
|
||||||
const restEndpoint = config.getEnv('endpoints.rest');
|
const restEndpoint = config.getEnv('endpoints.rest');
|
||||||
|
|
||||||
// Update all urls, in case `WEBHOOK_URL` was updated by `--tunnel`
|
// Update all urls, in case `WEBHOOK_URL` was updated by `--tunnel`
|
||||||
|
@ -275,10 +285,8 @@ export class FrontendService {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getEnv('nodes.communityPackages.enabled')) {
|
if (this.communityPackagesService) {
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
this.settings.missingPackages = this.communityPackagesService.hasMissingPackages;
|
||||||
const { CommunityPackagesService } = await import('@/services/communityPackages.service');
|
|
||||||
this.settings.missingPackages = Container.get(CommunityPackagesService).hasMissingPackages;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.settings.mfa.enabled = config.get('mfa.enabled');
|
this.settings.mfa.enabled = config.get('mfa.enabled');
|
||||||
|
|
Loading…
Reference in a new issue