n8n-editor-ui 1.90.1 → 1.92.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AnimatedSpinner-ChThynSJ.js → AnimatedSpinner-CtKKeDrz.js} +1 -1
- package/dist/assets/{AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-WGp2Kuen.js → AnnotationTagsDropdown.ee.vue_vue_type_script_setup_true_lang-DR6h_xsK.js} +1 -1
- package/dist/assets/{AuthView-Dlhn_SQ-.js → AuthView-mKkzBRxh.js} +2 -2
- package/dist/assets/{CanvasChatSwitch-BuBg7TJP.js → CanvasChatSwitch-Bu2VD2kp.js} +24 -12
- package/dist/assets/{ChangePasswordView-BKYXOoDf.js → ChangePasswordView-D5UI1v-J.js} +3 -3
- package/dist/assets/CollectionParameter-BeCTpZ-q.js +4 -0
- package/dist/assets/{CredentialsView-BNWIgrLb.js → CredentialsView-B78eNJO5.js} +10 -9
- package/dist/assets/{DemoFooter-DR6r_2qR.js → DemoFooter-DP26HpCu.js} +8 -8
- package/dist/assets/{ErrorView-Bu8Mt5FH.js → ErrorView-C3fvEdCg.js} +1 -1
- package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-DvtOOOhh.js → ExecutionsTime.vue_vue_type_script_setup_true_lang-BBpwYdHY.js} +2 -2
- package/dist/assets/{ExecutionsView-C0WZAIi0.js → ExecutionsView-BvlDZwIs.js} +11 -10
- package/dist/assets/{FileSaver.min-Cm0u4qyc.js → FileSaver.min-BzAtcQXX.js} +1 -1
- package/dist/assets/{FixedCollectionParameter-KmRZtBiP.js → FixedCollectionParameter-CS5zXMAh.js} +1 -1
- package/dist/assets/{ForgotMyPasswordView-GH7SqEFu.js → ForgotMyPasswordView-CVQ7pcIG.js} +3 -3
- package/dist/assets/{InsightsChartAverageRuntime-SeBUN06R.js → InsightsChartAverageRuntime-Boh0SMb3.js} +7 -6
- package/dist/assets/{InsightsChartFailed-TYjH8LwV.js → InsightsChartFailed-IZ-KYOU9.js} +7 -6
- package/dist/assets/{InsightsChartFailureRate-D41Jv-6v.js → InsightsChartFailureRate-2fWw3p0L.js} +7 -6
- package/dist/assets/{InsightsChartTimeSaved-TLPDAmPx.js → InsightsChartTimeSaved-B2pLVys1.js} +7 -6
- package/dist/assets/{InsightsChartTotal-CaKTe2mv.js → InsightsChartTotal-2QD4wPLR.js} +7 -6
- package/dist/assets/{InsightsDashboard-DPVczYm3.css → InsightsDashboard-Bx4vx9gz.css} +16 -0
- package/dist/assets/InsightsDashboard-CbiFbJ8w.js +372 -0
- package/dist/assets/{InsightsPaywall-Z4Y0nO-i.js → InsightsPaywall-5d-cSdiS.js} +1 -1
- package/dist/assets/{InsightsSummary-FixbpmPJ.css → InsightsSummary-CdlaUpAt.css} +25 -25
- package/dist/assets/{InsightsSummary-DzYli0Pu.js → InsightsSummary-gldDQ9rg.js} +16 -17
- package/dist/assets/{InsightsTableWorkflows-CUHAG57c.js → InsightsTableWorkflows-_eTCUNCX.js} +2 -2
- package/dist/assets/{Logo-Dxp4M9dy.js → Logo-Dl2xVRIu.js} +1 -1
- package/dist/assets/{LogsPanel-zIrTNE6j.js → LogsPanel-JnYirDqa.js} +520 -436
- package/dist/assets/{LogsPanel-DmPMCt9w.css → LogsPanel-mTaFEGk_.css} +208 -98
- package/dist/assets/{MainHeader-D4cIIoUA.js → MainHeader-Bk29pgmL.js} +122 -295
- package/dist/assets/MainHeader-CEPLiR-5.css +1044 -0
- package/dist/assets/{MainSidebar-BtW-9UPT.js → MainSidebar-BM5ku_wM.js} +11 -11
- package/dist/assets/{MainSidebar-CKMiDGvH.css → MainSidebar-zZpP3qQ0.css} +13 -12
- package/dist/assets/{NodeCreation-thD32mA1.js → NodeCreation-BEjdAYc_.js} +4 -4
- package/dist/assets/{NodeCreator-B4mHaU45.js → NodeCreator-cEUgbAI9.js} +14 -4
- package/dist/assets/{NodeDetailsView-cO3Ci9jH.js → NodeDetailsView-D4O9dKTA.js} +93 -68
- package/dist/assets/{NodeDetailsView-CGgV4Pn_.css → NodeDetailsView-DsFLtbxi.css} +20 -20
- package/dist/assets/{NodeView-E5b1ClVD.js → NodeView-DDSOUm8E.js} +152 -34
- package/dist/assets/{ProjectCardBadge-LnLKqSK-.js → ProjectCardBadge-BNn2hiMe.js} +1 -1
- package/dist/assets/{ProjectHeader-DC02ZuZ0.js → ProjectHeader-CaEZ2OPj.js} +1 -1
- package/dist/assets/{ProjectSettings-Zr1UOp7s.js → ProjectSettings-otA8E-yW.js} +2 -2
- package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-CM7WIpD3.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-C3JbZMCk.js} +1 -1
- package/dist/assets/{ResourcesListLayout-DTsuHdYx.js → ResourcesListLayout-1d9Ic6VX.js} +2 -2
- package/dist/assets/{ResourcesListLayout-CglK2dXR.css → ResourcesListLayout-CtGME7aU.css} +8 -8
- package/dist/assets/{RunData-DepHcD2K.css → RunData-BjlZgIyx.css} +102 -73
- package/dist/assets/{RunData-Ds-U68nr.js → RunData-Bx47sNQp.js} +690 -398
- package/dist/assets/{RunDataAi-BF2gZZGr.css → RunDataAi-D9VLFXIf.css} +10 -51
- package/dist/assets/{RunDataAi-DdK11EHU.js → RunDataAi-DOac7nwD.js} +27 -310
- package/dist/assets/{RunDataJson-Txw0lqay.css → RunDataJson-BH9HLoGC.css} +12 -8
- package/dist/assets/{RunDataJson-B2WU5od1.js → RunDataJson-Pev6yNEV.js} +20 -14
- package/dist/assets/{RunDataJsonActions-DqZ2X1yJ.js → RunDataJsonActions-Co4xgmVq.js} +1 -1
- package/dist/assets/RunDataParsedAiContent-9EEUzCKp.css +176 -0
- package/dist/assets/RunDataParsedAiContent-D6MNLmT3.js +148 -0
- package/dist/assets/{RunDataSearch-CQsyZvGK.js → RunDataSearch-C8orcAlP.js} +1 -1
- package/dist/assets/{RunDataTable-DyUvXWfl.css → RunDataTable-CUxj7dHx.css} +47 -39
- package/dist/assets/{RunDataTable-BO0R4JT_.js → RunDataTable-oi_l8dhA.js} +41 -30
- package/dist/assets/{SamlOnboarding-CmwMX5y2.js → SamlOnboarding-CT5J6dx0.js} +3 -3
- package/dist/assets/{SettingsApiView-D6uBbi9-.js → SettingsApiView-CupjcI9v.js} +1 -1
- package/dist/assets/{SettingsCommunityNodesView-CJODtx_K.js → SettingsCommunityNodesView-B5K2VLyJ.js} +4 -4
- package/dist/assets/{SettingsExternalSecrets-CVk14P_P.js → SettingsExternalSecrets-BidJCf_t.js} +1 -1
- package/dist/assets/{SettingsLdapView-pg71FErj.js → SettingsLdapView-Cva6akhW.js} +1 -1
- package/dist/assets/{SettingsLogStreamingView-DUOI3Xb9.js → SettingsLogStreamingView-Cy-rAKUO.js} +1 -1
- package/dist/assets/{SettingsPersonalView-BFnOmBPC.js → SettingsPersonalView-ZJ1Syok2.js} +14 -13
- package/dist/assets/{SettingsSourceControl-BUNmxcvB.js → SettingsSourceControl-CMtqqlkO.js} +1 -1
- package/dist/assets/{SettingsSso-Dx8Qw_2Z.js → SettingsSso-Bi3OpykL.js} +1 -1
- package/dist/assets/{SettingsUsageAndPlan-DTk86tXU.js → SettingsUsageAndPlan-C5TbwZhP.js} +1 -1
- package/dist/assets/{SettingsUsersView-BviXcl30.js → SettingsUsersView-BHuP5k0A.js} +1 -1
- package/dist/assets/{SettingsView-fzPdUijx.js → SettingsView-DPIIqaKN.js} +1 -1
- package/dist/assets/{SetupView-DUTx1JXK.js → SetupView-C4V9j6sh.js} +3 -3
- package/dist/assets/{SetupWorkflowCredentialsButton-fApxCGHh.js → SetupWorkflowCredentialsButton-BZ9ILQUp.js} +1 -1
- package/dist/assets/{SetupWorkflowFromTemplateView-C5t9fEKF.js → SetupWorkflowFromTemplateView-3uV3zSU2.js} +3 -3
- package/dist/assets/{SigninView-BRVoXQRW.js → SigninView-DWZHdCjG.js} +3 -3
- package/dist/assets/{SignoutView-Duh6wb4Y.js → SignoutView-DbduXAir.js} +1 -1
- package/dist/assets/{SignupView-DMkpTtjs.js → SignupView-DWq6VACk.js} +3 -3
- package/dist/assets/{TemplateDetails-Df9_jph6.js → TemplateDetails-BckqE6GK.js} +1 -1
- package/dist/assets/{TemplateList-qSnJvw0K.js → TemplateList-Bw0JeBMP.js} +1 -1
- package/dist/assets/{TemplatesCollectionView--ccYXaCo.js → TemplatesCollectionView-CAKT-mpV.js} +5 -5
- package/dist/assets/{TemplatesSearchView-D1YgHKld.js → TemplatesSearchView-I2a5us58.js} +3 -3
- package/dist/assets/{TemplatesView-B9CwObHN.js → TemplatesView-6EwGFFJK.js} +1 -1
- package/dist/assets/{TemplatesWorkflowView-DtLpUF59.js → TemplatesWorkflowView-C8xYMhwu.js} +5 -5
- package/dist/assets/{TestDefinitionEditView-DFcBlKnN.js → TestDefinitionEditView-CNd3Cuzq.js} +8 -8
- package/dist/assets/{TestDefinitionListView-C_mbolTO.js → TestDefinitionListView-BwTWIaAM.js} +1 -1
- package/dist/assets/{TestDefinitionNewView-CvyM6TLE.js → TestDefinitionNewView-BQas0_G1.js} +2 -2
- package/dist/assets/{TestDefinitionRootView-BXzJY0cY.js → TestDefinitionRootView-D971MFye.js} +1 -1
- package/dist/assets/{VariablesView-BHFJj5IU.js → VariablesView-DcBBuFxh.js} +3 -3
- package/dist/assets/{WorkerView-CgIksFjP.js → WorkerView-DSgBNIeb.js} +6 -6
- package/dist/assets/WorkflowActivator-CPCbgb_n.js +776 -0
- package/dist/assets/{MainHeader-CWA2JfVJ.css → WorkflowActivator-DAyH7N29.css} +74 -434
- package/dist/assets/{WorkflowExecutionsInfoAccordion-BcBLZ_Ul.js → WorkflowExecutionsInfoAccordion-Bc6vzAZu.js} +1 -1
- package/dist/assets/{WorkflowExecutionsLandingPage-B9ByHnbR.js → WorkflowExecutionsLandingPage-BPPS4V9i.js} +2 -2
- package/dist/assets/{WorkflowExecutionsPreview-DCE7TYLh.js → WorkflowExecutionsPreview-Bbb5MB8Z.js} +6 -6
- package/dist/assets/{WorkflowExecutionsView-DFoBpdS7.js → WorkflowExecutionsView-Pz-7iHJY.js} +11 -9
- package/dist/assets/{WorkflowHistory-DolmPUM2.js → WorkflowHistory-Czo9IuI6.js} +4 -4
- package/dist/assets/{WorkflowOnboardingView-DQW48M8_.js → WorkflowOnboardingView-B8DdkfJ5.js} +1 -1
- package/dist/assets/{WorkflowPreview-BFR6V9SO.js → WorkflowPreview-eVlO1itk.js} +1 -1
- package/dist/assets/{WorkflowsView-CsM69PSv.css → WorkflowsView-B2_HJCJ5.css} +28 -162
- package/dist/assets/{WorkflowsView-B-feKuLZ.js → WorkflowsView-Cr2D0vym.js} +124 -217
- package/dist/assets/{chartjs.utils-BcXTJ2Te.js → chartjs.utils-Dk1WO3Mr.js} +2 -2
- package/dist/assets/{dateFormatter-CZI1kGYK.js → dateFormatter-C8N5khiG.js} +5 -5
- package/dist/assets/{easyAiWorkflowUtils-ChToD_Yl.js → easyAiWorkflowUtils-CLqHnasO.js} +1 -1
- package/dist/assets/{global-link-actions-OGaZVwsw.js → global-link-actions-BvoZh8u9.js} +1 -1
- package/dist/assets/{import-curl-CAszzwx1.js → import-curl-BpxkGYMX.js} +1 -1
- package/dist/assets/{index-BpdkKRP4.js → index-B6eunbxp.js} +14227 -11881
- package/dist/assets/{index-7WdERzqm.js → index-Br8T1Gn6.js} +1 -1
- package/dist/assets/{index-C5OXOcIJ.css → index-DCpy4nCU.css} +6147 -4061
- package/dist/assets/{pickBy-mYqFOFbh.js → pickBy-8Urz9lDY.js} +1 -1
- package/dist/assets/{templateActions-BX9arLbc.js → templateActions-DzjysjbQ.js} +1 -1
- package/dist/assets/{useBeforeUnload-K7nQ15Rk.js → useBeforeUnload-DxrN8vOO.js} +1 -1
- package/dist/assets/{useCanvasMapping-D_UPCxYX.js → useCanvasMapping-C2BQB9QB.js} +270 -112
- package/dist/assets/{useCanvasMapping-C--wac6H.css → useCanvasMapping-cuXLM-h-.css} +185 -4
- package/dist/assets/{useCanvasOperations-D6VFiC3b.js → useCanvasOperations-DaP5jKbH.js} +4 -3
- package/dist/assets/{useClearExecutionButtonVisible-D_0O6f0X.js → useClearExecutionButtonVisible-BV-jMf2m.js} +2 -2
- package/dist/assets/{useExecutionDebugging-BNMaKOh7.js → useExecutionDebugging-0pPCimcw.js} +1 -1
- package/dist/assets/{useExecutionHelpers-DN5HqPqY.js → useExecutionHelpers-DIvhViMz.js} +2 -2
- package/dist/assets/{useImportCurlCommand-BSL596XF.js → useImportCurlCommand-BWf4R83s.js} +19 -10
- package/dist/assets/usePushConnection-Pobjq0U9.js +632 -0
- package/dist/assets/{useTestDefinitionForm-CIhrxyve.js → useTestDefinitionForm-BA3IS_2B.js} +1 -1
- package/dist/assets/{useWorkflowActivate-pZ62ib_C.js → useWorkflowActivate-DFqvrpj6.js} +1 -1
- package/dist/assets/useWorkflowSaving-BACesUoL.js +66 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/vite.config.mts +15 -1
- package/dist/assets/CollectionParameter-CQXiWluX.js +0 -4
- package/dist/assets/InsightsDashboard-o3JS9fjz.js +0 -178
- package/dist/assets/WorkflowActivator-BX59FxTZ.css +0 -260
- package/dist/assets/WorkflowActivator-O6i5XAk2.js +0 -231
- package/dist/assets/usePushConnection-BdV7ILvK.js +0 -535
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
import { d as defineComponent, q as computed, ab as ProjectTypes, c as useI18n, h as resolveComponent, i as createElementBlock, g as openBlock, n as normalizeClass, j as createVNode, w as withCtx, dF as ProjectIcon, l as createTextVNode, t as toDisplayString, _ as _export_sfc, a1 as useProjectsStore, a2 as useFoldersStore, r as ref, X as watch, y as onBeforeUnmount, e as createBlock, f as createCommentVNode, aV as createSlots, x as renderSlot, o as onMounted, aQ as onClickOutside, k as createBaseVNode, bd as withKeys, b2 as withModifiers, C as createEventBus, m as unref, a as useToast, H as useUIStore, b as useRouter, a5 as useWorkflowHelpers, Q as useWorkflowsStore, bR as useCredentialsStore, dG as getActivatableTriggerNodes, dH as EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE, S as PLACEHOLDER_EMPTY_WORKFLOW_ID, cm as resolveDirective, aA as withDirectives, dI as OPEN_AI_API_CREDENTIAL_TYPE, dJ as WORKFLOW_ACTIVATION_CONFLICTING_WEBHOOK_MODAL_KEY, aq as h } from "./index-B6eunbxp.js";
|
|
2
|
+
import { u as useWorkflowActivate } from "./useWorkflowActivate-DFqvrpj6.js";
|
|
3
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
4
|
+
__name: "ProjectBreadcrumb",
|
|
5
|
+
props: {
|
|
6
|
+
currentProject: {},
|
|
7
|
+
isDragging: { type: Boolean, default: false }
|
|
8
|
+
},
|
|
9
|
+
emits: ["projectHover", "projectDrop"],
|
|
10
|
+
setup(__props, { emit: __emit }) {
|
|
11
|
+
const props = __props;
|
|
12
|
+
const emit = __emit;
|
|
13
|
+
const i18n = useI18n();
|
|
14
|
+
const projectIcon = computed(() => {
|
|
15
|
+
if (props.currentProject?.type === ProjectTypes.Personal) {
|
|
16
|
+
return { type: "icon", value: "user" };
|
|
17
|
+
} else if (props.currentProject?.name) {
|
|
18
|
+
return props.currentProject.icon ?? { type: "icon", value: "layer-group" };
|
|
19
|
+
} else {
|
|
20
|
+
return { type: "icon", value: "home" };
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const projectName = computed(() => {
|
|
24
|
+
if (props.currentProject.type === ProjectTypes.Personal) {
|
|
25
|
+
return i18n.baseText("projects.menu.personal");
|
|
26
|
+
}
|
|
27
|
+
return props.currentProject.name;
|
|
28
|
+
});
|
|
29
|
+
const onHover = () => {
|
|
30
|
+
emit("projectHover");
|
|
31
|
+
};
|
|
32
|
+
const onProjectMouseUp = () => {
|
|
33
|
+
if (props.isDragging) {
|
|
34
|
+
emit("projectDrop");
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
const _component_ProjectIcon = ProjectIcon;
|
|
39
|
+
const _component_N8nText = resolveComponent("N8nText");
|
|
40
|
+
const _component_n8n_link = resolveComponent("n8n-link");
|
|
41
|
+
return openBlock(), createElementBlock("div", {
|
|
42
|
+
class: normalizeClass({ [_ctx.$style["home-project"]]: true, [_ctx.$style.dragging]: _ctx.isDragging }),
|
|
43
|
+
"data-test-id": "home-project",
|
|
44
|
+
onMouseenter: onHover,
|
|
45
|
+
onMouseup: _cache[0] || (_cache[0] = ($event) => _ctx.isDragging ? onProjectMouseUp() : null)
|
|
46
|
+
}, [
|
|
47
|
+
createVNode(_component_n8n_link, {
|
|
48
|
+
to: `/projects/${_ctx.currentProject.id}`,
|
|
49
|
+
class: normalizeClass([_ctx.$style["project-link"]])
|
|
50
|
+
}, {
|
|
51
|
+
default: withCtx(() => [
|
|
52
|
+
createVNode(_component_ProjectIcon, {
|
|
53
|
+
icon: projectIcon.value,
|
|
54
|
+
"border-less": true,
|
|
55
|
+
size: "mini",
|
|
56
|
+
title: projectName.value
|
|
57
|
+
}, null, 8, ["icon", "title"]),
|
|
58
|
+
createVNode(_component_N8nText, {
|
|
59
|
+
size: "medium",
|
|
60
|
+
color: "text-base",
|
|
61
|
+
class: normalizeClass(_ctx.$style["project-label"])
|
|
62
|
+
}, {
|
|
63
|
+
default: withCtx(() => [
|
|
64
|
+
createTextVNode(toDisplayString(projectName.value), 1)
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
}, 8, ["class"])
|
|
68
|
+
]),
|
|
69
|
+
_: 1
|
|
70
|
+
}, 8, ["to", "class"])
|
|
71
|
+
], 34);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const dragging = "_dragging_1gp09_128";
|
|
76
|
+
const style0$4 = {
|
|
77
|
+
"home-project": "_home-project_1gp09_123",
|
|
78
|
+
dragging,
|
|
79
|
+
"project-link": "_project-link_1gp09_141",
|
|
80
|
+
"project-label": "_project-label_1gp09_148"
|
|
81
|
+
};
|
|
82
|
+
const cssModules$4 = {
|
|
83
|
+
"$style": style0$4
|
|
84
|
+
};
|
|
85
|
+
const __unplugin_components_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__cssModules", cssModules$4]]);
|
|
86
|
+
const _hoisted_1$5 = { key: 2 };
|
|
87
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
88
|
+
__name: "FolderBreadcrumbs",
|
|
89
|
+
props: {
|
|
90
|
+
currentFolder: { default: null },
|
|
91
|
+
actions: { default: () => [] },
|
|
92
|
+
hiddenItemsTrigger: { default: "click" },
|
|
93
|
+
currentFolderAsLink: { type: Boolean, default: false },
|
|
94
|
+
visibleLevels: { default: 1 }
|
|
95
|
+
},
|
|
96
|
+
emits: ["itemSelected", "action", "itemDrop", "projectDrop"],
|
|
97
|
+
setup(__props, { emit: __emit }) {
|
|
98
|
+
const props = __props;
|
|
99
|
+
const emit = __emit;
|
|
100
|
+
const i18n = useI18n();
|
|
101
|
+
const projectsStore = useProjectsStore();
|
|
102
|
+
const foldersStore = useFoldersStore();
|
|
103
|
+
const hiddenBreadcrumbsItemsAsync = ref(new Promise(() => {
|
|
104
|
+
}));
|
|
105
|
+
const visibleIds = ref(/* @__PURE__ */ new Set());
|
|
106
|
+
const currentProject = computed(() => projectsStore.currentProject);
|
|
107
|
+
const projectName = computed(() => {
|
|
108
|
+
if (currentProject.value?.type === ProjectTypes.Personal) {
|
|
109
|
+
return i18n.baseText("projects.menu.personal");
|
|
110
|
+
}
|
|
111
|
+
return currentProject.value?.name;
|
|
112
|
+
});
|
|
113
|
+
const isDragging = computed(() => {
|
|
114
|
+
return foldersStore.draggedElement !== null;
|
|
115
|
+
});
|
|
116
|
+
const hasMoreItems = computed(() => {
|
|
117
|
+
return visibleBreadcrumbsItems.value[0]?.parentFolder !== void 0;
|
|
118
|
+
});
|
|
119
|
+
const visibleBreadcrumbsItems = computed(() => {
|
|
120
|
+
visibleIds.value.clear();
|
|
121
|
+
if (!props.currentFolder) return [];
|
|
122
|
+
const items = [];
|
|
123
|
+
const parent = props.visibleLevels === 2 ? foldersStore.getCachedFolder(props.currentFolder.parentFolder ?? "") : null;
|
|
124
|
+
if (parent) {
|
|
125
|
+
items.push({
|
|
126
|
+
id: parent.id,
|
|
127
|
+
label: parent.name,
|
|
128
|
+
href: `/projects/${projectsStore.currentProjectId}/folders/${parent.id}/workflows`,
|
|
129
|
+
parentFolder: parent.parentFolder
|
|
130
|
+
});
|
|
131
|
+
visibleIds.value.add(parent.id);
|
|
132
|
+
}
|
|
133
|
+
items.push({
|
|
134
|
+
id: props.currentFolder.id,
|
|
135
|
+
label: props.currentFolder.name,
|
|
136
|
+
parentFolder: props.currentFolder.parentFolder,
|
|
137
|
+
href: props.currentFolderAsLink ? `/projects/${projectsStore.currentProjectId}/folders/${props.currentFolder.id}/workflows` : void 0
|
|
138
|
+
});
|
|
139
|
+
if (projectsStore.currentProjectId) {
|
|
140
|
+
visibleIds.value.add(projectsStore.currentProjectId);
|
|
141
|
+
}
|
|
142
|
+
visibleIds.value.add(props.currentFolder.id);
|
|
143
|
+
return items;
|
|
144
|
+
});
|
|
145
|
+
const fetchHiddenBreadCrumbsItems = async () => {
|
|
146
|
+
if (!projectName.value || !props.currentFolder?.parentFolder || !projectsStore.currentProjectId) {
|
|
147
|
+
hiddenBreadcrumbsItemsAsync.value = Promise.resolve([]);
|
|
148
|
+
} else {
|
|
149
|
+
try {
|
|
150
|
+
const loadedItems = foldersStore.getHiddenBreadcrumbsItems(
|
|
151
|
+
{ id: projectsStore.currentProjectId, name: projectName.value },
|
|
152
|
+
props.currentFolder.parentFolder,
|
|
153
|
+
{ addLinks: true }
|
|
154
|
+
);
|
|
155
|
+
const filtered = (await loadedItems).filter((item) => !visibleIds.value.has(item.id));
|
|
156
|
+
hiddenBreadcrumbsItemsAsync.value = Promise.resolve(filtered);
|
|
157
|
+
} catch (error) {
|
|
158
|
+
hiddenBreadcrumbsItemsAsync.value = Promise.resolve([]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
const onItemSelect = (item) => {
|
|
163
|
+
emit("itemSelected", item);
|
|
164
|
+
};
|
|
165
|
+
const onAction = (action) => {
|
|
166
|
+
emit("action", action);
|
|
167
|
+
};
|
|
168
|
+
const onProjectDrop = () => {
|
|
169
|
+
if (!currentProject.value?.name) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
emit("projectDrop", currentProject.value.id, currentProject.value.name);
|
|
173
|
+
};
|
|
174
|
+
const onProjectHover = () => {
|
|
175
|
+
if (!isDragging.value || !currentProject.value?.name) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
foldersStore.activeDropTarget = {
|
|
179
|
+
type: "project",
|
|
180
|
+
id: currentProject.value?.id,
|
|
181
|
+
name: currentProject.value?.name
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
const onItemHover = (item) => {
|
|
185
|
+
if (!isDragging.value) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
foldersStore.activeDropTarget = {
|
|
189
|
+
type: "folder",
|
|
190
|
+
id: item.id,
|
|
191
|
+
name: item.label
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
watch(
|
|
195
|
+
() => props.currentFolder?.parentFolder,
|
|
196
|
+
() => {
|
|
197
|
+
hiddenBreadcrumbsItemsAsync.value = new Promise(() => {
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
{ immediate: true }
|
|
201
|
+
);
|
|
202
|
+
onBeforeUnmount(() => {
|
|
203
|
+
hiddenBreadcrumbsItemsAsync.value = Promise.resolve([]);
|
|
204
|
+
});
|
|
205
|
+
return (_ctx, _cache) => {
|
|
206
|
+
const _component_ProjectBreadcrumb = __unplugin_components_0$1;
|
|
207
|
+
const _component_n8n_breadcrumbs = resolveComponent("n8n-breadcrumbs");
|
|
208
|
+
const _component_n8n_action_toggle = resolveComponent("n8n-action-toggle");
|
|
209
|
+
return openBlock(), createElementBlock("div", {
|
|
210
|
+
class: normalizeClass({ [_ctx.$style.container]: true, [_ctx.$style["dragging"]]: isDragging.value }),
|
|
211
|
+
"data-test-id": "folder-breadcrumbs"
|
|
212
|
+
}, [
|
|
213
|
+
visibleBreadcrumbsItems.value.length ? (openBlock(), createBlock(_component_n8n_breadcrumbs, {
|
|
214
|
+
key: 0,
|
|
215
|
+
"drag-active": isDragging.value,
|
|
216
|
+
"onUpdate:dragActive": _cache[0] || (_cache[0] = ($event) => isDragging.value = $event),
|
|
217
|
+
items: visibleBreadcrumbsItems.value,
|
|
218
|
+
"highlight-last-item": false,
|
|
219
|
+
"path-truncated": hasMoreItems.value,
|
|
220
|
+
"hidden-items": hasMoreItems.value ? hiddenBreadcrumbsItemsAsync.value : void 0,
|
|
221
|
+
"hidden-items-trigger": props.hiddenItemsTrigger,
|
|
222
|
+
onTooltipOpened: fetchHiddenBreadCrumbsItems,
|
|
223
|
+
onItemSelected: onItemSelect,
|
|
224
|
+
onItemHover,
|
|
225
|
+
onItemDrop: _cache[1] || (_cache[1] = ($event) => emit("itemDrop", $event))
|
|
226
|
+
}, createSlots({
|
|
227
|
+
append: withCtx(() => [
|
|
228
|
+
renderSlot(_ctx.$slots, "append")
|
|
229
|
+
]),
|
|
230
|
+
_: 2
|
|
231
|
+
}, [
|
|
232
|
+
currentProject.value ? {
|
|
233
|
+
name: "prepend",
|
|
234
|
+
fn: withCtx(() => [
|
|
235
|
+
createVNode(_component_ProjectBreadcrumb, {
|
|
236
|
+
"current-project": currentProject.value,
|
|
237
|
+
"is-dragging": isDragging.value,
|
|
238
|
+
onProjectDrop,
|
|
239
|
+
onProjectHover
|
|
240
|
+
}, null, 8, ["current-project", "is-dragging"])
|
|
241
|
+
]),
|
|
242
|
+
key: "0"
|
|
243
|
+
} : void 0
|
|
244
|
+
]), 1032, ["drag-active", "items", "path-truncated", "hidden-items", "hidden-items-trigger"])) : currentProject.value ? (openBlock(), createElementBlock("div", {
|
|
245
|
+
key: 1,
|
|
246
|
+
class: normalizeClass(_ctx.$style["home-project"])
|
|
247
|
+
}, [
|
|
248
|
+
createVNode(_component_ProjectBreadcrumb, {
|
|
249
|
+
"current-project": currentProject.value,
|
|
250
|
+
"is-dragging": isDragging.value,
|
|
251
|
+
onProjectDrop,
|
|
252
|
+
onProjectHover
|
|
253
|
+
}, null, 8, ["current-project", "is-dragging"]),
|
|
254
|
+
renderSlot(_ctx.$slots, "append")
|
|
255
|
+
], 2)) : (openBlock(), createElementBlock("div", _hoisted_1$5, [
|
|
256
|
+
renderSlot(_ctx.$slots, "append")
|
|
257
|
+
])),
|
|
258
|
+
visibleBreadcrumbsItems.value && _ctx.actions?.length ? (openBlock(), createBlock(_component_n8n_action_toggle, {
|
|
259
|
+
key: 3,
|
|
260
|
+
actions: _ctx.actions,
|
|
261
|
+
class: normalizeClass(_ctx.$style["action-toggle"]),
|
|
262
|
+
theme: "dark",
|
|
263
|
+
"data-test-id": "folder-breadcrumbs-actions",
|
|
264
|
+
onAction
|
|
265
|
+
}, null, 8, ["actions", "class"])) : createCommentVNode("", true)
|
|
266
|
+
], 2);
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
const container = "_container_p73tp_123";
|
|
271
|
+
const style0$3 = {
|
|
272
|
+
container,
|
|
273
|
+
"home-project": "_home-project_p73tp_128",
|
|
274
|
+
"action-toggle": "_action-toggle_p73tp_133"
|
|
275
|
+
};
|
|
276
|
+
const cssModules$3 = {
|
|
277
|
+
"$style": style0$3
|
|
278
|
+
};
|
|
279
|
+
const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__cssModules", cssModules$3]]);
|
|
280
|
+
const _hoisted_1$4 = ["data-value"];
|
|
281
|
+
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
282
|
+
__name: "ExpandableInputBase",
|
|
283
|
+
props: {
|
|
284
|
+
modelValue: {},
|
|
285
|
+
placeholder: { default: "" },
|
|
286
|
+
staticSize: { type: Boolean, default: false }
|
|
287
|
+
},
|
|
288
|
+
setup(__props) {
|
|
289
|
+
const props = __props;
|
|
290
|
+
const hiddenValue = computed(() => {
|
|
291
|
+
let value = props.modelValue.replace(/\s/g, ".");
|
|
292
|
+
if (!value) {
|
|
293
|
+
value = props.placeholder;
|
|
294
|
+
}
|
|
295
|
+
return `${value}`;
|
|
296
|
+
});
|
|
297
|
+
return (_ctx, _cache) => {
|
|
298
|
+
return openBlock(), createElementBlock("div", {
|
|
299
|
+
class: normalizeClass({ "el-input": true, "static-size": _ctx.staticSize }),
|
|
300
|
+
"data-value": hiddenValue.value
|
|
301
|
+
}, [
|
|
302
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
303
|
+
], 10, _hoisted_1$4);
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
const ExpandableInputBase = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ad1faf14"]]);
|
|
308
|
+
const _hoisted_1$3 = ["value", "placeholder", "maxlength"];
|
|
309
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
310
|
+
__name: "ExpandableInputEdit",
|
|
311
|
+
props: {
|
|
312
|
+
modelValue: {},
|
|
313
|
+
placeholder: {},
|
|
314
|
+
maxlength: {},
|
|
315
|
+
autofocus: { type: Boolean },
|
|
316
|
+
eventBus: {}
|
|
317
|
+
},
|
|
318
|
+
emits: ["update:model-value", "enter", "blur", "esc"],
|
|
319
|
+
setup(__props, { emit: __emit }) {
|
|
320
|
+
const props = __props;
|
|
321
|
+
const emit = __emit;
|
|
322
|
+
const inputRef = ref();
|
|
323
|
+
onMounted(() => {
|
|
324
|
+
if (props.autofocus && inputRef.value) {
|
|
325
|
+
focus();
|
|
326
|
+
}
|
|
327
|
+
props.eventBus?.on("focus", focus);
|
|
328
|
+
});
|
|
329
|
+
onBeforeUnmount(() => {
|
|
330
|
+
props.eventBus?.off("focus", focus);
|
|
331
|
+
});
|
|
332
|
+
function focus() {
|
|
333
|
+
if (inputRef.value) {
|
|
334
|
+
inputRef.value.focus();
|
|
335
|
+
inputRef.value.select();
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function onInput() {
|
|
339
|
+
if (inputRef.value) {
|
|
340
|
+
emit("update:model-value", inputRef.value.value);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
function onEnter() {
|
|
344
|
+
if (inputRef.value) {
|
|
345
|
+
emit("enter", inputRef.value.value);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
onClickOutside(inputRef, () => {
|
|
349
|
+
if (inputRef.value) {
|
|
350
|
+
emit("blur", inputRef.value.value);
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
function onEscape() {
|
|
354
|
+
emit("esc");
|
|
355
|
+
}
|
|
356
|
+
return (_ctx, _cache) => {
|
|
357
|
+
return openBlock(), createBlock(ExpandableInputBase, {
|
|
358
|
+
"model-value": _ctx.modelValue,
|
|
359
|
+
placeholder: _ctx.placeholder
|
|
360
|
+
}, {
|
|
361
|
+
default: withCtx(() => [
|
|
362
|
+
createBaseVNode("input", {
|
|
363
|
+
ref_key: "inputRef",
|
|
364
|
+
ref: inputRef,
|
|
365
|
+
class: normalizeClass(["el-input__inner", _ctx.$style.input]),
|
|
366
|
+
value: _ctx.modelValue,
|
|
367
|
+
placeholder: _ctx.placeholder,
|
|
368
|
+
maxlength: _ctx.maxlength,
|
|
369
|
+
size: "4",
|
|
370
|
+
onInput,
|
|
371
|
+
onKeydown: [
|
|
372
|
+
withKeys(onEnter, ["enter"]),
|
|
373
|
+
withKeys(onEscape, ["esc"])
|
|
374
|
+
]
|
|
375
|
+
}, null, 42, _hoisted_1$3)
|
|
376
|
+
]),
|
|
377
|
+
_: 1
|
|
378
|
+
}, 8, ["model-value", "placeholder"]);
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
const input = "_input_em4po_123";
|
|
383
|
+
const style0$2 = {
|
|
384
|
+
input
|
|
385
|
+
};
|
|
386
|
+
const cssModules$2 = {
|
|
387
|
+
"$style": style0$2
|
|
388
|
+
};
|
|
389
|
+
const ExpandableInputEdit = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__cssModules", cssModules$2]]);
|
|
390
|
+
const _hoisted_1$2 = ["value"];
|
|
391
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
392
|
+
__name: "ExpandableInputPreview",
|
|
393
|
+
props: {
|
|
394
|
+
modelValue: {}
|
|
395
|
+
},
|
|
396
|
+
setup(__props) {
|
|
397
|
+
return (_ctx, _cache) => {
|
|
398
|
+
return openBlock(), createBlock(ExpandableInputBase, {
|
|
399
|
+
"model-value": _ctx.modelValue,
|
|
400
|
+
"static-size": true
|
|
401
|
+
}, {
|
|
402
|
+
default: withCtx(() => [
|
|
403
|
+
createBaseVNode("input", {
|
|
404
|
+
class: "clickable preview",
|
|
405
|
+
value: _ctx.modelValue,
|
|
406
|
+
disabled: true,
|
|
407
|
+
size: "4"
|
|
408
|
+
}, null, 8, _hoisted_1$2)
|
|
409
|
+
]),
|
|
410
|
+
_: 1
|
|
411
|
+
}, 8, ["model-value"]);
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
const ExpandableInputPreview = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-7df19a7a"]]);
|
|
416
|
+
const _hoisted_1$1 = { key: 0 };
|
|
417
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
418
|
+
__name: "InlineTextEdit",
|
|
419
|
+
props: {
|
|
420
|
+
isEditEnabled: { type: Boolean, default: false },
|
|
421
|
+
modelValue: { default: "" },
|
|
422
|
+
placeholder: { default: "" },
|
|
423
|
+
maxLength: { default: 0 },
|
|
424
|
+
previewValue: { default: "" },
|
|
425
|
+
disabled: { type: Boolean, default: false }
|
|
426
|
+
},
|
|
427
|
+
emits: ["toggle", "submit"],
|
|
428
|
+
setup(__props, { emit: __emit }) {
|
|
429
|
+
const props = __props;
|
|
430
|
+
const emit = __emit;
|
|
431
|
+
const isDisabled = ref(props.disabled);
|
|
432
|
+
const newValue = ref("");
|
|
433
|
+
const escPressed = ref(false);
|
|
434
|
+
const inputBus = ref(createEventBus());
|
|
435
|
+
watch(
|
|
436
|
+
() => props.disabled,
|
|
437
|
+
(value) => {
|
|
438
|
+
isDisabled.value = value;
|
|
439
|
+
}
|
|
440
|
+
);
|
|
441
|
+
watch(
|
|
442
|
+
() => props.modelValue,
|
|
443
|
+
(value) => {
|
|
444
|
+
if (isDisabled.value) return;
|
|
445
|
+
newValue.value = value;
|
|
446
|
+
},
|
|
447
|
+
{ immediate: true }
|
|
448
|
+
);
|
|
449
|
+
function onInput(val) {
|
|
450
|
+
if (isDisabled.value) return;
|
|
451
|
+
newValue.value = val;
|
|
452
|
+
}
|
|
453
|
+
function onClick() {
|
|
454
|
+
if (isDisabled.value) return;
|
|
455
|
+
newValue.value = props.modelValue;
|
|
456
|
+
emit("toggle");
|
|
457
|
+
}
|
|
458
|
+
function onBlur() {
|
|
459
|
+
if (isDisabled.value) return;
|
|
460
|
+
if (!escPressed.value) {
|
|
461
|
+
submit();
|
|
462
|
+
}
|
|
463
|
+
escPressed.value = false;
|
|
464
|
+
}
|
|
465
|
+
function submit() {
|
|
466
|
+
if (isDisabled.value) return;
|
|
467
|
+
const onSubmit = (updated) => {
|
|
468
|
+
isDisabled.value = false;
|
|
469
|
+
if (!updated) {
|
|
470
|
+
inputBus.value.emit("focus");
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
isDisabled.value = true;
|
|
474
|
+
emit("submit", { name: newValue.value, onSubmit });
|
|
475
|
+
}
|
|
476
|
+
function onEscape() {
|
|
477
|
+
if (isDisabled.value) return;
|
|
478
|
+
escPressed.value = true;
|
|
479
|
+
emit("toggle");
|
|
480
|
+
}
|
|
481
|
+
return (_ctx, _cache) => {
|
|
482
|
+
return openBlock(), createElementBlock("span", {
|
|
483
|
+
class: normalizeClass(_ctx.$style["inline-edit"]),
|
|
484
|
+
onKeydown: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
485
|
+
}, ["stop"]))
|
|
486
|
+
}, [
|
|
487
|
+
_ctx.isEditEnabled && !isDisabled.value ? (openBlock(), createElementBlock("span", _hoisted_1$1, [
|
|
488
|
+
createVNode(ExpandableInputEdit, {
|
|
489
|
+
modelValue: newValue.value,
|
|
490
|
+
"onUpdate:modelValue": [
|
|
491
|
+
_cache[0] || (_cache[0] = ($event) => newValue.value = $event),
|
|
492
|
+
onInput
|
|
493
|
+
],
|
|
494
|
+
placeholder: _ctx.placeholder,
|
|
495
|
+
maxlength: _ctx.maxLength,
|
|
496
|
+
autofocus: true,
|
|
497
|
+
"event-bus": inputBus.value,
|
|
498
|
+
"data-test-id": "inline-edit-input",
|
|
499
|
+
onEsc: onEscape,
|
|
500
|
+
onBlur,
|
|
501
|
+
onEnter: submit
|
|
502
|
+
}, null, 8, ["modelValue", "placeholder", "maxlength", "event-bus"])
|
|
503
|
+
])) : (openBlock(), createElementBlock("span", {
|
|
504
|
+
key: 1,
|
|
505
|
+
class: normalizeClass(_ctx.$style.preview),
|
|
506
|
+
onClick
|
|
507
|
+
}, [
|
|
508
|
+
createVNode(ExpandableInputPreview, {
|
|
509
|
+
"model-value": _ctx.previewValue || _ctx.modelValue
|
|
510
|
+
}, null, 8, ["model-value"])
|
|
511
|
+
], 2))
|
|
512
|
+
], 34);
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
const preview = "_preview_c4gkz_134";
|
|
517
|
+
const style0$1 = {
|
|
518
|
+
"inline-edit": "_inline-edit_c4gkz_124",
|
|
519
|
+
preview
|
|
520
|
+
};
|
|
521
|
+
const cssModules$1 = {
|
|
522
|
+
"$style": style0$1
|
|
523
|
+
};
|
|
524
|
+
const InlineTextEdit = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__cssModules", cssModules$1]]);
|
|
525
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
526
|
+
__name: "WorkflowActivationErrorMessage",
|
|
527
|
+
props: {
|
|
528
|
+
message: {}
|
|
529
|
+
},
|
|
530
|
+
setup(__props) {
|
|
531
|
+
const i18n = useI18n();
|
|
532
|
+
return (_ctx, _cache) => {
|
|
533
|
+
return openBlock(), createElementBlock("div", null, [
|
|
534
|
+
createTextVNode(toDisplayString(unref(i18n).baseText(
|
|
535
|
+
"workflowActivator.showMessage.displayActivationError.message.errorDataNotUndefined"
|
|
536
|
+
)) + " ", 1),
|
|
537
|
+
_cache[0] || (_cache[0] = createBaseVNode("br", null, null, -1)),
|
|
538
|
+
createBaseVNode("i", null, toDisplayString(_ctx.message), 1)
|
|
539
|
+
]);
|
|
540
|
+
};
|
|
541
|
+
}
|
|
542
|
+
});
|
|
543
|
+
const _hoisted_1 = { class: "workflow-activator" };
|
|
544
|
+
const _hoisted_2 = {
|
|
545
|
+
key: 0,
|
|
546
|
+
class: "could-not-be-started"
|
|
547
|
+
};
|
|
548
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
549
|
+
__name: "WorkflowActivator",
|
|
550
|
+
props: {
|
|
551
|
+
workflowActive: { type: Boolean },
|
|
552
|
+
workflowId: {},
|
|
553
|
+
workflowPermissions: {}
|
|
554
|
+
},
|
|
555
|
+
emits: ["update:workflowActive"],
|
|
556
|
+
setup(__props, { emit: __emit }) {
|
|
557
|
+
const props = __props;
|
|
558
|
+
const emit = __emit;
|
|
559
|
+
const { showMessage } = useToast();
|
|
560
|
+
const workflowActivate = useWorkflowActivate();
|
|
561
|
+
const uiStore = useUIStore();
|
|
562
|
+
const router = useRouter();
|
|
563
|
+
const workflowHelpers = useWorkflowHelpers({ router });
|
|
564
|
+
const i18n = useI18n();
|
|
565
|
+
const workflowsStore = useWorkflowsStore();
|
|
566
|
+
const credentialsStore = useCredentialsStore();
|
|
567
|
+
const isWorkflowActive = computed(() => {
|
|
568
|
+
const activeWorkflows = workflowsStore.activeWorkflows;
|
|
569
|
+
return activeWorkflows.includes(props.workflowId);
|
|
570
|
+
});
|
|
571
|
+
const couldNotBeStarted = computed(() => {
|
|
572
|
+
return props.workflowActive && isWorkflowActive.value !== props.workflowActive;
|
|
573
|
+
});
|
|
574
|
+
const getActiveColor = computed(() => {
|
|
575
|
+
if (couldNotBeStarted.value) {
|
|
576
|
+
return "#ff4949";
|
|
577
|
+
}
|
|
578
|
+
return "#13ce66";
|
|
579
|
+
});
|
|
580
|
+
const isCurrentWorkflow = computed(() => {
|
|
581
|
+
return workflowsStore.workflowId === props.workflowId;
|
|
582
|
+
});
|
|
583
|
+
const foundTriggers = computed(
|
|
584
|
+
() => getActivatableTriggerNodes(workflowsStore.workflowTriggerNodes)
|
|
585
|
+
);
|
|
586
|
+
const containsTrigger = computed(() => {
|
|
587
|
+
return foundTriggers.value.length > 0;
|
|
588
|
+
});
|
|
589
|
+
const containsOnlyExecuteWorkflowTrigger = computed(() => {
|
|
590
|
+
const foundActiveTriggers = workflowsStore.workflowTriggerNodes.filter(
|
|
591
|
+
(trigger) => !trigger.disabled
|
|
592
|
+
);
|
|
593
|
+
const foundTriggers2 = foundActiveTriggers.filter(
|
|
594
|
+
(trigger) => trigger.type === EXECUTE_WORKFLOW_TRIGGER_NODE_TYPE
|
|
595
|
+
);
|
|
596
|
+
return foundTriggers2.length > 0 && foundTriggers2.length === foundActiveTriggers.length;
|
|
597
|
+
});
|
|
598
|
+
const isNewWorkflow = computed(
|
|
599
|
+
() => !props.workflowId || props.workflowId === PLACEHOLDER_EMPTY_WORKFLOW_ID || props.workflowId === "new"
|
|
600
|
+
);
|
|
601
|
+
const disabled = computed(() => {
|
|
602
|
+
if (isNewWorkflow.value || isCurrentWorkflow.value) {
|
|
603
|
+
return !props.workflowActive && !containsTrigger.value;
|
|
604
|
+
}
|
|
605
|
+
return false;
|
|
606
|
+
});
|
|
607
|
+
function findManagedOpenAiCredentialId(usedCredentials) {
|
|
608
|
+
return Object.keys(usedCredentials).find((credentialId) => {
|
|
609
|
+
const credential = credentialsStore.state.credentials[credentialId];
|
|
610
|
+
return credential.isManaged && credential.type === OPEN_AI_API_CREDENTIAL_TYPE;
|
|
611
|
+
});
|
|
612
|
+
}
|
|
613
|
+
function hasActiveNodeUsingCredential(nodes, credentialId) {
|
|
614
|
+
return nodes.some(
|
|
615
|
+
(node) => node?.credentials?.[OPEN_AI_API_CREDENTIAL_TYPE]?.id === credentialId && !node.disabled
|
|
616
|
+
);
|
|
617
|
+
}
|
|
618
|
+
const shouldShowFreeAiCreditsWarning = computed(() => {
|
|
619
|
+
const usedCredentials = workflowsStore?.usedCredentials;
|
|
620
|
+
if (!usedCredentials) return false;
|
|
621
|
+
const managedOpenAiCredentialId = findManagedOpenAiCredentialId(usedCredentials);
|
|
622
|
+
if (!managedOpenAiCredentialId) return false;
|
|
623
|
+
return hasActiveNodeUsingCredential(workflowsStore.allNodes, managedOpenAiCredentialId);
|
|
624
|
+
});
|
|
625
|
+
async function activeChanged(newActiveState) {
|
|
626
|
+
if (!isWorkflowActive.value) {
|
|
627
|
+
const conflictData = await workflowHelpers.checkConflictingWebhooks(props.workflowId);
|
|
628
|
+
if (conflictData) {
|
|
629
|
+
const { trigger, conflict } = conflictData;
|
|
630
|
+
const conflictingWorkflow = await workflowsStore.fetchWorkflow(conflict.workflowId);
|
|
631
|
+
uiStore.openModalWithData({
|
|
632
|
+
name: WORKFLOW_ACTIVATION_CONFLICTING_WEBHOOK_MODAL_KEY,
|
|
633
|
+
data: {
|
|
634
|
+
triggerName: trigger.name,
|
|
635
|
+
workflowName: conflictingWorkflow.name,
|
|
636
|
+
...conflict
|
|
637
|
+
}
|
|
638
|
+
});
|
|
639
|
+
return;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
const newState = await workflowActivate.updateWorkflowActivation(
|
|
643
|
+
props.workflowId,
|
|
644
|
+
newActiveState
|
|
645
|
+
);
|
|
646
|
+
emit("update:workflowActive", { id: props.workflowId, active: newState });
|
|
647
|
+
}
|
|
648
|
+
async function displayActivationError() {
|
|
649
|
+
let errorMessage;
|
|
650
|
+
try {
|
|
651
|
+
const errorData = await workflowsStore.getActivationError(props.workflowId);
|
|
652
|
+
if (errorData === void 0) {
|
|
653
|
+
errorMessage = i18n.baseText(
|
|
654
|
+
"workflowActivator.showMessage.displayActivationError.message.errorDataUndefined"
|
|
655
|
+
);
|
|
656
|
+
} else {
|
|
657
|
+
errorMessage = h(_sfc_main$1, {
|
|
658
|
+
message: errorData
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
} catch (error) {
|
|
662
|
+
errorMessage = i18n.baseText(
|
|
663
|
+
"workflowActivator.showMessage.displayActivationError.message.catchBlock"
|
|
664
|
+
);
|
|
665
|
+
}
|
|
666
|
+
showMessage({
|
|
667
|
+
title: i18n.baseText("workflowActivator.showMessage.displayActivationError.title"),
|
|
668
|
+
message: errorMessage,
|
|
669
|
+
type: "warning",
|
|
670
|
+
duration: 0
|
|
671
|
+
});
|
|
672
|
+
}
|
|
673
|
+
watch(
|
|
674
|
+
() => props.workflowActive,
|
|
675
|
+
(workflowActive) => {
|
|
676
|
+
if (workflowActive && shouldShowFreeAiCreditsWarning.value) {
|
|
677
|
+
showMessage({
|
|
678
|
+
title: i18n.baseText("freeAi.credits.showWarning.workflow.activation.title"),
|
|
679
|
+
message: i18n.baseText("freeAi.credits.showWarning.workflow.activation.description"),
|
|
680
|
+
type: "warning",
|
|
681
|
+
duration: 0
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
);
|
|
686
|
+
return (_ctx, _cache) => {
|
|
687
|
+
const _component_n8n_text = resolveComponent("n8n-text");
|
|
688
|
+
const _component_el_switch = resolveComponent("el-switch");
|
|
689
|
+
const _component_n8n_tooltip = resolveComponent("n8n-tooltip");
|
|
690
|
+
const _component_font_awesome_icon = resolveComponent("font-awesome-icon");
|
|
691
|
+
const _directive_loading = resolveDirective("loading");
|
|
692
|
+
const _directive_n8n_html = resolveDirective("n8n-html");
|
|
693
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
694
|
+
createBaseVNode("div", {
|
|
695
|
+
class: normalizeClass(_ctx.$style.activeStatusText),
|
|
696
|
+
"data-test-id": "workflow-activator-status"
|
|
697
|
+
}, [
|
|
698
|
+
_ctx.workflowActive ? (openBlock(), createBlock(_component_n8n_text, {
|
|
699
|
+
key: 0,
|
|
700
|
+
color: couldNotBeStarted.value ? "danger" : "success",
|
|
701
|
+
size: "small",
|
|
702
|
+
bold: ""
|
|
703
|
+
}, {
|
|
704
|
+
default: withCtx(() => [
|
|
705
|
+
createTextVNode(toDisplayString(unref(i18n).baseText("workflowActivator.active")), 1)
|
|
706
|
+
]),
|
|
707
|
+
_: 1
|
|
708
|
+
}, 8, ["color"])) : (openBlock(), createBlock(_component_n8n_text, {
|
|
709
|
+
key: 1,
|
|
710
|
+
color: "text-base",
|
|
711
|
+
size: "small",
|
|
712
|
+
bold: ""
|
|
713
|
+
}, {
|
|
714
|
+
default: withCtx(() => [
|
|
715
|
+
createTextVNode(toDisplayString(unref(i18n).baseText("workflowActivator.inactive")), 1)
|
|
716
|
+
]),
|
|
717
|
+
_: 1
|
|
718
|
+
}))
|
|
719
|
+
], 2),
|
|
720
|
+
createVNode(_component_n8n_tooltip, {
|
|
721
|
+
disabled: !disabled.value,
|
|
722
|
+
placement: "bottom"
|
|
723
|
+
}, {
|
|
724
|
+
content: withCtx(() => [
|
|
725
|
+
createBaseVNode("div", null, toDisplayString(unref(i18n).baseText(
|
|
726
|
+
containsOnlyExecuteWorkflowTrigger.value ? "workflowActivator.thisWorkflowHasOnlyOneExecuteWorkflowTriggerNode" : "workflowActivator.thisWorkflowHasNoTriggerNodes"
|
|
727
|
+
)), 1)
|
|
728
|
+
]),
|
|
729
|
+
default: withCtx(() => [
|
|
730
|
+
withDirectives(createVNode(_component_el_switch, {
|
|
731
|
+
"model-value": _ctx.workflowActive,
|
|
732
|
+
title: _ctx.workflowActive ? unref(i18n).baseText("workflowActivator.deactivateWorkflow") : unref(i18n).baseText("workflowActivator.activateWorkflow"),
|
|
733
|
+
disabled: disabled.value || unref(workflowActivate).updatingWorkflowActivation.value || !isNewWorkflow.value && !_ctx.workflowPermissions.update,
|
|
734
|
+
"active-color": getActiveColor.value,
|
|
735
|
+
"inactive-color": "#8899AA",
|
|
736
|
+
"data-test-id": "workflow-activate-switch",
|
|
737
|
+
"onUpdate:modelValue": activeChanged
|
|
738
|
+
}, null, 8, ["model-value", "title", "disabled", "active-color"]), [
|
|
739
|
+
[_directive_loading, unref(workflowActivate).updatingWorkflowActivation.value]
|
|
740
|
+
])
|
|
741
|
+
]),
|
|
742
|
+
_: 1
|
|
743
|
+
}, 8, ["disabled"]),
|
|
744
|
+
couldNotBeStarted.value ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
745
|
+
createVNode(_component_n8n_tooltip, { placement: "top" }, {
|
|
746
|
+
content: withCtx(() => [
|
|
747
|
+
withDirectives(createBaseVNode("div", { onClick: displayActivationError }, null, 512), [
|
|
748
|
+
[_directive_n8n_html, unref(i18n).baseText("workflowActivator.theWorkflowIsSetToBeActiveBut")]
|
|
749
|
+
])
|
|
750
|
+
]),
|
|
751
|
+
default: withCtx(() => [
|
|
752
|
+
createVNode(_component_font_awesome_icon, {
|
|
753
|
+
icon: "exclamation-triangle",
|
|
754
|
+
onClick: displayActivationError
|
|
755
|
+
})
|
|
756
|
+
]),
|
|
757
|
+
_: 1
|
|
758
|
+
})
|
|
759
|
+
])) : createCommentVNode("", true)
|
|
760
|
+
]);
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
});
|
|
764
|
+
const activeStatusText = "_activeStatusText_13o3x_123";
|
|
765
|
+
const style0 = {
|
|
766
|
+
activeStatusText
|
|
767
|
+
};
|
|
768
|
+
const cssModules = {
|
|
769
|
+
"$style": style0
|
|
770
|
+
};
|
|
771
|
+
const WorkflowActivator = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules], ["__scopeId", "data-v-ed59adfa"]]);
|
|
772
|
+
export {
|
|
773
|
+
InlineTextEdit as I,
|
|
774
|
+
WorkflowActivator as W,
|
|
775
|
+
__unplugin_components_0 as _
|
|
776
|
+
};
|