n8n-editor-ui 1.68.0 → 1.68.1

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.
Files changed (79) hide show
  1. package/dist/assets/{AuthView-C7b2xzS9.js → AuthView-CVb7TJSd.js} +1 -1
  2. package/dist/assets/{CanvasChat-QctJb8ta.js → CanvasChat-BMk9MWgs.js} +2 -2
  3. package/dist/assets/{CanvasControls-raoYims4.js → CanvasControls-Yk4_XYJQ.js} +1 -1
  4. package/dist/assets/{ChangePasswordView-BBju88Nm.js → ChangePasswordView-DNdHigRi.js} +2 -2
  5. package/dist/assets/CollectionParameter-D41BcLWH.js +4 -0
  6. package/dist/assets/{CredentialsView-BfYXjOVw.js → CredentialsView-J-xOpbpA.js} +4 -4
  7. package/dist/assets/{ErrorView-BhPrjw7c.js → ErrorView-BtsxZO1X.js} +1 -1
  8. package/dist/assets/{ExecutionsTime.vue_vue_type_script_setup_true_lang-Ba-at9rw.js → ExecutionsTime.vue_vue_type_script_setup_true_lang-CyuSP3Dh.js} +2 -2
  9. package/dist/assets/{ExecutionsView-Dcw07XZ-.js → ExecutionsView-C2Rb4ZWz.js} +5 -5
  10. package/dist/assets/{FileSaver.min-CKlTVpWB.js → FileSaver.min-BjmMGbea.js} +1 -1
  11. package/dist/assets/{FixedCollectionParameter-CkI6mCZG.js → FixedCollectionParameter-VmYo3PL-.js} +1 -1
  12. package/dist/assets/{ForgotMyPasswordView--eKPrTSW.js → ForgotMyPasswordView-D0oUoVQk.js} +2 -2
  13. package/dist/assets/{MainHeader-Btek9DoL.js → MainHeader-CRLrXCio.js} +8 -8
  14. package/dist/assets/{MainSidebar-CRjg4yDv.js → MainSidebar-CPGBmQ2h.js} +2 -2
  15. package/dist/assets/{NodeCreation-CDpNw3BL.js → NodeCreation-DP-aW4g1.js} +4 -4
  16. package/dist/assets/{NodeCreator-DPpQXLHf.js → NodeCreator-Dr6gHEkB.js} +11 -11
  17. package/dist/assets/{NodeViewSwitcher-CNfOOUof.js → NodeViewSwitcher-Bg192dfN.js} +18 -18
  18. package/dist/assets/{ProjectCardBadge-DzaTsr93.js → ProjectCardBadge-CMY_LIZA.js} +1 -1
  19. package/dist/assets/{ProjectHeader-wdvHJxbT.js → ProjectHeader-Bb0FunlL.js} +1 -1
  20. package/dist/assets/{ProjectSettings-B6j0VJK5.js → ProjectSettings-Luijz21w.js} +2 -2
  21. package/dist/assets/{PushConnectionTracker.vue_vue_type_script_setup_true_lang-ByoMju5L.js → PushConnectionTracker.vue_vue_type_script_setup_true_lang-BsYnH5Dp.js} +1 -1
  22. package/dist/assets/{ResourcesListLayout-9Vpyt6Ec.js → ResourcesListLayout-DkU4cwHh.js} +1 -1
  23. package/dist/assets/{RunDataJson-sPhT7c2h.js → RunDataJson-DC2cn20i.js} +12 -12
  24. package/dist/assets/{RunDataJsonActions-DiMvLis_.js → RunDataJsonActions-Bn0kkV0k.js} +2 -2
  25. package/dist/assets/{RunDataSearch-CF_rpBKx.js → RunDataSearch-Ba2DqjJd.js} +1 -1
  26. package/dist/assets/{RunDataTable-T52TXUHR.js → RunDataTable-B5dCfxC7.js} +1 -1
  27. package/dist/assets/{SamlOnboarding-BCn53xtf.js → SamlOnboarding-DX6vYyJJ.js} +2 -2
  28. package/dist/assets/{SettingsApiView-DumvK072.js → SettingsApiView-B1U3DPus.js} +1 -1
  29. package/dist/assets/{SettingsCommunityNodesView-Db787Jar.js → SettingsCommunityNodesView-DDT90Pg5.js} +3 -3
  30. package/dist/assets/{SettingsExternalSecrets-DKB2o2Dq.js → SettingsExternalSecrets-B7yrrkIB.js} +1 -1
  31. package/dist/assets/{SettingsLdapView-BoKoCT5V.js → SettingsLdapView-BUpGsV_P.js} +1 -1
  32. package/dist/assets/{SettingsLogStreamingView-BGX39Unz.js → SettingsLogStreamingView-D2DSI-Lv.js} +1 -1
  33. package/dist/assets/{SettingsPersonalView-fTCeSJfu.js → SettingsPersonalView-OmmJuXrb.js} +1 -1
  34. package/dist/assets/{SettingsSourceControl-_G83P363.js → SettingsSourceControl-C0dSjfRG.js} +1 -1
  35. package/dist/assets/{SettingsSso-Bn48qAiX.js → SettingsSso-DaWZ5LEZ.js} +1 -1
  36. package/dist/assets/{SettingsUsageAndPlan-DZkS0RP4.js → SettingsUsageAndPlan-BSHhZ_dW.js} +1 -1
  37. package/dist/assets/{SettingsUsersView-BUh2iKEW.js → SettingsUsersView-DHGG452i.js} +1 -1
  38. package/dist/assets/{SettingsView-D_S4x7XG.js → SettingsView-CxnuEPNL.js} +1 -1
  39. package/dist/assets/{SetupView-BenKVU0l.js → SetupView-DqjzpwwU.js} +2 -2
  40. package/dist/assets/{SetupWorkflowCredentialsButton-DKr9ZPLE.js → SetupWorkflowCredentialsButton-DPwPtU12.js} +1 -1
  41. package/dist/assets/{SetupWorkflowFromTemplateView-Ce1R_CDh.js → SetupWorkflowFromTemplateView-DJJROuu3.js} +3 -3
  42. package/dist/assets/{SigninView-xl5aJqka.js → SigninView-BVFtq-2J.js} +2 -2
  43. package/dist/assets/{SignoutView-Bscz6u1Y.js → SignoutView-gby6UeGY.js} +1 -1
  44. package/dist/assets/{SignupView-CZN8EhJV.js → SignupView-BWAaJlGd.js} +2 -2
  45. package/dist/assets/{TemplateDetails-BAQ3vBNJ.js → TemplateDetails-Bfs2kkws.js} +1 -1
  46. package/dist/assets/{TemplateList-DD7sqnpI.js → TemplateList-BS2Fw__b.js} +1 -1
  47. package/dist/assets/{TemplatesCollectionView-CG3ZoY8i.js → TemplatesCollectionView-Rli1bmvV.js} +5 -5
  48. package/dist/assets/{TemplatesSearchView-22jrqI8X.js → TemplatesSearchView-BNrgIFb5.js} +3 -3
  49. package/dist/assets/{TemplatesView-BZFc4hZ1.js → TemplatesView-B5ZVm_dO.js} +1 -1
  50. package/dist/assets/{TemplatesWorkflowView-DkXtdhUJ.js → TemplatesWorkflowView-B3PrX47Z.js} +5 -5
  51. package/dist/assets/{VariablesView-DHu4ZoMN.js → VariablesView-Cni61oK7.js} +2 -2
  52. package/dist/assets/WorkerView-CVk9_v-i.js +787 -0
  53. package/dist/assets/WorkerView-C_d54L0W.css +181 -0
  54. package/dist/assets/{WorkflowActivator-CvdQVEtW.js → WorkflowActivator-DpNfU8S2.js} +2 -2
  55. package/dist/assets/{WorkflowExecutionsInfoAccordion-D2GFnpq1.js → WorkflowExecutionsInfoAccordion-CvdeOIyp.js} +1 -1
  56. package/dist/assets/{WorkflowExecutionsLandingPage-D2bvAsxg.js → WorkflowExecutionsLandingPage-D92KorlC.js} +2 -2
  57. package/dist/assets/{WorkflowExecutionsPreview-D6WBsbAG.js → WorkflowExecutionsPreview-C3X1cQ2N.js} +5 -5
  58. package/dist/assets/{WorkflowExecutionsView-DI6r5OvZ.js → WorkflowExecutionsView-CRUra874.js} +5 -5
  59. package/dist/assets/{WorkflowHistory-Dc1f2Tsn.js → WorkflowHistory-Cxm0Fasa.js} +3 -3
  60. package/dist/assets/{WorkflowOnboardingView-DyxvWfZ7.js → WorkflowOnboardingView-Chk-ANFv.js} +1 -1
  61. package/dist/assets/{WorkflowPreview-hC6wSe-Y.js → WorkflowPreview-Ds6TtYEJ.js} +1 -1
  62. package/dist/assets/{WorkflowsView-SIDgO47b.js → WorkflowsView-BkOCTGrW.js} +6 -6
  63. package/dist/assets/{dateFormatter-BRi2wSZ-.js → dateFormatter-DbqvzAoe.js} +1 -1
  64. package/dist/assets/{index-40I5DMGP.js → index-KRTOiXIE.js} +303 -297
  65. package/dist/assets/{index-Dr3zFZlC.css → index-r43k-wiC.css} +90 -89
  66. package/dist/assets/{pushConnection.store-w_WxpOeH.js → pushConnection.store-BaeC9SL1.js} +1 -1
  67. package/dist/assets/{templateActions-D4EHdA9n.js → templateActions-C6LE7tmr.js} +1 -1
  68. package/dist/assets/{useBugReporting-CFOQlQpP.js → useBugReporting-DAqKvmOS.js} +1 -1
  69. package/dist/assets/{useExecutionDebugging-LQQWXhPj.js → useExecutionDebugging-B5hEDeUo.js} +1 -1
  70. package/dist/assets/{useExecutionHelpers-CXGl_HIp.js → useExecutionHelpers-BnMndkLB.js} +2 -2
  71. package/dist/assets/{useNodeViewVersionSwitcher-BLo5Qp-N.js → useNodeViewVersionSwitcher-DPTYc7jG.js} +1 -1
  72. package/dist/assets/{usePushConnection-B5ija5f5.js → usePushConnection-DtjYN_M-.js} +3 -2
  73. package/dist/assets/{useRunWorkflow-MrEKURG4.js → useRunWorkflow-3NXGqc8M.js} +1 -1
  74. package/dist/assets/{useWorkflowActivate-CKedJlgZ.js → useWorkflowActivate-DP_90b8S.js} +1 -1
  75. package/dist/index.html +2 -2
  76. package/package.json +1 -1
  77. package/dist/assets/CollectionParameter-DNJAimAt.js +0 -4
  78. package/dist/assets/WorkerView-BfxdQiAc.js +0 -148
  79. package/dist/assets/WorkerView-Dm0b18Mh.css +0 -22
