mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
refactor(editor): disable community nodes on desktop (#4335)
* ⚡ Disable community nodes on desktop * 🔥 Remove logging
This commit is contained in:
parent
d45bc4999c
commit
12e821528b
|
@ -57,6 +57,9 @@ const module: Module<ISettingsState, IRootState> = {
|
|||
getPromptsData(state: ISettingsState) {
|
||||
return state.promptsData;
|
||||
},
|
||||
isDesktopDeployment(state: ISettingsState) {
|
||||
return state.settings.deployment?.type.startsWith('desktop_');
|
||||
},
|
||||
isCloudDeployment(state: ISettingsState) {
|
||||
return state.settings.deployment && state.settings.deployment.type === 'cloud';
|
||||
},
|
||||
|
|
|
@ -801,6 +801,7 @@
|
|||
"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.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.updateAvailable.tooltip": "A newer version is available",
|
||||
"settings.communityNodes.viewDocsAction.label": "Documentation",
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
:heading="$locale.baseText('settings.communityNodes.empty.title')"
|
||||
:description="getEmptyStateDescription"
|
||||
:buttonText="
|
||||
isNpmAvailable
|
||||
shouldShowInstallButton
|
||||
? $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() {
|
||||
if (this.isDesktopDeployment) {
|
||||
return {
|
||||
calloutText: this.$locale.baseText('settings.communityNodes.notAvailableOnDesktop'),
|
||||
calloutTheme: 'warning',
|
||||
hideButton: true,
|
||||
};
|
||||
}
|
||||
|
||||
if (!this.isNpmAvailable) {
|
||||
return {
|
||||
calloutText: this.$locale.baseText(
|
||||
|
|
Loading…
Reference in a new issue