feat(core): Lazy-load nodes and credentials to reduce baseline memory usage (#4577)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-11-23 16:20:28 +01:00
committed by GitHub
parent f63cd3b89e
commit b6c57e19fc
71 changed files with 1102 additions and 1279 deletions

View File

@@ -154,7 +154,7 @@ export const useCredentialsStore = defineStore(STORES.CREDENTIALS, {
return;
}
const rootStore = useRootStore();
const credentialTypes = await getCredentialTypes(rootStore.getRestApiContext);
const credentialTypes = await getCredentialTypes(rootStore.getBaseUrl);
this.setCredentialTypes(credentialTypes);
},
async fetchAllCredentials(): Promise<ICredentialsResponse[]> {

View File

@@ -26,6 +26,10 @@ export const useRootStore = defineStore(STORES.ROOT, {
instanceId: '',
}),
getters: {
getBaseUrl(): string {
return this.baseUrl;
},
getWebhookUrl(): string {
return `${this.urlBaseWebhook}${this.endpointWebhook}`;
},

View File

@@ -120,7 +120,7 @@ export const useNodeTypesStore = defineStore(STORES.NODE_TYPES, {
},
async getNodeTypes(): Promise<void> {
const rootStore = useRootStore();
const nodeTypes = await getNodeTypes(rootStore.getRestApiContext);
const nodeTypes = await getNodeTypes(rootStore.getBaseUrl);
if (nodeTypes.length) {
this.setNodeTypes(nodeTypes);
}