mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor(editor): disable community nodes on desktop (#4335)
* ⚡ Disable community nodes on desktop * 🔥 Remove logging
This commit is contained in:
@@ -57,6 +57,9 @@ const module: Module<ISettingsState, IRootState> = {
|
|||||||
getPromptsData(state: ISettingsState) {
|
getPromptsData(state: ISettingsState) {
|
||||||
return state.promptsData;
|
return state.promptsData;
|
||||||
},
|
},
|
||||||
|
isDesktopDeployment(state: ISettingsState) {
|
||||||
|
return state.settings.deployment?.type.startsWith('desktop_');
|
||||||
|
},
|
||||||
isCloudDeployment(state: ISettingsState) {
|
isCloudDeployment(state: ISettingsState) {
|
||||||
return state.settings.deployment && state.settings.deployment.type === 'cloud';
|
return state.settings.deployment && state.settings.deployment.type === 'cloud';
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -801,6 +801,7 @@
|
|||||||
"settings.communityNodes.empty.installPackageLabel": "Install a community node",
|
"settings.communityNodes.empty.installPackageLabel": "Install a community node",
|
||||||
"settings.communityNodes.queueMode.warning": "You need to install community nodes manually because your instance is running in queue mode. <a href=\"{docURL}\" target=\"_blank\" title=\"Read the n8n docs\">More info</a>",
|
"settings.communityNodes.queueMode.warning": "You need to install community nodes manually because your instance is running in queue mode. <a href=\"{docURL}\" target=\"_blank\" title=\"Read the n8n docs\">More info</a>",
|
||||||
"settings.communityNodes.npmUnavailable.warning": "To use this feature, please <a href=\"{npmUrl}\" target=\"_blank\" title=\"How to install npm\">install npm</a> and restart n8n.",
|
"settings.communityNodes.npmUnavailable.warning": "To use this feature, please <a href=\"{npmUrl}\" target=\"_blank\" title=\"How to install npm\">install npm</a> and restart n8n.",
|
||||||
|
"settings.communityNodes.notAvailableOnDesktop": "Feature unavailable on desktop. Please self-host to use community nodes.",
|
||||||
"settings.communityNodes.packageNodes.label": "{count} node | {count} nodes",
|
"settings.communityNodes.packageNodes.label": "{count} node | {count} nodes",
|
||||||
"settings.communityNodes.updateAvailable.tooltip": "A newer version is available",
|
"settings.communityNodes.updateAvailable.tooltip": "A newer version is available",
|
||||||
"settings.communityNodes.viewDocsAction.label": "Documentation",
|
"settings.communityNodes.viewDocsAction.label": "Documentation",
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
:heading="$locale.baseText('settings.communityNodes.empty.title')"
|
:heading="$locale.baseText('settings.communityNodes.empty.title')"
|
||||||
:description="getEmptyStateDescription"
|
:description="getEmptyStateDescription"
|
||||||
:buttonText="
|
:buttonText="
|
||||||
isNpmAvailable
|
shouldShowInstallButton
|
||||||
? $locale.baseText('settings.communityNodes.empty.installPackageLabel')
|
? $locale.baseText('settings.communityNodes.empty.installPackageLabel')
|
||||||
: ''
|
: ''
|
||||||
"
|
"
|
||||||
@@ -146,7 +146,21 @@ export default mixins(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
isDesktopDeployment() {
|
||||||
|
return this.$store.getters['settings/isDesktopDeployment'];
|
||||||
|
},
|
||||||
|
shouldShowInstallButton() {
|
||||||
|
return !this.isDesktopDeployment && this.isNpmAvailable;
|
||||||
|
},
|
||||||
actionBoxConfig() {
|
actionBoxConfig() {
|
||||||
|
if (this.isDesktopDeployment) {
|
||||||
|
return {
|
||||||
|
calloutText: this.$locale.baseText('settings.communityNodes.notAvailableOnDesktop'),
|
||||||
|
calloutTheme: 'warning',
|
||||||
|
hideButton: true,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (!this.isNpmAvailable) {
|
if (!this.isNpmAvailable) {
|
||||||
return {
|
return {
|
||||||
calloutText: this.$locale.baseText(
|
calloutText: this.$locale.baseText(
|
||||||
|
|||||||
Reference in New Issue
Block a user