mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat(core): Lazy-load nodes and credentials to reduce baseline memory usage (#4577)
This commit is contained in:
committed by
GitHub
parent
f63cd3b89e
commit
b6c57e19fc
@@ -31,16 +31,15 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
filePath(): string | null {
|
||||
if (!this.credentialWithIcon || !this.credentialWithIcon.icon || !this.credentialWithIcon.icon.startsWith('file:')) {
|
||||
const iconUrl = this.credentialWithIcon?.iconUrl;
|
||||
if (!iconUrl) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const restUrl = this.rootStore.getRestUrl;
|
||||
|
||||
return `${restUrl}/credential-icon/${this.credentialWithIcon.name}`;
|
||||
return this.rootStore.getBaseUrl + iconUrl;
|
||||
},
|
||||
|
||||
relevantNode(): INodeTypeDescription | null {
|
||||
if (this.credentialWithIcon && this.credentialWithIcon.icon && this.credentialWithIcon.icon.startsWith('node:')) {
|
||||
if (this.credentialWithIcon?.icon?.startsWith('node:')) {
|
||||
const nodeType = this.credentialWithIcon.icon.replace('node:', '');
|
||||
return this.nodeTypesStore.getNodeType(nodeType);
|
||||
}
|
||||
@@ -65,7 +64,7 @@ export default Vue.extend({
|
||||
return null;
|
||||
}
|
||||
|
||||
if (type.icon) {
|
||||
if (type.icon || type.iconUrl) {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user