@@ -0,0 +1,787 @@
1
+ import { _ as _sfc_main$7 } from "./PushConnectionTracker.vue_vue_type_script_setup_true_lang-BsYnH5Dp.js";
2
+ import { d as defineComponent, r as ref, l as resolveComponent, c as openBlock, h as createElementBlock, j as createBaseVNode, i as createVNode, w as withCtx, q as renderSlot, n as normalizeClass, f as createCommentVNode, _ as _export_sfc, e as createBlock, k as createTextVNode, t as toDisplayString, F as Fragment, z as renderList, aZ as useClipboard, a as useToast, g as useI18n, cL as shallowRef, o as onMounted, v as onBeforeUnmount, H as watch, cR as toRaw, aq as h, cc as isProxy, j8 as Chart$1, A as unref, p as computed, aG as sortByProperty, b as useRouter, a3 as useDocumentTitle, Z as useRootStore, av as onBeforeMount, ak as useTelemetry, m as useSettingsStore, a5 as usePageRedirectionHelper } from "./index-KRTOiXIE.js";
3
+ import { a as useOrchestrationStore, W as WORKER_HISTORY_LENGTH, u as usePushConnection } from "./usePushConnection-DtjYN_M-.js";
4
+ import { u as usePushConnectionStore } from "./pushConnection.store-BaeC9SL1.js";
5
+ function averageWorkerLoadFromLoads(loads) {
6
+ return loads.reduce((prev, curr) => prev + curr, 0) / loads.length;
7
+ }
8
+ function averageWorkerLoadFromLoadsAsString(loads) {
9
+ return averageWorkerLoadFromLoads(loads).toFixed(2);
10
+ }
11
+ function memAsGb(mem) {
12
+ return mem / 1024 / 1024 / 1024;
13
+ }
14
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
15
+ __name: "WorkerAccordion.ee",
16
+ props: {
17
+ icon: { default: "tasks" },
18
+ iconColor: { default: "black" },
19
+ initialExpanded: { type: Boolean, default: true }
20
+ },
21
+ setup(__props) {
22
+ const props = __props;
23
+ const expanded2 = ref(props.initialExpanded);
24
+ function toggle() {
25
+ expanded2.value = !expanded2.value;
26
+ }
27
+ return (_ctx, _cache) => {
28
+ const _component_n8n_icon = resolveComponent("n8n-icon");
29
+ const _component_n8n_text = resolveComponent("n8n-text");
30
+ return openBlock(), createElementBlock("div", {
31
+ class: normalizeClass(["accordion", _ctx.$style.container])
32
+ }, [
33
+ createBaseVNode("div", {
34
+ class: normalizeClass({ [_ctx.$style.header]: true, [_ctx.$style.expanded]: expanded2.value }),
35
+ onClick: toggle
36
+ }, [
37
+ createVNode(_component_n8n_icon, {
38
+ icon: _ctx.icon,
39
+ color: _ctx.iconColor,
40
+ size: "small",
41
+ class: "mr-2xs"
42
+ }, null, 8, ["icon", "color"]),
43
+ createVNode(_component_n8n_text, {
44
+ class: normalizeClass(_ctx.$style.headerText),
45
+ color: "text-base",
46
+ size: "small",
47
+ align: "left",
48
+ bold: ""
49
+ }, {
50
+ default: withCtx(() => [
51
+ renderSlot(_ctx.$slots, "title")
52
+ ]),
53
+ _: 3
54
+ }, 8, ["class"]),
55
+ createVNode(_component_n8n_icon, {
56
+ icon: expanded2.value ? "chevron-up" : "chevron-down",
57
+ bold: ""
58
+ }, null, 8, ["icon"])
59
+ ], 2),
60
+ expanded2.value ? (openBlock(), createElementBlock("div", {
61
+ key: 0,
62
+ class: normalizeClass({ [_ctx.$style.description]: true, [_ctx.$style.collapsed]: !expanded2.value })
63
+ }, [
64
+ renderSlot(_ctx.$slots, "content")
65
+ ], 2)) : createCommentVNode("", true)
66
+ ], 2);
67
+ };
68
+ }
69
+ });
70
+ const container$1 = "_container_odamb_1";
71
+ const header = "_header_odamb_5";
72
+ const headerText = "_headerText_odamb_11";
73
+ const expanded = "_expanded_odamb_15";
74
+ const description = "_description_odamb_19";
75
+ const style0$6 = {
76
+ container: container$1,
77
+ header,
78
+ headerText,
79
+ expanded,
80
+ description
81
+ };
82
+ const cssModules$6 = {
83
+ "$style": style0$6
84
+ };
85
+ const WorkerAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__cssModules", cssModules$6]]);
86
+ const _hoisted_1$3 = ["href"];
87
+ const _hoisted_2$1 = ["href"];
88
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
89
+ __name: "WorkerJobAccordion.ee",
90
+ props: {
91
+ items: {}
92
+ },
93
+ setup(__props) {
94
+ const props = __props;
95
+ function runningSince(started) {
96
+ let seconds = Math.floor(((/* @__PURE__ */ new Date()).getTime() - started.getTime()) / 1e3);
97
+ const hrs = Math.floor(seconds / 3600);
98
+ seconds -= hrs * 3600;
99
+ const mnts = Math.floor(seconds / 60);
100
+ seconds -= mnts * 60;
101
+ return `${hrs}h ${mnts}m ${Math.floor(seconds)}s`;
102
+ }
103
+ return (_ctx, _cache) => {
104
+ const _component_n8n_text = resolveComponent("n8n-text");
105
+ return openBlock(), createBlock(WorkerAccordion, {
106
+ icon: "tasks",
107
+ "icon-color": "black",
108
+ "initial-expanded": true
109
+ }, {
110
+ title: withCtx(() => [
111
+ createTextVNode(toDisplayString(_ctx.$locale.baseText("workerList.item.jobListTitle")) + " (" + toDisplayString(_ctx.items.length) + ") ", 1)
112
+ ]),
113
+ content: withCtx(() => [
114
+ props.items.length > 0 ? (openBlock(), createElementBlock("div", {
115
+ key: 0,
116
+ class: normalizeClass(_ctx.$style.accordionItems)
117
+ }, [
118
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
119
+ return openBlock(), createElementBlock("div", {
120
+ key: item.executionId,
121
+ class: normalizeClass(_ctx.$style.accordionItem)
122
+ }, [
123
+ createBaseVNode("a", {
124
+ href: "/workflow/" + item.workflowId + "/executions/" + item.executionId
125
+ }, " Execution " + toDisplayString(item.executionId) + " - " + toDisplayString(item.workflowName), 9, _hoisted_1$3),
126
+ createVNode(_component_n8n_text, {
127
+ color: "text-base",
128
+ size: "small",
129
+ align: "left"
130
+ }, {
131
+ default: withCtx(() => {
132
+ var _a;
133
+ return [
134
+ createTextVNode(" | Started at: " + toDisplayString((_a = new Date(item.startedAt)) == null ? void 0 : _a.toLocaleTimeString()) + " | Running for " + toDisplayString(runningSince(new Date(item.startedAt))) + " " + toDisplayString(item.retryOf ? `| Retry of: ${item.retryOf}` : "") + " | ", 1)
135
+ ];
136
+ }),
137
+ _: 2
138
+ }, 1024),
139
+ createBaseVNode("a", {
140
+ target: "_blank",
141
+ href: "/workflow/" + item.workflowId
142
+ }, " (Open workflow)", 8, _hoisted_2$1)
143
+ ], 2);
144
+ }), 128))
145
+ ], 2)) : (openBlock(), createElementBlock("div", {
146
+ key: 1,
147
+ class: normalizeClass(_ctx.$style.accordionItems)
148
+ }, [
149
+ createBaseVNode("span", {
150
+ class: normalizeClass(_ctx.$style.empty)
151
+ }, toDisplayString(_ctx.$locale.baseText("workerList.item.jobList.empty")), 3)
152
+ ], 2))
153
+ ]),
154
+ _: 1
155
+ });
156
+ };
157
+ }
158
+ });
159
+ const accordionItems$2 = "_accordionItems_kt5sk_1";
160
+ const accordionItem$2 = "_accordionItem_kt5sk_1";
161
+ const empty = "_empty_kt5sk_14";
162
+ const style0$5 = {
163
+ accordionItems: accordionItems$2,
164
+ accordionItem: accordionItem$2,
165
+ empty
166
+ };
167
+ const cssModules$5 = {
168
+ "$style": style0$5
169
+ };
170
+ const WorkerJobAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__cssModules", cssModules$5]]);
171
+ const _hoisted_1$2 = ["onClick"];
172
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
173
+ __name: "WorkerNetAccordion.ee",
174
+ props: {
175
+ items: {}
176
+ },
177
+ setup(__props) {
178
+ const props = __props;
179
+ const i18n = useI18n();
180
+ const clipboard = useClipboard();
181
+ const { showMessage } = useToast();
182
+ function onCopyToClipboard(content) {
183
+ try {
184
+ void clipboard.copy(content);
185
+ showMessage({
186
+ title: i18n.baseText("workerList.item.copyAddressToClipboard"),
187
+ type: "success"
188
+ });
189
+ } catch {
190
+ }
191
+ }
192
+ return (_ctx, _cache) => {
193
+ return openBlock(), createBlock(WorkerAccordion, {
194
+ icon: "tasks",
195
+ "icon-color": "black",
196
+ "initial-expanded": false
197
+ }, {
198
+ title: withCtx(() => [
199
+ createTextVNode(toDisplayString(_ctx.$locale.baseText("workerList.item.netListTitle")) + " (" + toDisplayString(_ctx.items.length) + ") ", 1)
200
+ ]),
201
+ content: withCtx(() => [
202
+ props.items.length > 0 ? (openBlock(), createElementBlock("div", {
203
+ key: 0,
204
+ class: normalizeClass(_ctx.$style.accordionItems)
205
+ }, [
206
+ (openBlock(true), createElementBlock(Fragment, null, renderList(props.items, (item) => {
207
+ return openBlock(), createElementBlock("div", {
208
+ key: item.address,
209
+ class: normalizeClass(_ctx.$style.accordionItem),
210
+ onClick: ($event) => onCopyToClipboard(item.address)
211
+ }, [
212
+ createTextVNode(toDisplayString(item.family) + ": ", 1),
213
+ createBaseVNode("span", {
214
+ class: normalizeClass(_ctx.$style.clickable)
215
+ }, toDisplayString(item.address), 3),
216
+ createTextVNode(" " + toDisplayString(item.internal ? "(internal)" : ""), 1)
217
+ ], 10, _hoisted_1$2);
218
+ }), 128))
219
+ ], 2)) : createCommentVNode("", true)
220
+ ]),
221
+ _: 1
222
+ });
223
+ };
224
+ }
225
+ });
226
+ const accordionItems$1 = "_accordionItems_10xds_1";
227
+ const accordionItem$1 = "_accordionItem_10xds_1";
228
+ const clickable = "_clickable_10xds_15";
229
+ const style0$4 = {
230
+ accordionItems: accordionItems$1,
231
+ accordionItem: accordionItem$1,
232
+ clickable
233
+ };
234
+ const cssModules$4 = {
235
+ "$style": style0$4
236
+ };
237
+ const WorkerNetAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__cssModules", cssModules$4]]);
238
+ const CommonProps = {
239
+ data: {
240
+ type: Object,
241
+ required: true
242
+ },
243
+ options: {
244
+ type: Object,
245
+ default: () => ({})
246
+ },
247
+ plugins: {
248
+ type: Array,
249
+ default: () => []
250
+ },
251
+ datasetIdKey: {
252
+ type: String,
253
+ default: "label"
254
+ },
255
+ updateMode: {
256
+ type: String,
257
+ default: void 0
258
+ }
259
+ };
260
+ const Props = {
261
+ type: {
262
+ type: String,
263
+ required: true
264
+ },
265
+ ...CommonProps
266
+ };
267
+ function toRawIfProxy(obj) {
268
+ return isProxy(obj) ? toRaw(obj) : obj;
269
+ }
270
+ function cloneProxy(obj) {
271
+ let src = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : obj;
272
+ return isProxy(src) ? new Proxy(obj, {}) : obj;
273
+ }
274
+ function setOptions(chart2, nextOptions) {
275
+ const options = chart2.options;
276
+ if (options && nextOptions) {
277
+ Object.assign(options, nextOptions);
278
+ }
279
+ }
280
+ function setLabels(currentData, nextLabels) {
281
+ currentData.labels = nextLabels;
282
+ }
283
+ function setDatasets(currentData, nextDatasets, datasetIdKey) {
284
+ const addedDatasets = [];
285
+ currentData.datasets = nextDatasets.map((nextDataset) => {
286
+ const currentDataset = currentData.datasets.find((dataset) => dataset[datasetIdKey] === nextDataset[datasetIdKey]);
287
+ if (!currentDataset || !nextDataset.data || addedDatasets.includes(currentDataset)) {
288
+ return {
289
+ ...nextDataset
290
+ };
291
+ }
292
+ addedDatasets.push(currentDataset);
293
+ Object.assign(currentDataset, nextDataset);
294
+ return currentDataset;
295
+ });
296
+ }
297
+ function cloneData(data, datasetIdKey) {
298
+ const nextData = {
299
+ labels: [],
300
+ datasets: []
301
+ };
302
+ setLabels(nextData, data.labels);
303
+ setDatasets(nextData, data.datasets, datasetIdKey);
304
+ return nextData;
305
+ }
306
+ const Chart = defineComponent({
307
+ props: Props,
308
+ setup(props, param) {
309
+ let { expose } = param;
310
+ const canvasRef = ref(null);
311
+ const chartRef = shallowRef(null);
312
+ expose({
313
+ chart: chartRef
314
+ });
315
+ const renderChart = () => {
316
+ if (!canvasRef.value) return;
317
+ const { type, data, options, plugins, datasetIdKey } = props;
318
+ const clonedData = cloneData(data, datasetIdKey);
319
+ const proxiedData = cloneProxy(clonedData, data);
320
+ chartRef.value = new Chart$1(canvasRef.value, {
321
+ type,
322
+ data: proxiedData,
323
+ options: {
324
+ ...options
325
+ },
326
+ plugins
327
+ });
328
+ };
329
+ const destroyChart = () => {
330
+ const chart2 = toRaw(chartRef.value);
331
+ if (chart2) {
332
+ chart2.destroy();
333
+ chartRef.value = null;
334
+ }
335
+ };
336
+ const update = (chart2) => {
337
+ chart2.update(props.updateMode);
338
+ };
339
+ onMounted(renderChart);
340
+ onBeforeUnmount(destroyChart);
341
+ watch([
342
+ () => props.options,
343
+ () => props.data
344
+ ], (param2, param1) => {
345
+ let [nextOptionsProxy, nextDataProxy] = param2, [prevOptionsProxy, prevDataProxy] = param1;
346
+ const chart2 = toRaw(chartRef.value);
347
+ if (!chart2) {
348
+ return;
349
+ }
350
+ let shouldUpdate = false;
351
+ if (nextOptionsProxy) {
352
+ const nextOptions = toRawIfProxy(nextOptionsProxy);
353
+ const prevOptions = toRawIfProxy(prevOptionsProxy);
354
+ if (nextOptions && nextOptions !== prevOptions) {
355
+ setOptions(chart2, nextOptions);
356
+ shouldUpdate = true;
357
+ }
358
+ }
359
+ if (nextDataProxy) {
360
+ const nextLabels = toRawIfProxy(nextDataProxy.labels);
361
+ const prevLabels = toRawIfProxy(prevDataProxy.labels);
362
+ const nextDatasets = toRawIfProxy(nextDataProxy.datasets);
363
+ const prevDatasets = toRawIfProxy(prevDataProxy.datasets);
364
+ if (nextLabels !== prevLabels) {
365
+ setLabels(chart2.config.data, nextLabels);
366
+ shouldUpdate = true;
367
+ }
368
+ if (nextDatasets && nextDatasets !== prevDatasets) {
369
+ setDatasets(chart2.config.data, nextDatasets, props.datasetIdKey);
370
+ shouldUpdate = true;
371
+ }
372
+ }
373
+ if (shouldUpdate) {
374
+ update(chart2);
375
+ }
376
+ }, {
377
+ deep: true
378
+ });
379
+ return () => {
380
+ return h("canvas", {
381
+ ref: canvasRef
382
+ });
383
+ };
384
+ }
385
+ });
386
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
387
+ __name: "WorkerChartsAccordion.ee",
388
+ props: {
389
+ workerId: {}
390
+ },
391
+ setup(__props) {
392
+ var _a, _b, _c;
393
+ const props = __props;
394
+ const blankDataSet = (label, color, prefill = 0) => ({
395
+ datasets: [
396
+ {
397
+ label,
398
+ backgroundColor: color,
399
+ data: prefill ? Array(Math.min(WORKER_HISTORY_LENGTH, prefill)).fill(0) : []
400
+ }
401
+ ],
402
+ labels: Array(Math.min(WORKER_HISTORY_LENGTH, prefill)).fill("")
403
+ });
404
+ const orchestrationStore = useOrchestrationStore();
405
+ const chartRefJobs = ref(void 0);
406
+ const chartRefCPU = ref(void 0);
407
+ const chartRefMemory = ref(void 0);
408
+ const optionsBase = () => ({
409
+ responsive: true,
410
+ maintainAspectRatio: true,
411
+ scales: {
412
+ y: {
413
+ type: "linear",
414
+ display: true,
415
+ position: "left",
416
+ min: 0,
417
+ suggestedMax: 5
418
+ }
419
+ }
420
+ // uncomment to disable animation
421
+ // animation: {
422
+ // duration: 0,
423
+ // },
424
+ });
425
+ const optionsJobs = optionsBase();
426
+ const optionsCPU = optionsBase();
427
+ if ((_a = optionsCPU.scales) == null ? void 0 : _a.y) optionsCPU.scales.y.suggestedMax = 100;
428
+ const maxMemory = memAsGb((_b = orchestrationStore.workers[props.workerId]) == null ? void 0 : _b.totalMem) ?? 1;
429
+ const optionsMemory = optionsBase();
430
+ if ((_c = optionsMemory.scales) == null ? void 0 : _c.y) optionsMemory.scales.y.suggestedMax = maxMemory;
431
+ const dataJobs = ref(
432
+ blankDataSet("Job Count", "rgb(255, 111, 92)", WORKER_HISTORY_LENGTH)
433
+ );
434
+ const dataCPU = ref(
435
+ blankDataSet("Processor Usage", "rgb(19, 205, 103)", WORKER_HISTORY_LENGTH)
436
+ );
437
+ const dataMemory = ref(
438
+ blankDataSet("Memory Usage", "rgb(244, 216, 174)", WORKER_HISTORY_LENGTH)
439
+ );
440
+ orchestrationStore.$onAction(({ name, store }) => {
441
+ var _a2, _b2;
442
+ if (name === "updateWorkerStatus") {
443
+ const prefillCount = WORKER_HISTORY_LENGTH - (((_a2 = store.workersHistory[props.workerId]) == null ? void 0 : _a2.length) ?? 0);
444
+ const newDataJobs = blankDataSet("Job Count", "rgb(255, 111, 92)", prefillCount);
445
+ const newDataCPU = blankDataSet(
446
+ "Processor Usage",
447
+ "rgb(19, 205, 103)",
448
+ prefillCount
449
+ );
450
+ const newDataMemory = blankDataSet(
451
+ "Memory Usage",
452
+ "rgb(244, 216, 174)",
453
+ prefillCount
454
+ );
455
+ (_b2 = store.workersHistory[props.workerId]) == null ? void 0 : _b2.forEach((item) => {
456
+ var _a3;
457
+ newDataJobs.datasets[0].data.push(item.data.runningJobsSummary.length);
458
+ (_a3 = newDataJobs.labels) == null ? void 0 : _a3.push(new Date(item.timestamp).toLocaleTimeString());
459
+ newDataCPU.datasets[0].data.push(averageWorkerLoadFromLoads(item.data.loadAvg));
460
+ newDataCPU.labels = newDataJobs.labels;
461
+ newDataMemory.datasets[0].data.push(maxMemory - memAsGb(item.data.freeMem));
462
+ newDataMemory.labels = newDataJobs.labels;
463
+ });
464
+ dataJobs.value = newDataJobs;
465
+ dataCPU.value = newDataCPU;
466
+ dataMemory.value = newDataMemory;
467
+ }
468
+ });
469
+ return (_ctx, _cache) => {
470
+ return openBlock(), createBlock(WorkerAccordion, {
471
+ icon: "tasks",
472
+ "icon-color": "black",
473
+ "initial-expanded": false
474
+ }, {
475
+ title: withCtx(() => [
476
+ createTextVNode(toDisplayString(_ctx.$locale.baseText("workerList.item.chartsTitle")), 1)
477
+ ]),
478
+ content: withCtx(() => [
479
+ createBaseVNode("div", {
480
+ class: normalizeClass(_ctx.$style.charts)
481
+ }, [
482
+ createVNode(unref(Chart), {
483
+ ref_key: "chartRefJobs",
484
+ ref: chartRefJobs,
485
+ type: "line",
486
+ data: dataJobs.value,
487
+ options: unref(optionsJobs),
488
+ class: normalizeClass(_ctx.$style.chart)
489
+ }, null, 8, ["data", "options", "class"]),
490
+ createVNode(unref(Chart), {
491
+ ref_key: "chartRefCPU",
492
+ ref: chartRefCPU,
493
+ type: "line",
494
+ data: dataCPU.value,
495
+ options: unref(optionsCPU),
496
+ class: normalizeClass(_ctx.$style.chart)
497
+ }, null, 8, ["data", "options", "class"]),
498
+ createVNode(unref(Chart), {
499
+ ref_key: "chartRefMemory",
500
+ ref: chartRefMemory,
501
+ type: "line",
502
+ data: dataMemory.value,
503
+ options: unref(optionsMemory),
504
+ class: normalizeClass(_ctx.$style.chart)
505
+ }, null, 8, ["data", "options", "class"])
506
+ ], 2)
507
+ ]),
508
+ _: 1
509
+ });
510
+ };
511
+ }
512
+ });
513
+ const accordionItems = "_accordionItems_2yo1p_1";
514
+ const accordionItem = "_accordionItem_2yo1p_1";
515
+ const charts = "_charts_2yo1p_14";
516
+ const chart = "_chart_2yo1p_14";
517
+ const style0$3 = {
518
+ accordionItems,
519
+ accordionItem,
520
+ charts,
521
+ chart
522
+ };
523
+ const cssModules$3 = {
524
+ "$style": style0$3
525
+ };
526
+ const WorkerChartsAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__cssModules", cssModules$3]]);
527
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
528
+ __name: "WorkerCard.ee",
529
+ props: {
530
+ workerId: {}
531
+ },
532
+ setup(__props) {
533
+ let interval;
534
+ const orchestrationStore = useOrchestrationStore();
535
+ const props = __props;
536
+ const secondsSinceLastUpdateString = ref("0");
537
+ const stale2 = ref(false);
538
+ const worker = computed(() => {
539
+ return orchestrationStore.getWorkerStatus(props.workerId);
540
+ });
541
+ const sortedWorkerInterfaces = computed(
542
+ () => {
543
+ var _a;
544
+ return sortByProperty("family", ((_a = worker.value) == null ? void 0 : _a.interfaces.slice()) ?? []);
545
+ }
546
+ );
547
+ function upTime(seconds) {
548
+ const days = Math.floor(seconds / (3600 * 24));
549
+ seconds -= days * 3600 * 24;
550
+ const hrs = Math.floor(seconds / 3600);
551
+ seconds -= hrs * 3600;
552
+ const mnts = Math.floor(seconds / 60);
553
+ seconds -= mnts * 60;
554
+ return `${days}d ${hrs}h ${mnts}m ${Math.floor(seconds)}s`;
555
+ }
556
+ onMounted(() => {
557
+ interval = setInterval(() => {
558
+ const lastUpdated = orchestrationStore.getWorkerLastUpdated(props.workerId);
559
+ if (!lastUpdated) {
560
+ return;
561
+ }
562
+ const secondsSinceLastUpdate = Math.ceil((Date.now() - lastUpdated) / 1e3);
563
+ stale2.value = secondsSinceLastUpdate > 10;
564
+ secondsSinceLastUpdateString.value = secondsSinceLastUpdate.toFixed(0);
565
+ }, 500);
566
+ });
567
+ onBeforeUnmount(() => {
568
+ clearInterval(interval);
569
+ });
570
+ return (_ctx, _cache) => {
571
+ const _component_n8n_heading = resolveComponent("n8n-heading");
572
+ const _component_n8n_text = resolveComponent("n8n-text");
573
+ const _component_n8n_card = resolveComponent("n8n-card");
574
+ return worker.value ? (openBlock(), createBlock(_component_n8n_card, {
575
+ key: 0,
576
+ class: normalizeClass(_ctx.$style.cardLink)
577
+ }, {
578
+ header: withCtx(() => [
579
+ createVNode(_component_n8n_heading, {
580
+ tag: "h2",
581
+ bold: "",
582
+ class: normalizeClass(stale2.value ? [_ctx.$style.cardHeading, _ctx.$style.stale] : [_ctx.$style.cardHeading]),
583
+ "data-test-id": "worker-card-name"
584
+ }, {
585
+ default: withCtx(() => [
586
+ createTextVNode(" Name: " + toDisplayString(worker.value.senderId) + " (" + toDisplayString(worker.value.hostname) + ") ", 1),
587
+ _cache[0] || (_cache[0] = createBaseVNode("br", null, null, -1)),
588
+ createTextVNode(" Average Load: " + toDisplayString(unref(averageWorkerLoadFromLoadsAsString)(worker.value.loadAvg ?? [0])) + " | Free Memory: " + toDisplayString(unref(memAsGb)(worker.value.freeMem).toFixed(2)) + "GB / " + toDisplayString(unref(memAsGb)(worker.value.totalMem).toFixed(2)) + "GB " + toDisplayString(stale2.value ? " (stale)" : ""), 1)
589
+ ]),
590
+ _: 1
591
+ }, 8, ["class"])
592
+ ]),
593
+ append: withCtx(() => [
594
+ createBaseVNode("div", {
595
+ ref: "cardActions",
596
+ class: normalizeClass(_ctx.$style.cardActions)
597
+ }, null, 2)
598
+ ]),
599
+ default: withCtx(() => [
600
+ createBaseVNode("div", {
601
+ class: normalizeClass(_ctx.$style.cardDescription)
602
+ }, [
603
+ createVNode(_component_n8n_text, {
604
+ color: "text-light",
605
+ size: "small",
606
+ class: normalizeClass(_ctx.$style.container)
607
+ }, {
608
+ default: withCtx(() => [
609
+ createBaseVNode("span", null, toDisplayString(_ctx.$locale.baseText("workerList.item.lastUpdated")) + " " + toDisplayString(secondsSinceLastUpdateString.value) + "s ago | n8n-Version: " + toDisplayString(worker.value.version) + " | Architecture: " + toDisplayString(worker.value.arch) + " ( " + toDisplayString(worker.value.platform) + ") | Uptime: " + toDisplayString(upTime(worker.value.uptime)), 1),
610
+ createVNode(WorkerJobAccordion, {
611
+ items: worker.value.runningJobsSummary
612
+ }, null, 8, ["items"]),
613
+ createVNode(WorkerNetAccordion, { items: sortedWorkerInterfaces.value }, null, 8, ["items"]),
614
+ createVNode(WorkerChartsAccordion, {
615
+ "worker-id": worker.value.senderId
616
+ }, null, 8, ["worker-id"])
617
+ ]),
618
+ _: 1
619
+ }, 8, ["class"])
620
+ ], 2)
621
+ ]),
622
+ _: 1
623
+ }, 8, ["class"])) : createCommentVNode("", true);
624
+ };
625
+ }
626
+ });
627
+ const container = "_container_s5el6_1";
628
+ const cardLink = "_cardLink_s5el6_5";
629
+ const cardHeading = "_cardHeading_s5el6_15";
630
+ const stale = "_stale_s5el6_21";
631
+ const cardDescription = "_cardDescription_s5el6_25";
632
+ const cardActions = "_cardActions_s5el6_32";
633
+ const style0$2 = {
634
+ container,
635
+ cardLink,
636
+ cardHeading,
637
+ stale,
638
+ cardDescription,
639
+ cardActions
640
+ };
641
+ const cssModules$2 = {
642
+ "$style": style0$2
643
+ };
644
+ const WorkerCard = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__cssModules", cssModules$2]]);
645
+ const _hoisted_1$1 = { key: 0 };
646
+ const _hoisted_2 = { key: 1 };
647
+ const _hoisted_3 = { key: 0 };
648
+ const _hoisted_4 = { key: 1 };
649
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
650
+ __name: "WorkerList.ee",
651
+ props: {
652
+ autoRefreshEnabled: { type: Boolean, default: true }
653
+ },
654
+ setup(__props) {
655
+ const router = useRouter();
656
+ const i18n = useI18n();
657
+ const pushConnection = usePushConnection({ router });
658
+ const documentTitle = useDocumentTitle();
659
+ const telemetry = useTelemetry();
660
+ const orchestrationManagerStore = useOrchestrationStore();
661
+ const rootStore = useRootStore();
662
+ const pushStore = usePushConnectionStore();
663
+ const initialStatusReceived = computed(() => orchestrationManagerStore.initialStatusReceived);
664
+ const workerIds = computed(() => Object.keys(orchestrationManagerStore.workers));
665
+ const pageTitle = computed(() => i18n.baseText("workerList.pageTitle"));
666
+ onMounted(() => {
667
+ documentTitle.set(pageTitle.value);
668
+ telemetry.track("User viewed worker view", {
669
+ instance_id: rootStore.instanceId
670
+ });
671
+ });
672
+ onBeforeMount(() => {
673
+ if (window.Cypress !== void 0) {
674
+ return;
675
+ }
676
+ pushConnection.initialize();
677
+ pushStore.pushConnect();
678
+ orchestrationManagerStore.startWorkerStatusPolling();
679
+ });
680
+ onBeforeUnmount(() => {
681
+ if (window.Cypress !== void 0) {
682
+ return;
683
+ }
684
+ orchestrationManagerStore.stopWorkerStatusPolling();
685
+ pushStore.pushDisconnect();
686
+ pushConnection.terminate();
687
+ });
688
+ return (_ctx, _cache) => {
689
+ const _component_PushConnectionTracker = _sfc_main$7;
690
+ const _component_n8n_heading = resolveComponent("n8n-heading");
691
+ const _component_n8n_spinner = resolveComponent("n8n-spinner");
692
+ return openBlock(), createElementBlock("div", null, [
693
+ createVNode(_component_PushConnectionTracker, { class: "actions" }),
694
+ createBaseVNode("div", {
695
+ class: normalizeClass(_ctx.$style.workerListHeader)
696
+ }, [
697
+ createVNode(_component_n8n_heading, {
698
+ tag: "h1",
699
+ size: "2xlarge"
700
+ }, {
701
+ default: withCtx(() => [
702
+ createTextVNode(toDisplayString(pageTitle.value), 1)
703
+ ]),
704
+ _: 1
705
+ })
706
+ ], 2),
707
+ !initialStatusReceived.value ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
708
+ createVNode(_component_n8n_spinner)
709
+ ])) : (openBlock(), createElementBlock("div", _hoisted_2, [
710
+ workerIds.value.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(unref(i18n).baseText("workerList.empty")), 1)) : (openBlock(), createElementBlock("div", _hoisted_4, [
711
+ (openBlock(true), createElementBlock(Fragment, null, renderList(workerIds.value, (workerId) => {
712
+ return openBlock(), createElementBlock("div", {
713
+ key: workerId,
714
+ class: normalizeClass(_ctx.$style.card)
715
+ }, [
716
+ createVNode(WorkerCard, {
717
+ "worker-id": workerId,
718
+ "data-test-id": "worker-card"
719
+ }, null, 8, ["worker-id"])
720
+ ], 2);
721
+ }), 128))
722
+ ]))
723
+ ]))
724
+ ]);
725
+ };
726
+ }
727
+ });
728
+ const workerListHeader = "_workerListHeader_12j1s_1";
729
+ const card = "_card_12j1s_8";
730
+ const tableLoader = "_tableLoader_12j1s_12";
731
+ const style0$1 = {
732
+ workerListHeader,
733
+ card,
734
+ tableLoader
735
+ };
736
+ const cssModules$1 = {
737
+ "$style": style0$1
738
+ };
739
+ const WorkerList = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__cssModules", cssModules$1]]);
740
+ const _hoisted_1 = ["href"];
741
+ const _sfc_main = /* @__PURE__ */ defineComponent({
742
+ __name: "WorkerView",
743
+ setup(__props) {
744
+ const settingsStore = useSettingsStore();
745
+ const pageRedirectionHelper = usePageRedirectionHelper();
746
+ const goToUpgrade = () => {
747
+ void pageRedirectionHelper.goToUpgrade("worker-view", "upgrade-worker-view");
748
+ };
749
+ return (_ctx, _cache) => {
750
+ const _component_n8n_action_box = resolveComponent("n8n-action-box");
751
+ return unref(settingsStore).isQueueModeEnabled && unref(settingsStore).isWorkerViewAvailable ? (openBlock(), createBlock(WorkerList, {
752
+ key: 0,
753
+ "data-test-id": "worker-view-licensed"
754
+ })) : (openBlock(), createBlock(_component_n8n_action_box, {
755
+ key: 1,
756
+ "data-test-id": "worker-view-unlicensed",
757
+ class: normalizeClass(_ctx.$style.actionBox),
758
+ description: _ctx.$locale.baseText("workerList.actionBox.description"),
759
+ "button-text": _ctx.$locale.baseText("workerList.actionBox.buttonText"),
760
+ "onClick:button": goToUpgrade
761
+ }, {
762
+ heading: withCtx(() => [
763
+ createBaseVNode("span", null, toDisplayString(_ctx.$locale.baseText("workerList.actionBox.title")), 1)
764
+ ]),
765
+ description: withCtx(() => [
766
+ createTextVNode(toDisplayString(_ctx.$locale.baseText("workerList.actionBox.description")) + " ", 1),
767
+ createBaseVNode("a", {
768
+ href: _ctx.$locale.baseText("workerList.docs.url"),
769
+ target: "_blank"
770
+ }, toDisplayString(_ctx.$locale.baseText("workerList.actionBox.description.link")), 9, _hoisted_1)
771
+ ]),
772
+ _: 1
773
+ }, 8, ["class", "description", "button-text"]));
774
+ };
775
+ }
776
+ });
777
+ const actionBox = "_actionBox_13ul9_1";
778
+ const style0 = {
779
+ actionBox
780
+ };
781
+ const cssModules = {
782
+ "$style": style0
783
+ };
784
+ const WorkerView = /* @__PURE__ */ _export_sfc(_sfc_main, [["__cssModules", cssModules]]);
785
+ export {
786
+ WorkerView as default
787
+ };