@atom8n/n8n-editor-ui 2.2.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/.stylelintcache +1 -0
- package/README.md +59 -0
- package/biome.jsonc +8 -0
- package/build.log +55 -0
- package/data/node-popularity.json +3998 -0
- package/dist/assets/AddDataTableModal-UINkk54_.js +1555 -0
- package/dist/assets/AgentEditorModal-CVww87TJ.js +358 -0
- package/dist/assets/Alert-Dy86dyOr.js +102 -0
- package/dist/assets/AnimatedSpinner-DmPN4poP.js +15 -0
- package/dist/assets/AnnotationTagsDropdown.ee-BJ7N9lek.js +71 -0
- package/dist/assets/AuthView-D2LWHrMp.js +106 -0
- package/dist/assets/BottomMenu-CIQiK_dJ.js +532 -0
- package/dist/assets/CalendarDate-DgQUMbNo.js +875 -0
- package/dist/assets/ChangePasswordView-Z6tUkw0u.js +133 -0
- package/dist/assets/ChatAgentAvatar-50YBnv3N.js +67 -0
- package/dist/assets/ChatFile-xZxmc2nV.js +146 -0
- package/dist/assets/ChatLayout-CTE_5SiM.js +96 -0
- package/dist/assets/ChatPersonalAgentsView-BGpHk03K.js +149 -0
- package/dist/assets/ChatSidebar-BkVwIypC.js +528 -0
- package/dist/assets/ChatView-BbbdeU9x.js +1559 -0
- package/dist/assets/ChatWorkflowAgentsView-BtunOxlC.js +116 -0
- package/dist/assets/CollectionParameter-BdcPG1lu.js +52 -0
- package/dist/assets/CommitMonoVariable-ytizKI8U.woff2 +0 -0
- package/dist/assets/CommunityNodeUpdateInfo-C37kca4W.js +273 -0
- package/dist/assets/CopyInput-DDZVu2iU.js +74 -0
- package/dist/assets/CredentialIcon-8YdTTFZ1.js +80 -0
- package/dist/assets/CredentialPicker-DWtj314o.js +293 -0
- package/dist/assets/CredentialSelectorModal-DTW2fKh0.js +138 -0
- package/dist/assets/CredentialsView-BjUchcCu.js +480 -0
- package/dist/assets/DataTableActions-DpAkoxg_.js +95 -0
- package/dist/assets/DataTableDetailsView-Coq7zdW5.js +41922 -0
- package/dist/assets/DataTableView-Cs-BIkzw.js +293 -0
- package/dist/assets/DemoFooter-Cga3jvi-.js +65 -0
- package/dist/assets/Draggable-vfvXl9Sp.js +105 -0
- package/dist/assets/EmptySharedSectionActionBox-DOXZtTCv.js +36 -0
- package/dist/assets/EnterpriseEdition.ee-D_rCFexM.js +15 -0
- package/dist/assets/EntityNotFound-3dhTRWsE.js +85 -0
- package/dist/assets/EntityUnAuthorised-ChJYZakE.js +66 -0
- package/dist/assets/ErrorView-zT9cX76a.js +61 -0
- package/dist/assets/EvaluationsRootView-C-OVWYnY.js +523 -0
- package/dist/assets/EvaluationsView-CJwJTruc.js +469 -0
- package/dist/assets/ExecutionsTime-DEQiyozR.js +573 -0
- package/dist/assets/ExecutionsView-Bd5Oh8TH.js +791 -0
- package/dist/assets/ExternalSecretsProviderConnectionSwitch.ee-C7Ih-uRo.js +191 -0
- package/dist/assets/FixedCollectionParameter-CYuTDW9t.js +496 -0
- package/dist/assets/ForgotMyPasswordView-Bs_L9P27.js +102 -0
- package/dist/assets/InsightsChartAverageRuntime-Bp3VA8_7.js +62 -0
- package/dist/assets/InsightsChartFailed-KPaNWoEr.js +52 -0
- package/dist/assets/InsightsChartFailureRate-DE6kE3FM.js +54 -0
- package/dist/assets/InsightsChartTimeSaved-auABNZlc.js +68 -0
- package/dist/assets/InsightsChartTotal-BKzYRKE7.js +56 -0
- package/dist/assets/InsightsDashboard-JWx4W6Db.js +473 -0
- package/dist/assets/InsightsPaywall-C8zLLKe8.js +63 -0
- package/dist/assets/InsightsSummary-cmN1lHDm.js +210 -0
- package/dist/assets/InsightsTableWorkflows-CqcC3IbQ.js +203 -0
- package/dist/assets/InterVariable-DiVDrmQJ.woff2 +0 -0
- package/dist/assets/InterVariable-Italic-FCBEiFp6.woff2 +0 -0
- package/dist/assets/ItemsRenderer-DC8WVyMv.js +922 -0
- package/dist/assets/KeyboardShortcutTooltip-D8PAK5JP.js +31 -0
- package/dist/assets/LogsPanel-BR06u9RK.js +52 -0
- package/dist/assets/LogsPanel-C-_acMHp.js +2325 -0
- package/dist/assets/MCPConnectWorkflowsModal-3g8_iUa4.js +303 -0
- package/dist/assets/MainHeader-DiQc1edn.js +2153 -0
- package/dist/assets/MainSidebar-CoPGG5Ea.js +804 -0
- package/dist/assets/MigrationRuleDetail-BAxk1Pvl.js +295 -0
- package/dist/assets/MigrationRules-IW9lZMpE.js +285 -0
- package/dist/assets/Modal-CIzXlZdZ.js +204 -0
- package/dist/assets/ModelByIdSelectorModal-DLvBjzJO.js +115 -0
- package/dist/assets/NDVEmptyState-33UoX00I.js +19743 -0
- package/dist/assets/NodeCreation-BNzbSWSB.js +240 -0
- package/dist/assets/NodeCreator-BftgCKx7.js +1288 -0
- package/dist/assets/NodeDetailsView-CsoQCpcF.js +1075 -0
- package/dist/assets/NodeDetailsViewV2-C_wNQR_3.js +981 -0
- package/dist/assets/NodeIcon-B9VW6tX6.js +87 -0
- package/dist/assets/NodeSettings-ZwVip6VR.js +1872 -0
- package/dist/assets/NodeView-D4WUEvLB.js +2452 -0
- package/dist/assets/OAuthConsentView-DlrUqZbT.js +230 -0
- package/dist/assets/PageViewLayout-NT1KPFgy.js +12 -0
- package/dist/assets/ParameterInputList-sG2nz-Jo.js +38091 -0
- package/dist/assets/PrebuiltAgentTemplatesView-Csi5U8dc.js +154 -0
- package/dist/assets/ProjectBreadcrumb-C_XiY7sc.js +98 -0
- package/dist/assets/ProjectCardBadge-t_hs7vzx.js +209 -0
- package/dist/assets/ProjectHeader-Dq5Ihb26.js +549 -0
- package/dist/assets/ProjectIcon-DY8gGuHX.js +64 -0
- package/dist/assets/ProjectRoleView-Du-KTrAC.js +435 -0
- package/dist/assets/ProjectRolesView-DjxM_y4u.js +239 -0
- package/dist/assets/ProjectSettings-C6kWuV21.js +966 -0
- package/dist/assets/ProjectSharing-CVUgNWAY.js +262 -0
- package/dist/assets/ProjectVariables-CJlAo3dv.js +467 -0
- package/dist/assets/ProviderSettingsModal-BUFC2ZLv.js +307 -0
- package/dist/assets/PushConnectionTracker-DPBnGV0v.js +27 -0
- package/dist/assets/ResolversView-3BdkvvYA.js +209 -0
- package/dist/assets/ResourceFiltersDropdown-dgyXpcEX.js +159 -0
- package/dist/assets/ResourcesListLayout-qBLtomK6.js +631 -0
- package/dist/assets/RunDataHtml-BrW0OQra.js +7 -0
- package/dist/assets/RunDataHtml-Cleia4Cj.js +40 -0
- package/dist/assets/RunDataJson-uxkrhYRK.js +227 -0
- package/dist/assets/RunDataJsonActions-DkPk7E8d.js +5007 -0
- package/dist/assets/RunDataParsedAiContent-CtPRjig-.js +26 -0
- package/dist/assets/RunDataParsedAiContent-WAuqLQ5M.js +192 -0
- package/dist/assets/RunDataSearch-YBWUr93C.js +141 -0
- package/dist/assets/RunDataTable-DcXaBynW.js +631 -0
- package/dist/assets/SamlOnboarding-BTdQ_hr3.js +78 -0
- package/dist/assets/SaveButton-D5sQSxIk.js +89 -0
- package/dist/assets/SelectedItemsInfo-BHZ-NvF5.js +58 -0
- package/dist/assets/SettingsApiView-IfZTMXx1.js +313 -0
- package/dist/assets/SettingsChatHubView-gWh2X6vX.js +285 -0
- package/dist/assets/SettingsCommunityNodesView-D8VQtpGY.js +349 -0
- package/dist/assets/SettingsExternalSecrets-CpMc7mkW.js +233 -0
- package/dist/assets/SettingsLdapView-CU5a2MAy.js +2553 -0
- package/dist/assets/SettingsLogStreamingView-uojTe-oX.js +375 -0
- package/dist/assets/SettingsMCPView-B5Swp1C_.js +1214 -0
- package/dist/assets/SettingsPersonalView-Cr3aGood.js +402 -0
- package/dist/assets/SettingsSourceControl-DXOvFDEY.js +547 -0
- package/dist/assets/SettingsSso-27MfU1HV.js +1032 -0
- package/dist/assets/SettingsUsageAndPlan-DqIO-G46.js +419 -0
- package/dist/assets/SettingsUsersView-DfHB4_Kh.js +833 -0
- package/dist/assets/SettingsView-C4sA7Uny.js +90 -0
- package/dist/assets/SetupTemplateFormStep-BmiSzZin.js +258 -0
- package/dist/assets/SetupView-VORZ-L_u.js +112 -0
- package/dist/assets/SetupWorkflowCredentialsButton-DTmkOAW5.js +73 -0
- package/dist/assets/SetupWorkflowFromTemplateView-B9NupdJE.js +286 -0
- package/dist/assets/SeverityTag-CX1qTTNA.js +45 -0
- package/dist/assets/SigninView-D9_Pm16j.js +358 -0
- package/dist/assets/SignoutView-BFsjEAGz.js +19 -0
- package/dist/assets/SignupView-Am4ot0QZ.js +137 -0
- package/dist/assets/SkeletonAgentCard-C5TL-h8F.js +191 -0
- package/dist/assets/TagsDropdown-Bvx_Hd6Q.js +230 -0
- package/dist/assets/TemplateCard-CyQ1GuVz.js +105 -0
- package/dist/assets/TemplateDetails-CZRusTxE.js +124 -0
- package/dist/assets/TemplateList-DKvbwuiY.js +333 -0
- package/dist/assets/TemplatesCollectionView-D8dxU8By.js +184 -0
- package/dist/assets/TemplatesSearchView-CebC_GLs.js +1230 -0
- package/dist/assets/TemplatesView-025CcmIY.js +57 -0
- package/dist/assets/TemplatesWorkflowView-C2JfwJAn.js +170 -0
- package/dist/assets/TestRunDetailView-Ck78TTWO.js +395 -0
- package/dist/assets/TextWithHighlights-BxumwGnv.js +57 -0
- package/dist/assets/TimeAgo-C6EN4lCs.js +123 -0
- package/dist/assets/ToolsSelectorModal-8QJoUvRL.js +368 -0
- package/dist/assets/TriggerPanel-B6pacLkk.js +1225 -0
- package/dist/assets/VirtualSchema-B3zGe_8b.js +2402 -0
- package/dist/assets/VirtualSchema-Dkh0Cu5z.js +37 -0
- package/dist/assets/VueMarkdown-CQqJL9vK.js +28 -0
- package/dist/assets/WorkerView-Caznsljo.js +563 -0
- package/dist/assets/WorkflowActivationErrorMessage-CGrfPi9O.js +17 -0
- package/dist/assets/WorkflowActivator-BINnz0f7.js +362 -0
- package/dist/assets/WorkflowExecutionsInfoAccordion-Dg37yEfT.js +166 -0
- package/dist/assets/WorkflowExecutionsLandingPage-V2wdubhK.js +93 -0
- package/dist/assets/WorkflowExecutionsPreview-DdJaqYV6.js +616 -0
- package/dist/assets/WorkflowExecutionsView-DV8ySTfn.js +808 -0
- package/dist/assets/WorkflowHistory-GtaBMzIM.js +973 -0
- package/dist/assets/WorkflowLocation-CQ9Sq-2y.js +164 -0
- package/dist/assets/WorkflowOnboardingView-C49gt0Jr.js +61 -0
- package/dist/assets/WorkflowPreview-CXdvv4Nq.js +186 -0
- package/dist/assets/WorkflowTagsDropdown-QwbICWjN.js +71 -0
- package/dist/assets/WorkflowsView-B-MWIECO.js +3253 -0
- package/dist/assets/_MapCache-CcdIl4Ae.js +363 -0
- package/dist/assets/_baseOrderBy-N8Be_6z6.js +2989 -0
- package/dist/assets/_initCloneObject-viQQyT6o.js +80 -0
- package/dist/assets/_plugin-vue_export-helper-BwBpWJRZ.js +6 -0
- package/dist/assets/aiTemplatesStarterCollection.store-nL9nePkK.js +656 -0
- package/dist/assets/apiKeys.store-BhOFmP2j.js +51 -0
- package/dist/assets/assistant.store-CNywgN4S.js +518 -0
- package/dist/assets/auth.eventBus-CWXS0Qp7.js +5 -0
- package/dist/assets/banners.store-CGEcBTDn.js +195 -0
- package/dist/assets/builder.store-Czk2ipDE.js +31417 -0
- package/dist/assets/buttons.esm-yintpW2E.js +364 -0
- package/dist/assets/chart-CNvyywtJ.js +10958 -0
- package/dist/assets/chartjs.utils-BAE52Cv9.js +155 -0
- package/dist/assets/chat.store-290YeyrQ.js +865 -0
- package/dist/assets/chatPanel.store-NDaawEZL.js +118 -0
- package/dist/assets/chunk-6z4oVpB-.js +36 -0
- package/dist/assets/col-Cmt4cmuS.js +158 -0
- package/dist/assets/constants-C8OH4tTq.js +106256 -0
- package/dist/assets/constants-DMrsrpD7.js +32 -0
- package/dist/assets/core-B9gt_4yk.js +4 -0
- package/dist/assets/core-CP5FY4aX.js +1202 -0
- package/dist/assets/core-CRbPymLT.js +9741 -0
- package/dist/assets/dataTable.store-DmipQsol.js +207 -0
- package/dist/assets/date-picker-2IDsBs2n.js +4115 -0
- package/dist/assets/dateFormatter-ik4-9_9r.js +33 -0
- package/dist/assets/dateformat-hG8NERse.js +181 -0
- package/dist/assets/dialog-lMho1TD8.js +425 -0
- package/dist/assets/dist-Cw46Is-h.js +151 -0
- package/dist/assets/doppler-B__k0MeW.webp +0 -0
- package/dist/assets/element-icons-B-tDfklg.woff +0 -0
- package/dist/assets/element-icons-_lZGOqcG.ttf +0 -0
- package/dist/assets/empty-BuGRxzl4.js +2210 -0
- package/dist/assets/en-CF30SCh2.js +95 -0
- package/dist/assets/en-DyO2pPiC.js +2 -0
- package/dist/assets/es-BkUFJVtD.js +43338 -0
- package/dist/assets/evaluation.constants-GYAwmJnh.js +284 -0
- package/dist/assets/executions.store-B9uRYwgv.js +205 -0
- package/dist/assets/exports-Crx_gvt_.js +1799 -0
- package/dist/assets/externalSecrets.ee.store-BJh4a_6G.js +118 -0
- package/dist/assets/fileUtils-CRWqOQje.js +20 -0
- package/dist/assets/folders.store-yAFj-5Vl.js +235 -0
- package/dist/assets/get-BcEmeOxn.js +2781 -0
- package/dist/assets/index-SL8542zQ.js +28372 -0
- package/dist/assets/insights.constants-BkJCYJTL.js +55 -0
- package/dist/assets/insights.store-BFc3kDUo.js +61 -0
- package/dist/assets/insights.utils-CcLXdrrz.js +77 -0
- package/dist/assets/isEmpty-C3XXoHqJ.js +35216 -0
- package/dist/assets/languageModules-9LyndCqU.js +13862 -0
- package/dist/assets/logStreaming.store-IZhWe_VK.js +190 -0
- package/dist/assets/mcp.constants-_Jcn7fPq.js +10 -0
- package/dist/assets/mcp.store-B9yfcAN9.js +116 -0
- package/dist/assets/merge-DhuTk1HM.js +564 -0
- package/dist/assets/nodeCreator.store-Bpnrwp2l.js +5444 -0
- package/dist/assets/nodeIcon-D6X-ENYt.js +102 -0
- package/dist/assets/nodeTransforms-RzcOM0v2.js +42 -0
- package/dist/assets/orderBy-Cu9F9DU_.js +15 -0
- package/dist/assets/path-browserify-RUt2u7iT.js +328 -0
- package/dist/assets/personalizedTemplatesV3.store-BGYp0YBN.js +334 -0
- package/dist/assets/pickBy-UI0Jt4wC.js +18 -0
- package/dist/assets/preload-helper-dyVz7ck7.js +59 -0
- package/dist/assets/radio-CSce3UT0.js +262 -0
- package/dist/assets/readyToRun.store-YEMvPUqo.js +626 -0
- package/dist/assets/readyToRunWorkflows.store-G3srgIze.js +1319 -0
- package/dist/assets/retry-BgHaYzbB.js +23 -0
- package/dist/assets/roles.store-CRf_zJTb.js +51 -0
- package/dist/assets/router-DNpzz3GH.js +2631 -0
- package/dist/assets/sanitize-html-CbW56HUN.js +10758 -0
- package/dist/assets/schemaPreview.store-DUgN1yVE.js +113 -0
- package/dist/assets/semver-Bk6DGseV.js +1306 -0
- package/dist/assets/smartDecimal-DAZl4HKA.js +6 -0
- package/dist/assets/sortByProperty-Cn7iGKYu.js +8 -0
- package/dist/assets/sourceControl.eventBus-D47xXSc_.js +3 -0
- package/dist/assets/sqlite3-DBpDb1lf.wasm +0 -0
- package/dist/assets/sqlite3-opfs-async-proxy-vVtmDGHX.js +461 -0
- package/dist/assets/sqlite3-worker1-bundler-friendly-DLarOZDL.js +9405 -0
- package/dist/assets/src-jviYSG25.js +55454 -0
- package/dist/assets/sso.store-DyApJwhx.js +139 -0
- package/dist/assets/style-E3CrYFV8.css +111829 -0
- package/dist/assets/table-we1DjFMV.js +3944 -0
- package/dist/assets/templateActions-bEDSARw2.js +65 -0
- package/dist/assets/templateTransforms-BHWiRbtR.js +43 -0
- package/dist/assets/truncate-C0KYt7i3.js +4176 -0
- package/dist/assets/typescript.worker-CYqLvLHh.js +152048 -0
- package/dist/assets/uniqBy-xDyuCRP0.js +10 -0
- package/dist/assets/usage.store-CU5J_nGm.js +100 -0
- package/dist/assets/useActions-B1JckIRj.js +255 -0
- package/dist/assets/useBeforeUnload-DiDkvI8p.js +40 -0
- package/dist/assets/useCanvasMapping-BXT7rGhC.js +12570 -0
- package/dist/assets/useCanvasOperations-8ULLtMkY.js +1765 -0
- package/dist/assets/useClipboard-DvjhVHqJ.js +39 -0
- package/dist/assets/useCommandBar-C4tLJbKt.js +2425 -0
- package/dist/assets/useCredentialResolvers-BKeFGJnY.js +78 -0
- package/dist/assets/useCustomAgent-DpILEt5e.js +471 -0
- package/dist/assets/useDebounce-Br5_1ug-.js +147 -0
- package/dist/assets/useExecutionData-M5iKsX6z.js +23 -0
- package/dist/assets/useExecutionDebugging-8azMzbnd.js +191 -0
- package/dist/assets/useExecutionHelpers-BgRRhpBM.js +91 -0
- package/dist/assets/useImportCurlCommand-CKiEmX5P.js +8891 -0
- package/dist/assets/useIntersectionObserver-BWMwOueh.js +33 -0
- package/dist/assets/useKeybindings-B2jfN6rd.js +62 -0
- package/dist/assets/useLogsTreeExpand-sZViUfdM.js +843 -0
- package/dist/assets/useMcp-DoMOIfqT.js +27 -0
- package/dist/assets/usePageRedirectionHelper-DjkznpX6.js +51 -0
- package/dist/assets/usePinnedData-BhZkqttf.js +203 -0
- package/dist/assets/usePushConnection-DMS-F_IW.js +513 -0
- package/dist/assets/useRecentResources-BVORr7eM.js +118 -0
- package/dist/assets/useRunWorkflow-LO7ffLp9.js +950 -0
- package/dist/assets/useSettingsItems-BhZXwMZn.js +144 -0
- package/dist/assets/useTelemetryContext-V6bv4YRq.js +34 -0
- package/dist/assets/useWorkflowActivate-DeSmDXjI.js +152 -0
- package/dist/assets/useWorkflowsCache-DtcEEAIR.js +179 -0
- package/dist/assets/userRoleProvisioning.store-kkSIdeTo.js +33 -0
- package/dist/assets/utils-DI7dLldp.js +54 -0
- package/dist/assets/versions.store-B1z2OrLE.js +191 -0
- package/dist/assets/vue-CydWIhxN.js +4378 -0
- package/dist/assets/vue-json-pretty-CsGX66mG.js +1130 -0
- package/dist/assets/vue.runtime.esm-bundler-tP5dCd7J.js +7325 -0
- package/dist/assets/xml-B_oj6Mle.js +2060 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +157 -0
- package/dist/static/base-path.js +1 -0
- package/dist/static/community_package_tooltip_img.png +0 -0
- package/dist/static/data-mapping-gif.gif +0 -0
- package/dist/static/form-grey.svg +1 -0
- package/dist/static/google-auth/disabled.dark.png +0 -0
- package/dist/static/google-auth/disabled.png +0 -0
- package/dist/static/google-auth/focus.dark.png +0 -0
- package/dist/static/google-auth/focus.png +0 -0
- package/dist/static/google-auth/normal.dark.png +0 -0
- package/dist/static/google-auth/normal.png +0 -0
- package/dist/static/google-auth/pressed.dark.png +0 -0
- package/dist/static/google-auth/pressed.png +0 -0
- package/dist/static/n8n-logo.png +0 -0
- package/dist/static/og_image.png +0 -0
- package/dist/static/open-ai.svg +1 -0
- package/dist/static/openChat.png +0 -0
- package/dist/static/posthog.init.js +41 -0
- package/dist/static/prefers-color-scheme.css +5 -0
- package/dist/static/webhook-icon.svg +1 -0
- package/dist/tree-sitter-bash.wasm +0 -0
- package/dist/tree-sitter.wasm +0 -0
- package/eslint.config.mjs +59 -0
- package/index.html +45 -0
- package/index.js +0 -0
- package/package.json +147 -0
- package/postcss.config.cjs +6 -0
- package/scripts/fetch-node-popularity.mjs +102 -0
- package/stylelint.config.mjs +9 -0
- package/tailwind.config.js +8 -0
- package/tsconfig.json +36 -0
- package/vite/i18n-locales-hmr-helpers.ts +19 -0
- package/vite/source-map-js-shim.ts +1 -0
- package/vite/vite-plugin-node-popularity.mts +32 -0
- package/vite.config.mts +304 -0
|
@@ -0,0 +1,2325 @@
|
|
|
1
|
+
import { o as __toESM } from "./chunk-6z4oVpB-.js";
|
|
2
|
+
import { C as computed, Cn as toDisplayString, D as createElementBlock, E as createCommentVNode, G as nextTick, Gt as unref, Ht as toRefs, I as guardReactiveProps, It as ref, J as onBeforeUnmount, M as createVNode, Nt as onScopeDispose, P as defineComponent, Q as onUnmounted, T as createBlock, Vt as toRef, W as mergeProps, Z as onMounted, _ as Fragment, _t as watch, at as renderSlot, bn as normalizeStyle, bt as withCtx, ct as resolveDynamicComponent, et as openBlock, f as vModelText, h as withModifiers, it as renderList, j as createTextVNode, jt as isRef, k as createSlots, m as withKeys, mt as useTemplateRef, nt as provide, st as resolveDirective, ut as useAttrs, vn as normalizeClass, w as createBaseVNode, xt as withDirectives, yn as normalizeProps, z as inject, zt as shallowRef } from "./vue.runtime.esm-bundler-tP5dCd7J.js";
|
|
3
|
+
import { E as useTimestamp, g as useFileDialog, it as I18nT, o as useActiveElement, rt as useI18n, v as useLocalStorage } from "./core-CRbPymLT.js";
|
|
4
|
+
import { C as N8nResizeWrapper_default, Cn as N8nIcon_default, T as N8nRadioButtons_default, bn as N8nText_default, gt as require_markdown_it_link_attributes, ht as N8nTooltip_default, mt as N8nLink_default, ot as N8nActionDropdown_default, wt as useProvideTooltipAppendTo, xn as N8nButton_default, xt as N8nIconButton_default } from "./src-jviYSG25.js";
|
|
5
|
+
import { t as __plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BwBpWJRZ.js";
|
|
6
|
+
import { Kn as useNodeHelpers, N as useNDVStore, Nt as waitingNodeTooltip, P as useWorkflowsStore, Pt as useNodeTypesStore, Qn as useSourceControlStore, St as isChatNode, Xn as useDocumentTitle, _r as useCanvasStore, aa as useUIStore, h as useMessage, k as useTelemetry, pn as require_upperFirst, qn as injectWorkflowState, us as v4_default, w as getScrollbarWidth, y as useToast } from "./builder.store-Czk2ipDE.js";
|
|
7
|
+
import { _ as useRoute, v as useRouter } from "./get-BcEmeOxn.js";
|
|
8
|
+
import { Ro as VIEWS, ec as PopOutWindowKey, rs as MODAL_CONFIRM } from "./constants-C8OH4tTq.js";
|
|
9
|
+
import { r as useRootStore } from "./_baseOrderBy-N8Be_6z6.js";
|
|
10
|
+
import { n as ndvEventBus } from "./assistant.store-CNywgN4S.js";
|
|
11
|
+
import { t as useRunWorkflow } from "./useRunWorkflow-LO7ffLp9.js";
|
|
12
|
+
import { t as usePinnedData } from "./usePinnedData-BhZkqttf.js";
|
|
13
|
+
import { t as useClipboard } from "./useClipboard-DvjhVHqJ.js";
|
|
14
|
+
import { a as useLogsStore, c as LOCAL_STORAGE_PANEL_WIDTH, d as chatEventBus, i as useExperimentalNdvStore, l as LOGS_PANEL_STATE, o as LOCAL_STORAGE_OVERVIEW_PANEL_WIDTH, r as canvasEventBus, s as LOCAL_STORAGE_PANEL_HEIGHT, t as useCanvasOperations, u as LOG_DETAILS_PANEL_STATE } from "./useCanvasOperations-8ULLtMkY.js";
|
|
15
|
+
import { t as NodeIcon_default } from "./NodeIcon-B9VW6tX6.js";
|
|
16
|
+
import { t as KeyboardShortcutTooltip_default } from "./KeyboardShortcutTooltip-D8PAK5JP.js";
|
|
17
|
+
import { n as RunData_default, r as RunDataItemCount_default } from "./isEmpty-C3XXoHqJ.js";
|
|
18
|
+
import { t as NDVEmptyState_default } from "./NDVEmptyState-33UoX00I.js";
|
|
19
|
+
import { t as VueMarkdown_default } from "./VueMarkdown-CQqJL9vK.js";
|
|
20
|
+
import { t as useKeybindings } from "./useKeybindings-B2jfN6rd.js";
|
|
21
|
+
import { t as convertFileToBinaryData } from "./fileUtils-CRWqOQje.js";
|
|
22
|
+
import { t as ChatFile_default } from "./ChatFile-xZxmc2nV.js";
|
|
23
|
+
import { a as bash, i as javascript, n as typescript, r as python, t as xml } from "./xml-B_oj6Mle.js";
|
|
24
|
+
import { _ as isPlaceholderLog, a as LogsViewConsumedTokenCountText_default, b as restoreChatHistory, f as getDepth, g as getTotalConsumedTokens, h as getSubtreeTotalConsumedTokens, i as LogsViewNodeName_default, l as findLogEntryRec, m as getInputKey, n as useLogsExecutionData, p as getEntryAtRelativeIndex, r as LogsOverviewRows_default, s as extractBotResponse, t as useLogsTreeExpand, u as findSelectedLogEntry, v as isSubNodeLog, y as processFiles } from "./useLogsTreeExpand-sZViUfdM.js";
|
|
25
|
+
import { t as core_default } from "./core-B9gt_4yk.js";
|
|
26
|
+
function constructChatWebsocketUrl(url, executionId, sessionId$1, isPublic) {
|
|
27
|
+
const baseUrl = new URL(url).origin;
|
|
28
|
+
const wsProtocol = baseUrl.startsWith("https") ? "wss" : "ws";
|
|
29
|
+
return `${baseUrl.replace(/^https?/, wsProtocol)}/chat?sessionId=${sessionId$1}&executionId=${executionId}${isPublic ? "&isPublic=true" : ""}`;
|
|
30
|
+
}
|
|
31
|
+
function useChatMessaging({ chatTrigger, sessionId: sessionId$1, executionResultData, onRunChatWorkflow, ws, onNewMessage }) {
|
|
32
|
+
const locale = useI18n();
|
|
33
|
+
const { showError } = useToast();
|
|
34
|
+
const previousMessageIndex = ref(0);
|
|
35
|
+
const isLoading = ref(false);
|
|
36
|
+
const setLoadingState = (loading) => {
|
|
37
|
+
isLoading.value = loading;
|
|
38
|
+
};
|
|
39
|
+
async function getKeyedFiles(files) {
|
|
40
|
+
const binaryData = {};
|
|
41
|
+
await Promise.all(files.map(async (file, index) => {
|
|
42
|
+
const data = await convertFileToBinaryData(file);
|
|
43
|
+
const key = `data${index}`;
|
|
44
|
+
binaryData[key] = data;
|
|
45
|
+
}));
|
|
46
|
+
return binaryData;
|
|
47
|
+
}
|
|
48
|
+
function extractFileMeta(file) {
|
|
49
|
+
return {
|
|
50
|
+
fileName: file.name,
|
|
51
|
+
fileSize: `${file.size} bytes`,
|
|
52
|
+
fileExtension: file.name.split(".").pop() ?? "",
|
|
53
|
+
fileType: file.type.split("/")[0],
|
|
54
|
+
mimeType: file.type
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async function startWorkflowWithMessage(message, files) {
|
|
58
|
+
const triggerNode = chatTrigger.value;
|
|
59
|
+
if (!triggerNode) {
|
|
60
|
+
showError(/* @__PURE__ */ new Error("Chat Trigger Node could not be found!"), "Trigger Node not found");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const inputKey = getInputKey(triggerNode);
|
|
64
|
+
const inputPayload = { json: {
|
|
65
|
+
sessionId: sessionId$1.value,
|
|
66
|
+
action: "sendMessage",
|
|
67
|
+
[inputKey]: message
|
|
68
|
+
} };
|
|
69
|
+
if (files && files.length > 0) {
|
|
70
|
+
const filesMeta = files.map((file) => extractFileMeta(file));
|
|
71
|
+
const binaryData = await getKeyedFiles(files);
|
|
72
|
+
inputPayload.json.files = filesMeta;
|
|
73
|
+
inputPayload.binary = binaryData;
|
|
74
|
+
}
|
|
75
|
+
const nodeData = {
|
|
76
|
+
startTime: Date.now(),
|
|
77
|
+
executionTime: 0,
|
|
78
|
+
executionIndex: 0,
|
|
79
|
+
executionStatus: "success",
|
|
80
|
+
data: { main: [[inputPayload]] },
|
|
81
|
+
source: [null]
|
|
82
|
+
};
|
|
83
|
+
isLoading.value = true;
|
|
84
|
+
const response = await onRunChatWorkflow({
|
|
85
|
+
triggerNode: triggerNode.name,
|
|
86
|
+
nodeData,
|
|
87
|
+
source: "RunData.ManualChatMessage",
|
|
88
|
+
message
|
|
89
|
+
});
|
|
90
|
+
isLoading.value = false;
|
|
91
|
+
ws.value = null;
|
|
92
|
+
if (!response?.executionId) return;
|
|
93
|
+
if (triggerNode.parameters.options?.responseMode === "responseNodes") return;
|
|
94
|
+
const chatMessage = executionResultData.value ? extractBotResponse(executionResultData.value, response.executionId, locale.baseText("chat.window.chat.response.empty")) : void 0;
|
|
95
|
+
if (chatMessage !== void 0) onNewMessage(chatMessage);
|
|
96
|
+
}
|
|
97
|
+
async function sendMessage(message, files) {
|
|
98
|
+
previousMessageIndex.value = 0;
|
|
99
|
+
if (message.trim() === "" && (!files || files.length === 0)) {
|
|
100
|
+
showError(new Error(locale.baseText("chat.window.chat.provideMessage")), locale.baseText("chat.window.chat.emptyChatMessage"));
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const pinnedChatData = usePinnedData(chatTrigger.value);
|
|
104
|
+
if (pinnedChatData.hasData.value) {
|
|
105
|
+
if (!(await useMessage().confirm(locale.baseText("chat.window.chat.unpinAndExecute.description"), locale.baseText("chat.window.chat.unpinAndExecute.title"), {
|
|
106
|
+
confirmButtonText: locale.baseText("chat.window.chat.unpinAndExecute.confirm"),
|
|
107
|
+
cancelButtonText: locale.baseText("chat.window.chat.unpinAndExecute.cancel")
|
|
108
|
+
}) === "confirm")) return;
|
|
109
|
+
pinnedChatData.unsetData("unpin-and-send-chat-message-modal");
|
|
110
|
+
}
|
|
111
|
+
const newMessage = {
|
|
112
|
+
text: message,
|
|
113
|
+
sender: "user",
|
|
114
|
+
sessionId: sessionId$1.value,
|
|
115
|
+
id: v4_default(),
|
|
116
|
+
files
|
|
117
|
+
};
|
|
118
|
+
onNewMessage(newMessage);
|
|
119
|
+
if (ws.value?.readyState === WebSocket.OPEN && !isLoading.value) {
|
|
120
|
+
ws.value.send(JSON.stringify({
|
|
121
|
+
sessionId: sessionId$1.value,
|
|
122
|
+
action: "sendMessage",
|
|
123
|
+
chatInput: message,
|
|
124
|
+
files: await processFiles(files)
|
|
125
|
+
}));
|
|
126
|
+
isLoading.value = true;
|
|
127
|
+
} else await startWorkflowWithMessage(newMessage.text, files);
|
|
128
|
+
}
|
|
129
|
+
return {
|
|
130
|
+
previousMessageIndex,
|
|
131
|
+
isLoading: computed(() => isLoading.value),
|
|
132
|
+
setLoadingState,
|
|
133
|
+
sendMessage
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const ChatSymbol = "Chat";
|
|
137
|
+
const ChatOptionsSymbol = "ChatOptions";
|
|
138
|
+
var ChatSymbol$1 = "Chat";
|
|
139
|
+
function useChatState(isReadOnly) {
|
|
140
|
+
const locale = useI18n();
|
|
141
|
+
const workflowsStore = useWorkflowsStore();
|
|
142
|
+
const workflowState = injectWorkflowState();
|
|
143
|
+
const rootStore = useRootStore();
|
|
144
|
+
const logsStore = useLogsStore();
|
|
145
|
+
const router = useRouter();
|
|
146
|
+
const nodeHelpers = useNodeHelpers();
|
|
147
|
+
const { runWorkflow } = useRunWorkflow({ router });
|
|
148
|
+
const ws = ref(null);
|
|
149
|
+
const messages$1 = computed(() => logsStore.chatSessionMessages);
|
|
150
|
+
const currentSessionId = computed(() => logsStore.chatSessionId);
|
|
151
|
+
const previousChatMessages = computed(() => workflowsStore.getPastChatMessages);
|
|
152
|
+
const chatTriggerNode = computed(() => workflowsStore.allNodes.find(isChatNode) ?? null);
|
|
153
|
+
const allowFileUploads = computed(() => (chatTriggerNode.value?.parameters?.options)?.allowFileUploads === true);
|
|
154
|
+
const allowedFilesMimeTypes = computed(() => (chatTriggerNode.value?.parameters?.options)?.allowedFilesMimeTypes?.toString() ?? "");
|
|
155
|
+
const respondNodesResponseMode = computed(() => (chatTriggerNode.value?.parameters?.options)?.responseMode === "responseNodes");
|
|
156
|
+
const { sendMessage, isLoading, setLoadingState } = useChatMessaging({
|
|
157
|
+
chatTrigger: chatTriggerNode,
|
|
158
|
+
sessionId: currentSessionId,
|
|
159
|
+
executionResultData: computed(() => workflowsStore.getWorkflowExecution?.data?.resultData),
|
|
160
|
+
onRunChatWorkflow,
|
|
161
|
+
onNewMessage: logsStore.addChatMessage,
|
|
162
|
+
ws
|
|
163
|
+
});
|
|
164
|
+
function createChatConfig(params) {
|
|
165
|
+
return {
|
|
166
|
+
chatConfig: {
|
|
167
|
+
messages: params.messages,
|
|
168
|
+
sendMessage: params.sendMessage,
|
|
169
|
+
initialMessages: ref([]),
|
|
170
|
+
currentSessionId: params.currentSessionId,
|
|
171
|
+
waitingForResponse: params.isLoading
|
|
172
|
+
},
|
|
173
|
+
chatOptions: {
|
|
174
|
+
i18n: { en: {
|
|
175
|
+
title: "",
|
|
176
|
+
footer: "",
|
|
177
|
+
subtitle: "",
|
|
178
|
+
inputPlaceholder: params.locale.baseText("chat.window.chat.placeholder"),
|
|
179
|
+
getStarted: "",
|
|
180
|
+
closeButtonTooltip: ""
|
|
181
|
+
} },
|
|
182
|
+
webhookUrl: "",
|
|
183
|
+
mode: "window",
|
|
184
|
+
showWindowCloseButton: true,
|
|
185
|
+
disabled: params.isDisabled,
|
|
186
|
+
allowFileUploads: params.allowFileUploads,
|
|
187
|
+
allowedFilesMimeTypes
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
const { chatConfig, chatOptions } = createChatConfig({
|
|
192
|
+
messages: messages$1,
|
|
193
|
+
sendMessage,
|
|
194
|
+
currentSessionId,
|
|
195
|
+
isLoading,
|
|
196
|
+
isDisabled: computed(() => isReadOnly),
|
|
197
|
+
allowFileUploads,
|
|
198
|
+
locale
|
|
199
|
+
});
|
|
200
|
+
const restoredChatMessages = computed(() => restoreChatHistory(workflowsStore.workflowExecutionData, locale.baseText("chat.window.chat.response.empty")));
|
|
201
|
+
provide(ChatSymbol$1, chatConfig);
|
|
202
|
+
provide(ChatOptionsSymbol, chatOptions);
|
|
203
|
+
async function createExecutionPromise() {
|
|
204
|
+
return await new Promise((resolve) => {
|
|
205
|
+
const resolveIfFinished = (isRunning) => {
|
|
206
|
+
if (!isRunning) {
|
|
207
|
+
unwatch();
|
|
208
|
+
resolve();
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const unwatch = watch(() => workflowsStore.isWorkflowRunning, resolveIfFinished);
|
|
212
|
+
resolveIfFinished(workflowsStore.isWorkflowRunning);
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async function onRunChatWorkflow(payload) {
|
|
216
|
+
const runWorkflowOptions = {
|
|
217
|
+
triggerNode: payload.triggerNode,
|
|
218
|
+
nodeData: payload.nodeData,
|
|
219
|
+
source: payload.source
|
|
220
|
+
};
|
|
221
|
+
if (workflowsStore.chatPartialExecutionDestinationNode) {
|
|
222
|
+
runWorkflowOptions.destinationNode = {
|
|
223
|
+
nodeName: workflowsStore.chatPartialExecutionDestinationNode,
|
|
224
|
+
mode: "inclusive"
|
|
225
|
+
};
|
|
226
|
+
workflowsStore.chatPartialExecutionDestinationNode = null;
|
|
227
|
+
}
|
|
228
|
+
const response = await runWorkflow(runWorkflowOptions);
|
|
229
|
+
if (response) {
|
|
230
|
+
if (respondNodesResponseMode.value) {
|
|
231
|
+
const wsUrl = constructChatWebsocketUrl(rootStore.urlBaseEditor, response.executionId, currentSessionId.value, false);
|
|
232
|
+
ws.value = new WebSocket(wsUrl);
|
|
233
|
+
ws.value.onmessage = (event) => {
|
|
234
|
+
if (event.data === "n8n|heartbeat") {
|
|
235
|
+
ws.value?.send("n8n|heartbeat-ack");
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (event.data === "n8n|continue") {
|
|
239
|
+
setLoadingState(true);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
setLoadingState(false);
|
|
243
|
+
const newMessage = {
|
|
244
|
+
text: event.data,
|
|
245
|
+
sender: "bot",
|
|
246
|
+
sessionId: currentSessionId.value,
|
|
247
|
+
id: v4_default()
|
|
248
|
+
};
|
|
249
|
+
logsStore.addChatMessage(newMessage);
|
|
250
|
+
if (logsStore.isOpen) chatEventBus.emit("focusInput");
|
|
251
|
+
};
|
|
252
|
+
ws.value.onclose = () => {
|
|
253
|
+
setLoadingState(false);
|
|
254
|
+
ws.value = null;
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
await createExecutionPromise();
|
|
258
|
+
workflowsStore.appendChatMessage(payload.message);
|
|
259
|
+
return response;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function refreshSession() {
|
|
263
|
+
workflowState.setWorkflowExecutionData(null);
|
|
264
|
+
nodeHelpers.updateNodesExecutionIssues();
|
|
265
|
+
logsStore.resetChatSessionId();
|
|
266
|
+
logsStore.resetMessages();
|
|
267
|
+
if (logsStore.isOpen) chatEventBus.emit("focusInput");
|
|
268
|
+
}
|
|
269
|
+
function displayExecution(executionId) {
|
|
270
|
+
const route = router.resolve({
|
|
271
|
+
name: VIEWS.EXECUTION_PREVIEW,
|
|
272
|
+
params: {
|
|
273
|
+
name: workflowsStore.workflowId,
|
|
274
|
+
executionId
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
window.open(route.href, "_blank");
|
|
278
|
+
}
|
|
279
|
+
watch(() => workflowsStore.workflowId, (_newWorkflowId, prevWorkflowId) => {
|
|
280
|
+
if (!prevWorkflowId) return;
|
|
281
|
+
refreshSession();
|
|
282
|
+
});
|
|
283
|
+
return {
|
|
284
|
+
currentSessionId: computed(() => logsStore.chatSessionId),
|
|
285
|
+
messages: computed(() => isReadOnly ? restoredChatMessages.value : logsStore.chatSessionMessages),
|
|
286
|
+
previousChatMessages,
|
|
287
|
+
sendMessage,
|
|
288
|
+
refreshSession,
|
|
289
|
+
displayExecution
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
var LogsPanelHeader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
293
|
+
__name: "LogsPanelHeader",
|
|
294
|
+
props: {
|
|
295
|
+
title: {},
|
|
296
|
+
isClickable: { type: Boolean }
|
|
297
|
+
},
|
|
298
|
+
emits: ["click"],
|
|
299
|
+
setup(__props, { emit: __emit }) {
|
|
300
|
+
const emit = __emit;
|
|
301
|
+
function handleClick() {
|
|
302
|
+
if (__props.isClickable) emit("click");
|
|
303
|
+
}
|
|
304
|
+
return (_ctx, _cache) => {
|
|
305
|
+
return openBlock(), createElementBlock("header", {
|
|
306
|
+
class: normalizeClass([_ctx.$style.container, { [_ctx.$style.clickable]: _ctx.isClickable }]),
|
|
307
|
+
onClick: handleClick
|
|
308
|
+
}, [createVNode(unref(N8nText_default), {
|
|
309
|
+
class: normalizeClass(_ctx.$style.title),
|
|
310
|
+
bold: true,
|
|
311
|
+
size: "small"
|
|
312
|
+
}, {
|
|
313
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, "title", {}, () => [createTextVNode(toDisplayString(_ctx.title), 1)])]),
|
|
314
|
+
_: 3
|
|
315
|
+
}, 8, ["class"]), createBaseVNode("div", { class: normalizeClass(_ctx.$style.actions) }, [renderSlot(_ctx.$slots, "actions")], 2)], 2);
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
var LogsPanelHeader_vue_vue_type_style_index_0_lang_module_default = {
|
|
320
|
+
container: "_container_1y331_123",
|
|
321
|
+
clickable: "_clickable_1y331_135",
|
|
322
|
+
title: "_title_1y331_143",
|
|
323
|
+
actions: "_actions_1y331_151"
|
|
324
|
+
};
|
|
325
|
+
var LogsPanelHeader_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogsPanelHeader_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogsPanelHeader_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
326
|
+
var import_upperFirst = /* @__PURE__ */ __toESM(require_upperFirst());
|
|
327
|
+
var LogsViewExecutionSummary_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
328
|
+
__name: "LogsViewExecutionSummary",
|
|
329
|
+
props: {
|
|
330
|
+
status: {},
|
|
331
|
+
consumedTokens: {},
|
|
332
|
+
startTime: {},
|
|
333
|
+
timeTook: {}
|
|
334
|
+
},
|
|
335
|
+
setup(__props) {
|
|
336
|
+
const locale = useI18n();
|
|
337
|
+
const now = useTimestamp({ interval: 1e3 });
|
|
338
|
+
const executionStatusText = computed(() => __props.status === "running" || __props.status === "waiting" ? locale.baseText("logs.overview.body.summaryText.for", { interpolate: {
|
|
339
|
+
status: (0, import_upperFirst.default)(__props.status),
|
|
340
|
+
time: locale.displayTimer(Math.floor((now.value - __props.startTime) / 1e3) * 1e3, true)
|
|
341
|
+
} }) : __props.timeTook === void 0 ? (0, import_upperFirst.default)(__props.status) : locale.baseText("logs.overview.body.summaryText.in", { interpolate: {
|
|
342
|
+
status: (0, import_upperFirst.default)(__props.status),
|
|
343
|
+
time: locale.displayTimer(__props.timeTook, true)
|
|
344
|
+
} }));
|
|
345
|
+
return (_ctx, _cache) => {
|
|
346
|
+
return openBlock(), createBlock(unref(N8nText_default), {
|
|
347
|
+
tag: "div",
|
|
348
|
+
color: "text-light",
|
|
349
|
+
size: "small",
|
|
350
|
+
class: normalizeClass(_ctx.$style.container)
|
|
351
|
+
}, {
|
|
352
|
+
default: withCtx(() => [createBaseVNode("span", null, toDisplayString(executionStatusText.value), 1), _ctx.consumedTokens.totalTokens > 0 ? (openBlock(), createBlock(LogsViewConsumedTokenCountText_default, {
|
|
353
|
+
key: 0,
|
|
354
|
+
"consumed-tokens": _ctx.consumedTokens
|
|
355
|
+
}, null, 8, ["consumed-tokens"])) : createCommentVNode("", true)]),
|
|
356
|
+
_: 1
|
|
357
|
+
}, 8, ["class"]);
|
|
358
|
+
};
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
var LogsViewExecutionSummary_vue_vue_type_style_index_0_lang_module_default = { container: "_container_1sayb_123" };
|
|
362
|
+
var LogsViewExecutionSummary_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogsViewExecutionSummary_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogsViewExecutionSummary_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
363
|
+
function useClearExecutionButtonVisible() {
|
|
364
|
+
const route = useRoute();
|
|
365
|
+
const sourceControlStore = useSourceControlStore();
|
|
366
|
+
const workflowsStore = useWorkflowsStore();
|
|
367
|
+
const workflowExecutionData = computed(() => workflowsStore.workflowExecutionData);
|
|
368
|
+
const isWorkflowRunning = computed(() => workflowsStore.isWorkflowRunning);
|
|
369
|
+
const isReadOnlyRoute = computed(() => !!route?.meta?.readOnlyCanvas);
|
|
370
|
+
const { editableWorkflow } = useCanvasOperations();
|
|
371
|
+
const nodeTypesStore = useNodeTypesStore();
|
|
372
|
+
const isReadOnlyEnvironment = computed(() => sourceControlStore.preferences.branchReadOnly);
|
|
373
|
+
const allTriggerNodesDisabled = computed(() => editableWorkflow.value.nodes.filter((node) => nodeTypesStore.isTriggerNode(node.type)).every((node) => node.disabled));
|
|
374
|
+
return computed(() => !isReadOnlyRoute.value && !isReadOnlyEnvironment.value && !isWorkflowRunning.value && !allTriggerNodesDisabled.value && !!workflowExecutionData.value);
|
|
375
|
+
}
|
|
376
|
+
var LogsOverviewPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
377
|
+
__name: "LogsOverviewPanel",
|
|
378
|
+
props: {
|
|
379
|
+
isOpen: { type: Boolean },
|
|
380
|
+
selected: {},
|
|
381
|
+
isReadOnly: { type: Boolean },
|
|
382
|
+
isCompact: { type: Boolean },
|
|
383
|
+
execution: {},
|
|
384
|
+
entries: {},
|
|
385
|
+
flatLogEntries: {},
|
|
386
|
+
latestNodeInfo: {},
|
|
387
|
+
isHeaderClickable: { type: Boolean }
|
|
388
|
+
},
|
|
389
|
+
emits: [
|
|
390
|
+
"clickHeader",
|
|
391
|
+
"select",
|
|
392
|
+
"clearExecutionData",
|
|
393
|
+
"openNdv",
|
|
394
|
+
"toggleExpanded"
|
|
395
|
+
],
|
|
396
|
+
setup(__props, { emit: __emit }) {
|
|
397
|
+
const emit = __emit;
|
|
398
|
+
const locale = useI18n();
|
|
399
|
+
const isClearExecutionButtonVisible = useClearExecutionButtonVisible();
|
|
400
|
+
const isEmpty = computed(() => __props.flatLogEntries.length === 0 || __props.execution === void 0);
|
|
401
|
+
const switchViewOptions = computed(() => [{
|
|
402
|
+
label: locale.baseText("logs.overview.header.switch.overview"),
|
|
403
|
+
value: "overview"
|
|
404
|
+
}, {
|
|
405
|
+
label: locale.baseText("logs.overview.header.switch.details"),
|
|
406
|
+
value: "details"
|
|
407
|
+
}]);
|
|
408
|
+
const hasStaticScrollbar = getScrollbarWidth() > 0;
|
|
409
|
+
const consumedTokens = computed(() => getTotalConsumedTokens(...__props.entries.map((entry) => getSubtreeTotalConsumedTokens(entry, false))));
|
|
410
|
+
const timeTook = computed(() => __props.execution?.startedAt && __props.execution.stoppedAt ? +new Date(__props.execution.stoppedAt) - +new Date(__props.execution.startedAt) : void 0);
|
|
411
|
+
const shouldShowTokenCountColumn = computed(() => consumedTokens.value.totalTokens > 0 || __props.entries.some((entry) => getSubtreeTotalConsumedTokens(entry, true).totalTokens > 0));
|
|
412
|
+
function handleSwitchView(value) {
|
|
413
|
+
emit("select", value === "overview" ? void 0 : __props.flatLogEntries[0]);
|
|
414
|
+
}
|
|
415
|
+
return (_ctx, _cache) => {
|
|
416
|
+
return openBlock(), createElementBlock("div", {
|
|
417
|
+
class: normalizeClass([_ctx.$style.container, hasStaticScrollbar ? _ctx.$style.staticScrollBar : ""]),
|
|
418
|
+
"data-test-id": "logs-overview"
|
|
419
|
+
}, [createVNode(LogsPanelHeader_default, {
|
|
420
|
+
title: unref(locale).baseText("logs.overview.header.title"),
|
|
421
|
+
"data-test-id": "logs-overview-header",
|
|
422
|
+
"is-clickable": _ctx.isHeaderClickable,
|
|
423
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("clickHeader"))
|
|
424
|
+
}, {
|
|
425
|
+
actions: withCtx(() => [unref(isClearExecutionButtonVisible) ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
426
|
+
key: 0,
|
|
427
|
+
content: unref(locale).baseText("logs.overview.header.actions.clearExecution.tooltip")
|
|
428
|
+
}, {
|
|
429
|
+
default: withCtx(() => [createVNode(unref(N8nButton_default), {
|
|
430
|
+
size: "mini",
|
|
431
|
+
type: "secondary",
|
|
432
|
+
icon: "trash-2",
|
|
433
|
+
"icon-size": "medium",
|
|
434
|
+
"data-test-id": "clear-execution-data-button",
|
|
435
|
+
class: normalizeClass(_ctx.$style.clearButton),
|
|
436
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("clearExecutionData"), ["stop"]))
|
|
437
|
+
}, {
|
|
438
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("logs.overview.header.actions.clearExecution")), 1)]),
|
|
439
|
+
_: 1
|
|
440
|
+
}, 8, ["class"])]),
|
|
441
|
+
_: 1
|
|
442
|
+
}, 8, ["content"])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "actions")]),
|
|
443
|
+
_: 3
|
|
444
|
+
}, 8, ["title", "is-clickable"]), _ctx.isOpen ? (openBlock(), createElementBlock("div", {
|
|
445
|
+
key: 0,
|
|
446
|
+
class: normalizeClass([_ctx.$style.content, isEmpty.value ? _ctx.$style.empty : ""]),
|
|
447
|
+
"data-test-id": "logs-overview-body"
|
|
448
|
+
}, [isEmpty.value || _ctx.execution === void 0 ? (openBlock(), createBlock(unref(N8nText_default), {
|
|
449
|
+
key: 0,
|
|
450
|
+
tag: "p",
|
|
451
|
+
size: "medium",
|
|
452
|
+
color: "text-base",
|
|
453
|
+
class: normalizeClass(_ctx.$style.emptyText),
|
|
454
|
+
"data-test-id": "logs-overview-empty"
|
|
455
|
+
}, {
|
|
456
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("logs.overview.body.empty.message")), 1)]),
|
|
457
|
+
_: 1
|
|
458
|
+
}, 8, ["class"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
459
|
+
createVNode(LogsViewExecutionSummary_default, {
|
|
460
|
+
"data-test-id": "logs-overview-status",
|
|
461
|
+
class: normalizeClass(_ctx.$style.summary),
|
|
462
|
+
status: _ctx.execution.status,
|
|
463
|
+
"consumed-tokens": consumedTokens.value,
|
|
464
|
+
"start-time": +new Date(_ctx.execution.startedAt),
|
|
465
|
+
"time-took": timeTook.value
|
|
466
|
+
}, null, 8, [
|
|
467
|
+
"class",
|
|
468
|
+
"status",
|
|
469
|
+
"consumed-tokens",
|
|
470
|
+
"start-time",
|
|
471
|
+
"time-took"
|
|
472
|
+
]),
|
|
473
|
+
createVNode(LogsOverviewRows_default, {
|
|
474
|
+
"is-read-only": _ctx.isReadOnly,
|
|
475
|
+
selected: _ctx.selected,
|
|
476
|
+
"is-compact": _ctx.isCompact,
|
|
477
|
+
"should-show-token-count-column": shouldShowTokenCountColumn.value,
|
|
478
|
+
"latest-node-info": _ctx.latestNodeInfo,
|
|
479
|
+
"flat-log-entries": _ctx.flatLogEntries,
|
|
480
|
+
"can-open-ndv": true,
|
|
481
|
+
execution: _ctx.execution,
|
|
482
|
+
onToggleExpanded: _cache[2] || (_cache[2] = ($event) => emit("toggleExpanded", $event)),
|
|
483
|
+
onOpenNdv: _cache[3] || (_cache[3] = ($event) => emit("openNdv", $event)),
|
|
484
|
+
onSelect: _cache[4] || (_cache[4] = ($event) => emit("select", $event))
|
|
485
|
+
}, null, 8, [
|
|
486
|
+
"is-read-only",
|
|
487
|
+
"selected",
|
|
488
|
+
"is-compact",
|
|
489
|
+
"should-show-token-count-column",
|
|
490
|
+
"latest-node-info",
|
|
491
|
+
"flat-log-entries",
|
|
492
|
+
"execution"
|
|
493
|
+
]),
|
|
494
|
+
createVNode(unref(N8nRadioButtons_default), {
|
|
495
|
+
size: "small-medium",
|
|
496
|
+
class: normalizeClass(_ctx.$style.switchViewButtons),
|
|
497
|
+
"model-value": _ctx.selected ? "details" : "overview",
|
|
498
|
+
options: switchViewOptions.value,
|
|
499
|
+
"onUpdate:modelValue": handleSwitchView
|
|
500
|
+
}, null, 8, [
|
|
501
|
+
"class",
|
|
502
|
+
"model-value",
|
|
503
|
+
"options"
|
|
504
|
+
])
|
|
505
|
+
], 64))], 2)) : createCommentVNode("", true)], 2);
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
var LogsOverviewPanel_vue_vue_type_style_index_0_lang_module_default = {
|
|
510
|
+
container: "_container_svlfi_123",
|
|
511
|
+
clearButton: "_clearButton_svlfi_133",
|
|
512
|
+
content: "_content_svlfi_139",
|
|
513
|
+
empty: "_empty_svlfi_149",
|
|
514
|
+
emptyText: "_emptyText_svlfi_154",
|
|
515
|
+
summary: "_summary_svlfi_159",
|
|
516
|
+
switchViewButtons: "_switchViewButtons_svlfi_163"
|
|
517
|
+
};
|
|
518
|
+
var LogsOverviewPanel_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogsOverviewPanel_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogsOverviewPanel_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
519
|
+
function useChat() {
|
|
520
|
+
return inject(ChatSymbol);
|
|
521
|
+
}
|
|
522
|
+
function useOptions() {
|
|
523
|
+
return { options: inject(ChatOptionsSymbol) };
|
|
524
|
+
}
|
|
525
|
+
function useI18n$1() {
|
|
526
|
+
const { options } = useOptions();
|
|
527
|
+
const language = options?.defaultLanguage ?? "en";
|
|
528
|
+
function t(key) {
|
|
529
|
+
const val = options?.i18n?.[language]?.[key];
|
|
530
|
+
if (isRef(val)) return val.value;
|
|
531
|
+
return val ?? key;
|
|
532
|
+
}
|
|
533
|
+
function te(key) {
|
|
534
|
+
return !!options?.i18n?.[language]?.[key];
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
t,
|
|
538
|
+
te
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
var import_markdown_it_link_attributes = /* @__PURE__ */ __toESM(require_markdown_it_link_attributes());
|
|
542
|
+
var _hoisted_1$5 = {
|
|
543
|
+
key: 0,
|
|
544
|
+
class: "chat-message-actions"
|
|
545
|
+
};
|
|
546
|
+
var _hoisted_2$2 = {
|
|
547
|
+
key: 2,
|
|
548
|
+
class: "chat-message-files"
|
|
549
|
+
};
|
|
550
|
+
var Message_default = /* @__PURE__ */ defineComponent({
|
|
551
|
+
__name: "Message",
|
|
552
|
+
props: { message: {} },
|
|
553
|
+
setup(__props, { expose: __expose }) {
|
|
554
|
+
const props = __props;
|
|
555
|
+
core_default.registerLanguage("javascript", javascript);
|
|
556
|
+
core_default.registerLanguage("typescript", typescript);
|
|
557
|
+
core_default.registerLanguage("python", python);
|
|
558
|
+
core_default.registerLanguage("xml", xml);
|
|
559
|
+
core_default.registerLanguage("bash", bash);
|
|
560
|
+
const { message } = toRefs(props);
|
|
561
|
+
const { options } = useOptions();
|
|
562
|
+
const messageContainer = ref(null);
|
|
563
|
+
const fileSources = ref({});
|
|
564
|
+
const messageText = computed(() => {
|
|
565
|
+
return message.value.text || "<Empty response>";
|
|
566
|
+
});
|
|
567
|
+
const classes = computed(() => {
|
|
568
|
+
return {
|
|
569
|
+
"chat-message-from-user": message.value.sender === "user",
|
|
570
|
+
"chat-message-from-bot": message.value.sender === "bot",
|
|
571
|
+
"chat-message-transparent": message.value.transparent === true
|
|
572
|
+
};
|
|
573
|
+
});
|
|
574
|
+
const linksNewTabPlugin = (vueMarkdownItInstance) => {
|
|
575
|
+
vueMarkdownItInstance.use(import_markdown_it_link_attributes.default, { attrs: {
|
|
576
|
+
target: "_blank",
|
|
577
|
+
rel: "noopener"
|
|
578
|
+
} });
|
|
579
|
+
};
|
|
580
|
+
const scrollToView = () => {
|
|
581
|
+
if (messageContainer.value?.scrollIntoView) messageContainer.value.scrollIntoView({ block: "start" });
|
|
582
|
+
};
|
|
583
|
+
const markdownOptions = { highlight(str, lang) {
|
|
584
|
+
if (lang && core_default.getLanguage(lang)) try {
|
|
585
|
+
return core_default.highlight(str, { language: lang }).value;
|
|
586
|
+
} catch {}
|
|
587
|
+
return "";
|
|
588
|
+
} };
|
|
589
|
+
const messageComponents = { ...options?.messageComponents ?? {} };
|
|
590
|
+
__expose({ scrollToView });
|
|
591
|
+
const readFileAsDataURL = async (file) => await new Promise((resolve, reject) => {
|
|
592
|
+
const reader = new FileReader();
|
|
593
|
+
reader.onload = () => resolve(reader.result);
|
|
594
|
+
reader.onerror = reject;
|
|
595
|
+
reader.readAsDataURL(file);
|
|
596
|
+
});
|
|
597
|
+
onMounted(async () => {
|
|
598
|
+
if (message.value.files) for (const file of message.value.files) try {
|
|
599
|
+
const dataURL = await readFileAsDataURL(file);
|
|
600
|
+
fileSources.value[file.name] = dataURL;
|
|
601
|
+
} catch (error) {
|
|
602
|
+
console.error("Error reading file:", error);
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
return (_ctx, _cache) => {
|
|
606
|
+
return openBlock(), createElementBlock("div", {
|
|
607
|
+
ref_key: "messageContainer",
|
|
608
|
+
ref: messageContainer,
|
|
609
|
+
class: normalizeClass(["chat-message", classes.value])
|
|
610
|
+
}, [!!_ctx.$slots.beforeMessage ? (openBlock(), createElementBlock("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "beforeMessage", normalizeProps(guardReactiveProps({ message: unref(message) })))])) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default", {}, () => [unref(message).type === "component" && messageComponents[unref(message).key] ? (openBlock(), createBlock(resolveDynamicComponent(messageComponents[unref(message).key]), normalizeProps(mergeProps({ key: 0 }, unref(message).arguments)), null, 16)) : (openBlock(), createBlock(unref(VueMarkdown_default), {
|
|
611
|
+
key: 1,
|
|
612
|
+
class: "chat-message-markdown",
|
|
613
|
+
source: messageText.value,
|
|
614
|
+
options: markdownOptions,
|
|
615
|
+
plugins: [linksNewTabPlugin]
|
|
616
|
+
}, null, 8, ["source", "plugins"])), (unref(message).files ?? []).length > 0 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(message).files ?? [], (file) => {
|
|
617
|
+
return openBlock(), createElementBlock("div", {
|
|
618
|
+
key: file.name,
|
|
619
|
+
class: "chat-message-file"
|
|
620
|
+
}, [createVNode(ChatFile_default, {
|
|
621
|
+
file,
|
|
622
|
+
"is-removable": false,
|
|
623
|
+
"is-previewable": true
|
|
624
|
+
}, null, 8, ["file"])]);
|
|
625
|
+
}), 128))])) : createCommentVNode("", true)])], 2);
|
|
626
|
+
};
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
var _hoisted_1$4 = {
|
|
630
|
+
viewBox: "0 0 24 24",
|
|
631
|
+
width: "1.2em",
|
|
632
|
+
height: "1.2em"
|
|
633
|
+
};
|
|
634
|
+
function render$1(_ctx, _cache) {
|
|
635
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
636
|
+
fill: "currentColor",
|
|
637
|
+
d: "M16.5 6v11.5a4 4 0 0 1-4 4a4 4 0 0 1-4-4V5A2.5 2.5 0 0 1 11 2.5A2.5 2.5 0 0 1 13.5 5v10.5a1 1 0 0 1-1 1a1 1 0 0 1-1-1V6H10v9.5a2.5 2.5 0 0 0 2.5 2.5a2.5 2.5 0 0 0 2.5-2.5V5a4 4 0 0 0-4-4a4 4 0 0 0-4 4v12.5a5.5 5.5 0 0 0 5.5 5.5a5.5 5.5 0 0 0 5.5-5.5V6z"
|
|
638
|
+
}, null, -1)]));
|
|
639
|
+
}
|
|
640
|
+
var paperclip_default = {
|
|
641
|
+
name: "mdi-paperclip",
|
|
642
|
+
render: render$1
|
|
643
|
+
};
|
|
644
|
+
var _hoisted_1$3 = {
|
|
645
|
+
viewBox: "0 0 24 24",
|
|
646
|
+
width: "1.2em",
|
|
647
|
+
height: "1.2em"
|
|
648
|
+
};
|
|
649
|
+
function render(_ctx, _cache) {
|
|
650
|
+
return openBlock(), createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [createBaseVNode("path", {
|
|
651
|
+
fill: "currentColor",
|
|
652
|
+
d: "m2 21l21-9L2 3v7l15 2l-15 2z"
|
|
653
|
+
}, null, -1)]));
|
|
654
|
+
}
|
|
655
|
+
var send_default = {
|
|
656
|
+
name: "mdi-send",
|
|
657
|
+
render
|
|
658
|
+
};
|
|
659
|
+
var _hoisted_1$2 = { class: "chat-inputs" };
|
|
660
|
+
var _hoisted_2$1 = {
|
|
661
|
+
key: 0,
|
|
662
|
+
class: "chat-input-left-panel"
|
|
663
|
+
};
|
|
664
|
+
var _hoisted_3$1 = ["disabled", "placeholder"];
|
|
665
|
+
var _hoisted_4 = { class: "chat-inputs-controls" };
|
|
666
|
+
var _hoisted_5 = ["disabled"];
|
|
667
|
+
var _hoisted_6 = ["disabled"];
|
|
668
|
+
var _hoisted_7 = {
|
|
669
|
+
key: 0,
|
|
670
|
+
class: "chat-files"
|
|
671
|
+
};
|
|
672
|
+
var Input_default = /* @__PURE__ */ __plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
|
|
673
|
+
__name: "Input",
|
|
674
|
+
props: { placeholder: { default: "inputPlaceholder" } },
|
|
675
|
+
emits: ["arrowKeyDown", "escapeKeyDown"],
|
|
676
|
+
setup(__props, { emit: __emit }) {
|
|
677
|
+
const props = __props;
|
|
678
|
+
const { t } = useI18n$1();
|
|
679
|
+
const emit = __emit;
|
|
680
|
+
const { options } = useOptions();
|
|
681
|
+
const chatStore = useChat();
|
|
682
|
+
const { waitingForResponse } = chatStore;
|
|
683
|
+
const files = ref(null);
|
|
684
|
+
const chatTextArea = ref(null);
|
|
685
|
+
const input = ref("");
|
|
686
|
+
const isSubmitting = ref(false);
|
|
687
|
+
const resizeObserver = ref(null);
|
|
688
|
+
const waitingForChatResponse = ref(false);
|
|
689
|
+
const isSubmitDisabled = computed(() => {
|
|
690
|
+
if (waitingForChatResponse.value) return false;
|
|
691
|
+
return input.value === "" || unref(waitingForResponse) || options.disabled?.value === true;
|
|
692
|
+
});
|
|
693
|
+
const isInputDisabled = computed(() => options.disabled?.value === true);
|
|
694
|
+
const isFileUploadDisabled = computed(() => isFileUploadAllowed.value && unref(waitingForResponse) && !options.disabled?.value);
|
|
695
|
+
const isFileUploadAllowed = computed(() => unref(options.allowFileUploads) === true);
|
|
696
|
+
const allowedFileTypes = computed(() => unref(options.allowedFilesMimeTypes));
|
|
697
|
+
const styleVars = computed(() => {
|
|
698
|
+
const controlsCount = isFileUploadAllowed.value ? 2 : 1;
|
|
699
|
+
return { "--controls-count": controlsCount };
|
|
700
|
+
});
|
|
701
|
+
const { open: openFileDialog, reset: resetFileDialog, onChange } = useFileDialog({
|
|
702
|
+
multiple: true,
|
|
703
|
+
reset: false
|
|
704
|
+
});
|
|
705
|
+
onChange((newFiles) => {
|
|
706
|
+
if (!newFiles) return;
|
|
707
|
+
const newFilesDT = new DataTransfer();
|
|
708
|
+
if (files.value) for (let i = 0; i < files.value.length; i++) newFilesDT.items.add(files.value[i]);
|
|
709
|
+
for (let i = 0; i < newFiles.length; i++) newFilesDT.items.add(newFiles[i]);
|
|
710
|
+
files.value = newFilesDT.files;
|
|
711
|
+
});
|
|
712
|
+
onMounted(() => {
|
|
713
|
+
chatEventBus.on("focusInput", focusChatInput);
|
|
714
|
+
chatEventBus.on("blurInput", blurChatInput);
|
|
715
|
+
chatEventBus.on("setInputValue", setInputValue);
|
|
716
|
+
if (chatTextArea.value) {
|
|
717
|
+
resizeObserver.value = new ResizeObserver((entries) => {
|
|
718
|
+
for (const entry of entries) if (entry.target === chatTextArea.value) adjustTextAreaHeight();
|
|
719
|
+
});
|
|
720
|
+
resizeObserver.value.observe(chatTextArea.value);
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
onUnmounted(() => {
|
|
724
|
+
chatEventBus.off("focusInput", focusChatInput);
|
|
725
|
+
chatEventBus.off("blurInput", blurChatInput);
|
|
726
|
+
chatEventBus.off("setInputValue", setInputValue);
|
|
727
|
+
if (resizeObserver.value) {
|
|
728
|
+
resizeObserver.value.disconnect();
|
|
729
|
+
resizeObserver.value = null;
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
function blurChatInput() {
|
|
733
|
+
if (chatTextArea.value) chatTextArea.value.blur();
|
|
734
|
+
}
|
|
735
|
+
function focusChatInput() {
|
|
736
|
+
if (chatTextArea.value) chatTextArea.value.focus();
|
|
737
|
+
}
|
|
738
|
+
function setInputValue(value) {
|
|
739
|
+
input.value = value;
|
|
740
|
+
focusChatInput();
|
|
741
|
+
}
|
|
742
|
+
function attachFiles() {
|
|
743
|
+
if (files.value) {
|
|
744
|
+
const filesToAttach = Array.from(files.value);
|
|
745
|
+
resetFileDialog();
|
|
746
|
+
files.value = null;
|
|
747
|
+
return filesToAttach;
|
|
748
|
+
}
|
|
749
|
+
return [];
|
|
750
|
+
}
|
|
751
|
+
function setupWebsocketConnection(executionId) {
|
|
752
|
+
if (options.webhookUrl && chatStore.currentSessionId.value) try {
|
|
753
|
+
const wsUrl = constructChatWebsocketUrl(options.webhookUrl, executionId, chatStore.currentSessionId.value, true);
|
|
754
|
+
chatStore.ws = new WebSocket(wsUrl);
|
|
755
|
+
chatStore.ws.onmessage = (e) => {
|
|
756
|
+
if (e.data === "n8n|heartbeat") {
|
|
757
|
+
chatStore.ws?.send("n8n|heartbeat-ack");
|
|
758
|
+
return;
|
|
759
|
+
}
|
|
760
|
+
if (e.data === "n8n|continue") {
|
|
761
|
+
waitingForChatResponse.value = false;
|
|
762
|
+
chatStore.waitingForResponse.value = true;
|
|
763
|
+
return;
|
|
764
|
+
}
|
|
765
|
+
const newMessage = {
|
|
766
|
+
id: v4_default(),
|
|
767
|
+
text: e.data,
|
|
768
|
+
sender: "bot"
|
|
769
|
+
};
|
|
770
|
+
chatStore.messages.value.push(newMessage);
|
|
771
|
+
waitingForChatResponse.value = true;
|
|
772
|
+
chatStore.waitingForResponse.value = false;
|
|
773
|
+
};
|
|
774
|
+
chatStore.ws.onclose = () => {
|
|
775
|
+
chatStore.ws = null;
|
|
776
|
+
waitingForChatResponse.value = false;
|
|
777
|
+
chatStore.waitingForResponse.value = false;
|
|
778
|
+
};
|
|
779
|
+
} catch (error) {
|
|
780
|
+
console.error("Error setting up websocket connection", error);
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
async function processFiles$1(data) {
|
|
784
|
+
if (!data || data.length === 0) return [];
|
|
785
|
+
const filePromises = data.map(async (file) => {
|
|
786
|
+
return new Promise((resolve, reject) => {
|
|
787
|
+
const reader = new FileReader();
|
|
788
|
+
reader.onload = () => resolve({
|
|
789
|
+
name: file.name,
|
|
790
|
+
type: file.type,
|
|
791
|
+
data: reader.result
|
|
792
|
+
});
|
|
793
|
+
reader.onerror = () => reject(/* @__PURE__ */ new Error(`Error reading file: ${reader.error?.message ?? "Unknown error"}`));
|
|
794
|
+
reader.readAsDataURL(file);
|
|
795
|
+
});
|
|
796
|
+
});
|
|
797
|
+
return await Promise.all(filePromises);
|
|
798
|
+
}
|
|
799
|
+
async function respondToChatNode(ws, messageText) {
|
|
800
|
+
const sentMessage = {
|
|
801
|
+
id: v4_default(),
|
|
802
|
+
text: messageText,
|
|
803
|
+
sender: "user",
|
|
804
|
+
files: files.value ? attachFiles() : void 0
|
|
805
|
+
};
|
|
806
|
+
chatStore.messages.value.push(sentMessage);
|
|
807
|
+
ws.send(JSON.stringify({
|
|
808
|
+
sessionId: chatStore.currentSessionId.value,
|
|
809
|
+
action: "sendMessage",
|
|
810
|
+
chatInput: messageText,
|
|
811
|
+
files: await processFiles$1(sentMessage.files)
|
|
812
|
+
}));
|
|
813
|
+
chatStore.waitingForResponse.value = true;
|
|
814
|
+
waitingForChatResponse.value = false;
|
|
815
|
+
}
|
|
816
|
+
async function onSubmit(event) {
|
|
817
|
+
event.preventDefault();
|
|
818
|
+
if (isSubmitDisabled.value) return;
|
|
819
|
+
const messageText = input.value;
|
|
820
|
+
input.value = "";
|
|
821
|
+
isSubmitting.value = true;
|
|
822
|
+
if (chatStore.ws && waitingForChatResponse.value) {
|
|
823
|
+
await respondToChatNode(chatStore.ws, messageText);
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
const response = await chatStore.sendMessage(messageText, attachFiles());
|
|
827
|
+
if (response?.executionId) setupWebsocketConnection(response.executionId);
|
|
828
|
+
isSubmitting.value = false;
|
|
829
|
+
}
|
|
830
|
+
async function onSubmitKeydown(event) {
|
|
831
|
+
if (event.shiftKey || event.isComposing) return;
|
|
832
|
+
await onSubmit(event);
|
|
833
|
+
adjustTextAreaHeight();
|
|
834
|
+
}
|
|
835
|
+
function onFileRemove(file) {
|
|
836
|
+
if (!files.value) return;
|
|
837
|
+
const dt = new DataTransfer();
|
|
838
|
+
for (let i = 0; i < files.value.length; i++) {
|
|
839
|
+
const currentFile = files.value[i];
|
|
840
|
+
if (file.name !== currentFile.name) dt.items.add(currentFile);
|
|
841
|
+
}
|
|
842
|
+
resetFileDialog();
|
|
843
|
+
files.value = dt.files;
|
|
844
|
+
}
|
|
845
|
+
function onKeyDown(event) {
|
|
846
|
+
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
847
|
+
event.preventDefault();
|
|
848
|
+
emit("arrowKeyDown", {
|
|
849
|
+
key: event.key,
|
|
850
|
+
currentInputValue: input.value
|
|
851
|
+
});
|
|
852
|
+
} else if (event.key === "Escape") {
|
|
853
|
+
event.preventDefault();
|
|
854
|
+
emit("escapeKeyDown", { currentInputValue: input.value });
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
function onOpenFileDialog() {
|
|
858
|
+
if (isFileUploadDisabled.value) return;
|
|
859
|
+
openFileDialog({ accept: unref(allowedFileTypes) });
|
|
860
|
+
}
|
|
861
|
+
function adjustTextAreaHeight() {
|
|
862
|
+
const textarea = chatTextArea.value;
|
|
863
|
+
if (!textarea) return;
|
|
864
|
+
textarea.style.height = "var(--chat--textarea--height)";
|
|
865
|
+
const newHeight = Math.min(textarea.scrollHeight, 480);
|
|
866
|
+
textarea.style.height = `${newHeight}px`;
|
|
867
|
+
}
|
|
868
|
+
return (_ctx, _cache) => {
|
|
869
|
+
return openBlock(), createElementBlock("div", {
|
|
870
|
+
class: "chat-input",
|
|
871
|
+
style: normalizeStyle(styleVars.value),
|
|
872
|
+
onKeydown: withModifiers(onKeyDown, ["stop"])
|
|
873
|
+
}, [createBaseVNode("div", _hoisted_1$2, [
|
|
874
|
+
_ctx.$slots.leftPanel ? (openBlock(), createElementBlock("div", _hoisted_2$1, [renderSlot(_ctx.$slots, "leftPanel", {}, void 0, true)])) : createCommentVNode("", true),
|
|
875
|
+
withDirectives(createBaseVNode("textarea", {
|
|
876
|
+
ref_key: "chatTextArea",
|
|
877
|
+
ref: chatTextArea,
|
|
878
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => input.value = $event),
|
|
879
|
+
"data-test-id": "chat-input",
|
|
880
|
+
disabled: isInputDisabled.value,
|
|
881
|
+
placeholder: unref(t)(props.placeholder),
|
|
882
|
+
onKeydown: withKeys(onSubmitKeydown, ["enter"]),
|
|
883
|
+
onInput: adjustTextAreaHeight,
|
|
884
|
+
onMousedown: adjustTextAreaHeight,
|
|
885
|
+
onFocus: adjustTextAreaHeight
|
|
886
|
+
}, null, 40, _hoisted_3$1), [[vModelText, input.value]]),
|
|
887
|
+
createBaseVNode("div", _hoisted_4, [isFileUploadAllowed.value ? (openBlock(), createElementBlock("button", {
|
|
888
|
+
key: 0,
|
|
889
|
+
disabled: isFileUploadDisabled.value,
|
|
890
|
+
class: "chat-input-file-button",
|
|
891
|
+
"data-test-id": "chat-attach-file-button",
|
|
892
|
+
onClick: onOpenFileDialog
|
|
893
|
+
}, [createVNode(unref(paperclip_default), {
|
|
894
|
+
height: "24",
|
|
895
|
+
width: "24"
|
|
896
|
+
})], 8, _hoisted_5)) : createCommentVNode("", true), createBaseVNode("button", {
|
|
897
|
+
disabled: isSubmitDisabled.value,
|
|
898
|
+
class: "chat-input-send-button",
|
|
899
|
+
onClick: onSubmit
|
|
900
|
+
}, [createVNode(unref(send_default), {
|
|
901
|
+
height: "24",
|
|
902
|
+
width: "24"
|
|
903
|
+
})], 8, _hoisted_6)])
|
|
904
|
+
]), files.value?.length && (!isSubmitting.value || waitingForChatResponse.value) ? (openBlock(), createElementBlock("div", _hoisted_7, [(openBlock(true), createElementBlock(Fragment, null, renderList(files.value, (file) => {
|
|
905
|
+
return openBlock(), createBlock(ChatFile_default, {
|
|
906
|
+
key: file.name,
|
|
907
|
+
file,
|
|
908
|
+
"is-removable": true,
|
|
909
|
+
"is-previewable": true,
|
|
910
|
+
onRemove: onFileRemove
|
|
911
|
+
}, null, 8, ["file"]);
|
|
912
|
+
}), 128))])) : createCommentVNode("", true)], 36);
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
}), [["__scopeId", "data-v-71b23fec"]]);
|
|
916
|
+
var MessageTyping_default = /* @__PURE__ */ defineComponent({
|
|
917
|
+
__name: "MessageTyping",
|
|
918
|
+
props: { animation: { default: "bouncing" } },
|
|
919
|
+
setup(__props) {
|
|
920
|
+
const props = __props;
|
|
921
|
+
const message = {
|
|
922
|
+
id: "typing",
|
|
923
|
+
text: "",
|
|
924
|
+
sender: "bot"
|
|
925
|
+
};
|
|
926
|
+
const messageContainer = ref();
|
|
927
|
+
const classes = computed(() => {
|
|
928
|
+
return {
|
|
929
|
+
"chat-message-typing": true,
|
|
930
|
+
[`chat-message-typing-animation-${props.animation}`]: true
|
|
931
|
+
};
|
|
932
|
+
});
|
|
933
|
+
onMounted(() => {
|
|
934
|
+
messageContainer.value?.scrollToView();
|
|
935
|
+
});
|
|
936
|
+
return (_ctx, _cache) => {
|
|
937
|
+
return openBlock(), createBlock(unref(Message_default), {
|
|
938
|
+
ref_key: "messageContainer",
|
|
939
|
+
ref: messageContainer,
|
|
940
|
+
class: normalizeClass(classes.value),
|
|
941
|
+
message,
|
|
942
|
+
"data-test-id": "chat-message-typing"
|
|
943
|
+
}, {
|
|
944
|
+
default: withCtx(() => _cache[0] || (_cache[0] = [createBaseVNode("div", { class: "chat-message-typing-body" }, [
|
|
945
|
+
createBaseVNode("span", { class: "chat-message-typing-circle" }),
|
|
946
|
+
createBaseVNode("span", { class: "chat-message-typing-circle" }),
|
|
947
|
+
createBaseVNode("span", { class: "chat-message-typing-circle" })
|
|
948
|
+
], -1)])),
|
|
949
|
+
_: 1
|
|
950
|
+
}, 8, ["class"]);
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
});
|
|
954
|
+
var _hoisted_1$1 = {
|
|
955
|
+
key: 0,
|
|
956
|
+
class: "empty-container"
|
|
957
|
+
};
|
|
958
|
+
var _hoisted_2 = {
|
|
959
|
+
class: "empty",
|
|
960
|
+
"data-test-id": "chat-messages-empty"
|
|
961
|
+
};
|
|
962
|
+
var _hoisted_3 = {
|
|
963
|
+
key: 1,
|
|
964
|
+
class: "chat-messages-list"
|
|
965
|
+
};
|
|
966
|
+
var MessagesList_default = /* @__PURE__ */ defineComponent({
|
|
967
|
+
__name: "MessagesList",
|
|
968
|
+
props: {
|
|
969
|
+
messages: {},
|
|
970
|
+
emptyText: {}
|
|
971
|
+
},
|
|
972
|
+
setup(__props) {
|
|
973
|
+
const chatStore = useChat();
|
|
974
|
+
const messageComponents = ref([]);
|
|
975
|
+
const { initialMessages, waitingForResponse } = chatStore;
|
|
976
|
+
watch(() => messageComponents.value.length, () => {
|
|
977
|
+
const lastMessageComponent = messageComponents.value[messageComponents.value.length - 1];
|
|
978
|
+
if (lastMessageComponent) lastMessageComponent.scrollToView();
|
|
979
|
+
});
|
|
980
|
+
return (_ctx, _cache) => {
|
|
981
|
+
return _ctx.emptyText && unref(initialMessages).length === 0 && _ctx.messages.length === 0 ? (openBlock(), createElementBlock("div", _hoisted_1$1, [createBaseVNode("div", _hoisted_2, [createVNode(unref(N8nIcon_default), {
|
|
982
|
+
icon: "message-circle",
|
|
983
|
+
size: "large",
|
|
984
|
+
class: "emptyIcon"
|
|
985
|
+
}), createVNode(unref(N8nText_default), {
|
|
986
|
+
tag: "p",
|
|
987
|
+
size: "medium",
|
|
988
|
+
color: "text-base"
|
|
989
|
+
}, {
|
|
990
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.emptyText), 1)]),
|
|
991
|
+
_: 1
|
|
992
|
+
})])])) : (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
993
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(initialMessages), (initialMessage) => {
|
|
994
|
+
return openBlock(), createBlock(Message_default, {
|
|
995
|
+
key: initialMessage.id,
|
|
996
|
+
message: initialMessage
|
|
997
|
+
}, null, 8, ["message"]);
|
|
998
|
+
}), 128)),
|
|
999
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.messages, (message) => {
|
|
1000
|
+
return openBlock(), createBlock(Message_default, {
|
|
1001
|
+
key: message.id,
|
|
1002
|
+
ref_for: true,
|
|
1003
|
+
ref_key: "messageComponents",
|
|
1004
|
+
ref: messageComponents,
|
|
1005
|
+
message
|
|
1006
|
+
}, {
|
|
1007
|
+
beforeMessage: withCtx(({ message: message$1 }) => [renderSlot(_ctx.$slots, "beforeMessage", mergeProps({ ref_for: true }, { message: message$1 }))]),
|
|
1008
|
+
_: 2
|
|
1009
|
+
}, 1032, ["message"]);
|
|
1010
|
+
}), 128)),
|
|
1011
|
+
unref(waitingForResponse) ? (openBlock(), createBlock(MessageTyping_default, { key: 0 })) : createCommentVNode("", true)
|
|
1012
|
+
]));
|
|
1013
|
+
};
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
var MessageOptionTooltip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1017
|
+
__name: "MessageOptionTooltip",
|
|
1018
|
+
props: { placement: {
|
|
1019
|
+
type: String,
|
|
1020
|
+
default: "top"
|
|
1021
|
+
} },
|
|
1022
|
+
setup(__props) {
|
|
1023
|
+
return (_ctx, _cache) => {
|
|
1024
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.$style.container) }, [createVNode(unref(N8nTooltip_default), { placement: __props.placement }, {
|
|
1025
|
+
content: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
1026
|
+
default: withCtx(() => [createBaseVNode("span", { class: normalizeClass(_ctx.$style.icon) }, [createVNode(unref(N8nIcon_default), {
|
|
1027
|
+
icon: "info",
|
|
1028
|
+
size: "xsmall"
|
|
1029
|
+
})], 2)]),
|
|
1030
|
+
_: 3
|
|
1031
|
+
}, 8, ["placement"])], 2);
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1034
|
+
});
|
|
1035
|
+
var MessageOptionTooltip_vue_vue_type_style_index_0_lang_module_default = {
|
|
1036
|
+
container: "_container_e8qal_123",
|
|
1037
|
+
icon: "_icon_e8qal_129"
|
|
1038
|
+
};
|
|
1039
|
+
var MessageOptionTooltip_default = /* @__PURE__ */ __plugin_vue_export_helper_default(MessageOptionTooltip_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": MessageOptionTooltip_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1040
|
+
var MessageOptionAction_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1041
|
+
__name: "MessageOptionAction",
|
|
1042
|
+
props: {
|
|
1043
|
+
label: {},
|
|
1044
|
+
icon: {},
|
|
1045
|
+
placement: {}
|
|
1046
|
+
},
|
|
1047
|
+
setup(__props) {
|
|
1048
|
+
const attrs = useAttrs();
|
|
1049
|
+
const onClick = () => {
|
|
1050
|
+
attrs.onClick?.();
|
|
1051
|
+
};
|
|
1052
|
+
return (_ctx, _cache) => {
|
|
1053
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.$style.container) }, [createVNode(unref(N8nTooltip_default), { placement: _ctx.placement }, {
|
|
1054
|
+
content: withCtx(() => [createTextVNode(toDisplayString(_ctx.label), 1)]),
|
|
1055
|
+
default: withCtx(() => [createVNode(unref(N8nIcon_default), {
|
|
1056
|
+
class: normalizeClass(_ctx.$style.icon),
|
|
1057
|
+
icon: _ctx.icon,
|
|
1058
|
+
size: "xsmall",
|
|
1059
|
+
onClick
|
|
1060
|
+
}, null, 8, ["class", "icon"])]),
|
|
1061
|
+
_: 1
|
|
1062
|
+
}, 8, ["placement"])], 2);
|
|
1063
|
+
};
|
|
1064
|
+
}
|
|
1065
|
+
});
|
|
1066
|
+
var MessageOptionAction_vue_vue_type_style_index_0_lang_module_default = {
|
|
1067
|
+
container: "_container_19q7h_123",
|
|
1068
|
+
icon: "_icon_19q7h_129"
|
|
1069
|
+
};
|
|
1070
|
+
var MessageOptionAction_default = /* @__PURE__ */ __plugin_vue_export_helper_default(MessageOptionAction_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": MessageOptionAction_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1071
|
+
var _hoisted_1 = ["onClick"];
|
|
1072
|
+
var ChatMessagesPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1073
|
+
__name: "ChatMessagesPanel",
|
|
1074
|
+
props: {
|
|
1075
|
+
pastChatMessages: {},
|
|
1076
|
+
messages: {},
|
|
1077
|
+
sessionId: {},
|
|
1078
|
+
showCloseButton: { type: Boolean },
|
|
1079
|
+
isOpen: {
|
|
1080
|
+
type: Boolean,
|
|
1081
|
+
default: true
|
|
1082
|
+
},
|
|
1083
|
+
isReadOnly: {
|
|
1084
|
+
type: Boolean,
|
|
1085
|
+
default: false
|
|
1086
|
+
},
|
|
1087
|
+
isHeaderClickable: { type: Boolean }
|
|
1088
|
+
},
|
|
1089
|
+
emits: [
|
|
1090
|
+
"displayExecution",
|
|
1091
|
+
"sendMessage",
|
|
1092
|
+
"refreshSession",
|
|
1093
|
+
"close",
|
|
1094
|
+
"clickHeader"
|
|
1095
|
+
],
|
|
1096
|
+
setup(__props, { emit: __emit }) {
|
|
1097
|
+
const props = __props;
|
|
1098
|
+
const emit = __emit;
|
|
1099
|
+
const clipboard = useClipboard();
|
|
1100
|
+
const locale = useI18n();
|
|
1101
|
+
const toast = useToast();
|
|
1102
|
+
const previousMessageIndex = ref(-1);
|
|
1103
|
+
const currentInputBuffer = ref("");
|
|
1104
|
+
const sessionIdText = computed(() => locale.baseText("chat.window.session.id", { interpolate: { id: `${props.sessionId.slice(0, 5)}...` } }));
|
|
1105
|
+
const inputPlaceholder = computed(() => {
|
|
1106
|
+
if (props.messages.length > 0) return locale.baseText("chat.window.chat.placeholder");
|
|
1107
|
+
return locale.baseText("chat.window.chat.placeholderPristine");
|
|
1108
|
+
});
|
|
1109
|
+
function isTextMessage(message) {
|
|
1110
|
+
return message.type === "text" || !message.type;
|
|
1111
|
+
}
|
|
1112
|
+
function repostMessage(message) {
|
|
1113
|
+
sendMessage(message.text);
|
|
1114
|
+
}
|
|
1115
|
+
function reuseMessage(message) {
|
|
1116
|
+
chatEventBus.emit("setInputValue", message.text);
|
|
1117
|
+
}
|
|
1118
|
+
function sendMessage(message) {
|
|
1119
|
+
previousMessageIndex.value = -1;
|
|
1120
|
+
currentInputBuffer.value = "";
|
|
1121
|
+
emit("sendMessage", message);
|
|
1122
|
+
}
|
|
1123
|
+
function onRefreshSession() {
|
|
1124
|
+
emit("refreshSession");
|
|
1125
|
+
}
|
|
1126
|
+
function onArrowKeyDown({ currentInputValue, key }) {
|
|
1127
|
+
const pastMessages = props.pastChatMessages;
|
|
1128
|
+
if (pastMessages.length === 0) return;
|
|
1129
|
+
if (currentInputValue.length === 0 && previousMessageIndex.value !== -1) {
|
|
1130
|
+
previousMessageIndex.value = -1;
|
|
1131
|
+
currentInputBuffer.value = "";
|
|
1132
|
+
}
|
|
1133
|
+
if (previousMessageIndex.value === -1 && currentInputValue.length > 0) currentInputBuffer.value = currentInputValue;
|
|
1134
|
+
if (key === "ArrowUp") {
|
|
1135
|
+
chatEventBus.emit("blurInput");
|
|
1136
|
+
if (previousMessageIndex.value === -1) previousMessageIndex.value = pastMessages.length - 1;
|
|
1137
|
+
else if (previousMessageIndex.value > 0) previousMessageIndex.value--;
|
|
1138
|
+
const selectedMessage = pastMessages[previousMessageIndex.value];
|
|
1139
|
+
chatEventBus.emit("setInputValue", selectedMessage);
|
|
1140
|
+
chatEventBus.emit("focusInput");
|
|
1141
|
+
} else if (key === "ArrowDown") {
|
|
1142
|
+
if (previousMessageIndex.value === -1) return;
|
|
1143
|
+
chatEventBus.emit("blurInput");
|
|
1144
|
+
if (previousMessageIndex.value < pastMessages.length - 1) {
|
|
1145
|
+
previousMessageIndex.value++;
|
|
1146
|
+
const selectedMessage = pastMessages[previousMessageIndex.value];
|
|
1147
|
+
chatEventBus.emit("setInputValue", selectedMessage);
|
|
1148
|
+
} else {
|
|
1149
|
+
previousMessageIndex.value = -1;
|
|
1150
|
+
chatEventBus.emit("setInputValue", currentInputBuffer.value);
|
|
1151
|
+
currentInputBuffer.value = "";
|
|
1152
|
+
}
|
|
1153
|
+
chatEventBus.emit("focusInput");
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
function onEscapeKey() {
|
|
1157
|
+
if (previousMessageIndex.value === -1) return;
|
|
1158
|
+
previousMessageIndex.value = -1;
|
|
1159
|
+
chatEventBus.emit("setInputValue", currentInputBuffer.value);
|
|
1160
|
+
currentInputBuffer.value = "";
|
|
1161
|
+
}
|
|
1162
|
+
async function copySessionId() {
|
|
1163
|
+
await clipboard.copy(props.sessionId);
|
|
1164
|
+
toast.showMessage({
|
|
1165
|
+
title: locale.baseText("generic.copiedToClipboard"),
|
|
1166
|
+
message: "",
|
|
1167
|
+
type: "success"
|
|
1168
|
+
});
|
|
1169
|
+
}
|
|
1170
|
+
return (_ctx, _cache) => {
|
|
1171
|
+
return openBlock(), createElementBlock("div", {
|
|
1172
|
+
class: normalizeClass([_ctx.$style.chat, "ignore-key-press-canvas"]),
|
|
1173
|
+
"data-test-id": "workflow-lm-chat-dialog",
|
|
1174
|
+
tabindex: "0"
|
|
1175
|
+
}, [
|
|
1176
|
+
createVNode(LogsPanelHeader_default, {
|
|
1177
|
+
"data-test-id": "chat-header",
|
|
1178
|
+
title: unref(locale).baseText("chat.window.title"),
|
|
1179
|
+
"is-clickable": _ctx.isHeaderClickable,
|
|
1180
|
+
onClick: _cache[0] || (_cache[0] = ($event) => emit("clickHeader"))
|
|
1181
|
+
}, {
|
|
1182
|
+
actions: withCtx(() => [unref(clipboard).isSupported && !_ctx.isReadOnly ? (openBlock(), createBlock(unref(N8nTooltip_default), { key: 0 }, {
|
|
1183
|
+
content: withCtx(() => [
|
|
1184
|
+
createTextVNode(toDisplayString(_ctx.sessionId) + " ", 1),
|
|
1185
|
+
_cache[3] || (_cache[3] = createBaseVNode("br", null, null, -1)),
|
|
1186
|
+
createTextVNode(" " + toDisplayString(unref(locale).baseText("chat.window.session.id.copy")), 1)
|
|
1187
|
+
]),
|
|
1188
|
+
default: withCtx(() => [createVNode(unref(N8nButton_default), {
|
|
1189
|
+
"data-test-id": "chat-session-id",
|
|
1190
|
+
type: "secondary",
|
|
1191
|
+
size: "mini",
|
|
1192
|
+
class: normalizeClass(_ctx.$style.newHeaderButton),
|
|
1193
|
+
onClick: withModifiers(copySessionId, ["stop"])
|
|
1194
|
+
}, {
|
|
1195
|
+
default: withCtx(() => [createTextVNode(toDisplayString(sessionIdText.value), 1)]),
|
|
1196
|
+
_: 1
|
|
1197
|
+
}, 8, ["class"])]),
|
|
1198
|
+
_: 1
|
|
1199
|
+
})) : createCommentVNode("", true), _ctx.messages.length > 0 && !_ctx.isReadOnly ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
1200
|
+
key: 1,
|
|
1201
|
+
content: unref(locale).baseText("chat.window.session.resetSession")
|
|
1202
|
+
}, {
|
|
1203
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
1204
|
+
class: normalizeClass(_ctx.$style.newHeaderButton),
|
|
1205
|
+
"data-test-id": "refresh-session-button",
|
|
1206
|
+
outline: "",
|
|
1207
|
+
type: "secondary",
|
|
1208
|
+
size: "small",
|
|
1209
|
+
"icon-size": "medium",
|
|
1210
|
+
icon: "undo-2",
|
|
1211
|
+
title: unref(locale).baseText("chat.window.session.reset"),
|
|
1212
|
+
onClick: withModifiers(onRefreshSession, ["stop"])
|
|
1213
|
+
}, null, 8, ["class", "title"])]),
|
|
1214
|
+
_: 1
|
|
1215
|
+
}, 8, ["content"])) : createCommentVNode("", true)]),
|
|
1216
|
+
_: 1
|
|
1217
|
+
}, 8, ["title", "is-clickable"]),
|
|
1218
|
+
_ctx.isOpen ? (openBlock(), createElementBlock("main", {
|
|
1219
|
+
key: 0,
|
|
1220
|
+
class: normalizeClass(_ctx.$style.chatBody),
|
|
1221
|
+
"data-test-id": "canvas-chat-body"
|
|
1222
|
+
}, [createVNode(MessagesList_default, {
|
|
1223
|
+
messages: _ctx.messages,
|
|
1224
|
+
class: normalizeClass(_ctx.$style.messages),
|
|
1225
|
+
"empty-text": unref(locale).baseText("chat.window.chat.emptyChatMessage.v2")
|
|
1226
|
+
}, {
|
|
1227
|
+
beforeMessage: withCtx(({ message }) => [
|
|
1228
|
+
!_ctx.isReadOnly && message.sender === "bot" && !message.id.includes("preload") ? (openBlock(), createBlock(MessageOptionTooltip_default, {
|
|
1229
|
+
key: 0,
|
|
1230
|
+
placement: "right",
|
|
1231
|
+
"data-test-id": "execution-id-tooltip"
|
|
1232
|
+
}, {
|
|
1233
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("chat.window.chat.chatMessageOptions.executionId")) + ": ", 1), createBaseVNode("a", {
|
|
1234
|
+
href: "#",
|
|
1235
|
+
onClick: ($event) => emit("displayExecution", message.id)
|
|
1236
|
+
}, toDisplayString(message.id), 9, _hoisted_1)]),
|
|
1237
|
+
_: 2
|
|
1238
|
+
}, 1024)) : createCommentVNode("", true),
|
|
1239
|
+
!_ctx.isReadOnly && isTextMessage(message) && message.sender === "user" ? (openBlock(), createBlock(MessageOptionAction_default, {
|
|
1240
|
+
key: 1,
|
|
1241
|
+
"data-test-id": "repost-message-button",
|
|
1242
|
+
icon: "redo-2",
|
|
1243
|
+
label: unref(locale).baseText("chat.window.chat.chatMessageOptions.repostMessage"),
|
|
1244
|
+
placement: "left",
|
|
1245
|
+
onClickOnce: ($event) => repostMessage(message)
|
|
1246
|
+
}, null, 8, ["label", "onClickOnce"])) : createCommentVNode("", true),
|
|
1247
|
+
!_ctx.isReadOnly && isTextMessage(message) && message.sender === "user" ? (openBlock(), createBlock(MessageOptionAction_default, {
|
|
1248
|
+
key: 2,
|
|
1249
|
+
"data-test-id": "reuse-message-button",
|
|
1250
|
+
icon: "files",
|
|
1251
|
+
label: unref(locale).baseText("chat.window.chat.chatMessageOptions.reuseMessage"),
|
|
1252
|
+
placement: "left",
|
|
1253
|
+
onClick: ($event) => reuseMessage(message)
|
|
1254
|
+
}, null, 8, ["label", "onClick"])) : createCommentVNode("", true)
|
|
1255
|
+
]),
|
|
1256
|
+
_: 1
|
|
1257
|
+
}, 8, [
|
|
1258
|
+
"messages",
|
|
1259
|
+
"class",
|
|
1260
|
+
"empty-text"
|
|
1261
|
+
])], 2)) : createCommentVNode("", true),
|
|
1262
|
+
_ctx.isOpen ? (openBlock(), createElementBlock("div", {
|
|
1263
|
+
key: 1,
|
|
1264
|
+
class: normalizeClass(_ctx.$style.messagesInput)
|
|
1265
|
+
}, [createVNode(Input_default, {
|
|
1266
|
+
"data-test-id": "lm-chat-inputs",
|
|
1267
|
+
placeholder: inputPlaceholder.value,
|
|
1268
|
+
onArrowKeyDown,
|
|
1269
|
+
onEscapeKeyDown: onEscapeKey
|
|
1270
|
+
}, createSlots({ _: 2 }, [_ctx.pastChatMessages.length > 0 ? {
|
|
1271
|
+
name: "leftPanel",
|
|
1272
|
+
fn: withCtx(() => [createBaseVNode("div", { class: normalizeClass(_ctx.$style.messagesHistory) }, [createVNode(unref(N8nButton_default), {
|
|
1273
|
+
title: "Navigate to previous message",
|
|
1274
|
+
icon: "chevron-up",
|
|
1275
|
+
type: "tertiary",
|
|
1276
|
+
text: "",
|
|
1277
|
+
size: "mini",
|
|
1278
|
+
disabled: previousMessageIndex.value === 0,
|
|
1279
|
+
onClick: _cache[1] || (_cache[1] = ($event) => onArrowKeyDown({
|
|
1280
|
+
currentInputValue: "",
|
|
1281
|
+
key: "ArrowUp"
|
|
1282
|
+
}))
|
|
1283
|
+
}, null, 8, ["disabled"]), createVNode(unref(N8nButton_default), {
|
|
1284
|
+
title: "Navigate to next message",
|
|
1285
|
+
icon: "chevron-down",
|
|
1286
|
+
type: "tertiary",
|
|
1287
|
+
text: "",
|
|
1288
|
+
size: "mini",
|
|
1289
|
+
disabled: previousMessageIndex.value === -1,
|
|
1290
|
+
onClick: _cache[2] || (_cache[2] = ($event) => onArrowKeyDown({
|
|
1291
|
+
currentInputValue: "",
|
|
1292
|
+
key: "ArrowDown"
|
|
1293
|
+
}))
|
|
1294
|
+
}, null, 8, ["disabled"])], 2)]),
|
|
1295
|
+
key: "0"
|
|
1296
|
+
} : void 0]), 1032, ["placeholder"])], 2)) : createCommentVNode("", true)
|
|
1297
|
+
], 2);
|
|
1298
|
+
};
|
|
1299
|
+
}
|
|
1300
|
+
});
|
|
1301
|
+
var ChatMessagesPanel_vue_vue_type_style_index_0_lang_module_default = {
|
|
1302
|
+
chat: "_chat_1lcb4_123",
|
|
1303
|
+
chatHeader: "_chatHeader_1lcb4_151",
|
|
1304
|
+
chatTitle: "_chatTitle_1lcb4_164",
|
|
1305
|
+
session: "_session_1lcb4_168",
|
|
1306
|
+
sessionId: "_sessionId_1lcb4_176",
|
|
1307
|
+
copyable: "_copyable_1lcb4_182",
|
|
1308
|
+
headerButton: "_headerButton_1lcb4_186",
|
|
1309
|
+
newHeaderButton: "_newHeaderButton_1lcb4_191",
|
|
1310
|
+
chatBody: "_chatBody_1lcb4_196",
|
|
1311
|
+
messages: "_messages_1lcb4_205",
|
|
1312
|
+
messagesInput: "_messagesInput_1lcb4_216",
|
|
1313
|
+
messagesHistory: "_messagesHistory_1lcb4_250"
|
|
1314
|
+
};
|
|
1315
|
+
var ChatMessagesPanel_default = /* @__PURE__ */ __plugin_vue_export_helper_default(ChatMessagesPanel_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": ChatMessagesPanel_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1316
|
+
var LogsViewRunData_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1317
|
+
__name: "LogsViewRunData",
|
|
1318
|
+
props: {
|
|
1319
|
+
title: {},
|
|
1320
|
+
paneType: {},
|
|
1321
|
+
logEntry: {},
|
|
1322
|
+
collapsingTableColumnName: {},
|
|
1323
|
+
searchShortcut: {}
|
|
1324
|
+
},
|
|
1325
|
+
emits: ["collapsingTableColumnChanged"],
|
|
1326
|
+
setup(__props, { emit: __emit }) {
|
|
1327
|
+
const emit = __emit;
|
|
1328
|
+
const locale = useI18n();
|
|
1329
|
+
const ndvStore = useNDVStore();
|
|
1330
|
+
const popOutWindow = inject(PopOutWindowKey, ref());
|
|
1331
|
+
const displayMode = ref(__props.paneType === "input" ? "schema" : "table");
|
|
1332
|
+
const isMultipleInput = computed(() => __props.paneType === "input" && (__props.logEntry.runData?.source.length ?? 0) > 1);
|
|
1333
|
+
const runDataProps = computed(() => {
|
|
1334
|
+
if (isSubNodeLog(__props.logEntry) || __props.paneType === "output") return {
|
|
1335
|
+
node: __props.logEntry.node,
|
|
1336
|
+
runIndex: __props.logEntry.runIndex
|
|
1337
|
+
};
|
|
1338
|
+
const source = __props.logEntry.runData?.source[0];
|
|
1339
|
+
const node = source && __props.logEntry.workflow.getNode(source.previousNode);
|
|
1340
|
+
if (!source || !node) return;
|
|
1341
|
+
return {
|
|
1342
|
+
node: {
|
|
1343
|
+
...node,
|
|
1344
|
+
disabled: false
|
|
1345
|
+
},
|
|
1346
|
+
runIndex: source.previousNodeRun ?? 0,
|
|
1347
|
+
overrideOutputs: [source.previousNodeOutput ?? 0]
|
|
1348
|
+
};
|
|
1349
|
+
});
|
|
1350
|
+
const isExecuting = computed(() => __props.paneType === "output" && (__props.logEntry.runData?.executionStatus === "running" || __props.logEntry.runData?.executionStatus === "waiting"));
|
|
1351
|
+
function handleClickOpenNdv() {
|
|
1352
|
+
ndvStore.setActiveNodeName(__props.logEntry.node.name, "logs_view");
|
|
1353
|
+
}
|
|
1354
|
+
function handleChangeDisplayMode(value) {
|
|
1355
|
+
displayMode.value = value;
|
|
1356
|
+
}
|
|
1357
|
+
return (_ctx, _cache) => {
|
|
1358
|
+
const _directive_n8n_html = resolveDirective("n8n-html");
|
|
1359
|
+
return runDataProps.value ? (openBlock(), createBlock(RunData_default, mergeProps({ key: 0 }, runDataProps.value, {
|
|
1360
|
+
key: `run-data${unref(popOutWindow) ? "-pop-out" : ""}`,
|
|
1361
|
+
class: _ctx.$style.component,
|
|
1362
|
+
"workflow-object": _ctx.logEntry.workflow,
|
|
1363
|
+
"workflow-execution": _ctx.logEntry.execution,
|
|
1364
|
+
"no-data-in-branch-message": unref(locale).baseText("ndv.output.noOutputDataInBranch"),
|
|
1365
|
+
"executing-message": unref(locale).baseText("ndv.output.executing"),
|
|
1366
|
+
"pane-type": _ctx.paneType,
|
|
1367
|
+
"disable-run-index-selection": true,
|
|
1368
|
+
compact: true,
|
|
1369
|
+
"show-actions-on-hover": true,
|
|
1370
|
+
"disable-pin": true,
|
|
1371
|
+
"disable-edit": true,
|
|
1372
|
+
"disable-hover-highlight": true,
|
|
1373
|
+
"disable-settings-hint": true,
|
|
1374
|
+
"display-mode": displayMode.value,
|
|
1375
|
+
"disable-ai-content": !unref(isSubNodeLog)(_ctx.logEntry),
|
|
1376
|
+
"is-executing": isExecuting.value,
|
|
1377
|
+
"table-header-bg-color": "light",
|
|
1378
|
+
"collapsing-table-column-name": _ctx.collapsingTableColumnName,
|
|
1379
|
+
"search-shortcut": _ctx.searchShortcut,
|
|
1380
|
+
onDisplayModeChange: handleChangeDisplayMode,
|
|
1381
|
+
onCollapsingTableColumnChanged: _cache[0] || (_cache[0] = ($event) => emit("collapsingTableColumnChanged", $event))
|
|
1382
|
+
}), createSlots({
|
|
1383
|
+
header: withCtx(() => [createVNode(unref(N8nText_default), {
|
|
1384
|
+
class: normalizeClass(_ctx.$style.title),
|
|
1385
|
+
bold: true,
|
|
1386
|
+
color: "text-light",
|
|
1387
|
+
size: "small"
|
|
1388
|
+
}, {
|
|
1389
|
+
default: withCtx(() => [createTextVNode(toDisplayString(_ctx.title), 1)]),
|
|
1390
|
+
_: 1
|
|
1391
|
+
}, 8, ["class"])]),
|
|
1392
|
+
"header-end": withCtx((itemCountProps) => [createVNode(RunDataItemCount_default, mergeProps(itemCountProps, { search: displayMode.value === "schema" ? "" : itemCountProps.search }), null, 16, ["search"])]),
|
|
1393
|
+
"no-output-data": withCtx(() => [createVNode(NDVEmptyState_default, { title: unref(locale).baseText("ndv.output.noOutputData.title") }, null, 8, ["title"])]),
|
|
1394
|
+
"node-waiting": withCtx(() => [createVNode(NDVEmptyState_default, {
|
|
1395
|
+
title: unref(locale).baseText("ndv.output.waitNodeWaiting.title"),
|
|
1396
|
+
wide: ""
|
|
1397
|
+
}, {
|
|
1398
|
+
default: withCtx(() => [withDirectives(createBaseVNode("span", null, null, 512), [[_directive_n8n_html, unref(waitingNodeTooltip)(_ctx.logEntry.node, _ctx.logEntry.workflow)]])]),
|
|
1399
|
+
_: 1
|
|
1400
|
+
}, 8, ["title"])]),
|
|
1401
|
+
_: 2
|
|
1402
|
+
}, [isMultipleInput.value ? {
|
|
1403
|
+
name: "content",
|
|
1404
|
+
fn: withCtx(() => []),
|
|
1405
|
+
key: "0"
|
|
1406
|
+
} : void 0, isMultipleInput.value ? {
|
|
1407
|
+
name: "callout-message",
|
|
1408
|
+
fn: withCtx(() => [createVNode(unref(I18nT), {
|
|
1409
|
+
keypath: "logs.details.body.multipleInputs",
|
|
1410
|
+
scope: "global"
|
|
1411
|
+
}, {
|
|
1412
|
+
button: withCtx(() => [createVNode(unref(N8nLink_default), {
|
|
1413
|
+
size: "small",
|
|
1414
|
+
onClick: handleClickOpenNdv
|
|
1415
|
+
}, {
|
|
1416
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("logs.details.body.multipleInputs.openingTheNode")), 1)]),
|
|
1417
|
+
_: 1
|
|
1418
|
+
})]),
|
|
1419
|
+
_: 1
|
|
1420
|
+
})]),
|
|
1421
|
+
key: "1"
|
|
1422
|
+
} : void 0]), 1040, [
|
|
1423
|
+
"class",
|
|
1424
|
+
"workflow-object",
|
|
1425
|
+
"workflow-execution",
|
|
1426
|
+
"no-data-in-branch-message",
|
|
1427
|
+
"executing-message",
|
|
1428
|
+
"pane-type",
|
|
1429
|
+
"display-mode",
|
|
1430
|
+
"disable-ai-content",
|
|
1431
|
+
"is-executing",
|
|
1432
|
+
"collapsing-table-column-name",
|
|
1433
|
+
"search-shortcut"
|
|
1434
|
+
])) : createCommentVNode("", true);
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
});
|
|
1438
|
+
var LogsViewRunData_vue_vue_type_style_index_0_lang_module_default = {
|
|
1439
|
+
component: "_component_1mnpf_123",
|
|
1440
|
+
title: "_title_1mnpf_127"
|
|
1441
|
+
};
|
|
1442
|
+
var LogsViewRunData_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogsViewRunData_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogsViewRunData_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1443
|
+
function useResizablePanel(localStorageKey, { container: container$8, defaultSize, snap = true, minSize = 0, maxSize = (size) => size, position = "left", allowCollapse, allowFullSize }) {
|
|
1444
|
+
const containerSize = ref(0);
|
|
1445
|
+
const persistedSize = useLocalStorage(localStorageKey, -1, { writeDefaults: false });
|
|
1446
|
+
const isResizing = ref(false);
|
|
1447
|
+
const sizeOnResizeStart = ref();
|
|
1448
|
+
const minSizeValue = computed(() => resolveSize(minSize, containerSize.value));
|
|
1449
|
+
const maxSizeValue = computed(() => resolveSize(maxSize, containerSize.value));
|
|
1450
|
+
const constrainedSize = computed(() => {
|
|
1451
|
+
const sizeInPixels = persistedSize.value >= 0 && persistedSize.value <= 1 ? containerSize.value * persistedSize.value : -1;
|
|
1452
|
+
if (isResizing.value && allowCollapse && sizeInPixels < 30) return 0;
|
|
1453
|
+
if (isResizing.value && allowFullSize && sizeInPixels > containerSize.value - 30) return containerSize.value;
|
|
1454
|
+
const defaultSizeValue = resolveSize(defaultSize, containerSize.value);
|
|
1455
|
+
if (Number.isNaN(sizeInPixels) || !Number.isFinite(sizeInPixels) || sizeInPixels < 0) return defaultSizeValue;
|
|
1456
|
+
return Math.max(minSizeValue.value, Math.min(snap && Math.abs(defaultSizeValue - sizeInPixels) < 30 ? defaultSizeValue : sizeInPixels, maxSizeValue.value));
|
|
1457
|
+
});
|
|
1458
|
+
function getSize(el) {
|
|
1459
|
+
return position === "bottom" ? el.height : el.width;
|
|
1460
|
+
}
|
|
1461
|
+
function getOffsetSize(el) {
|
|
1462
|
+
return position === "bottom" ? el.offsetHeight : el.offsetWidth;
|
|
1463
|
+
}
|
|
1464
|
+
function getValue(data) {
|
|
1465
|
+
return position === "bottom" ? data.y : data.x;
|
|
1466
|
+
}
|
|
1467
|
+
function resolveSize(getter, containerSizeValue) {
|
|
1468
|
+
return typeof getter === "number" ? getter : getter(containerSizeValue);
|
|
1469
|
+
}
|
|
1470
|
+
function onResize(data) {
|
|
1471
|
+
const containerRect = unref(container$8)?.getBoundingClientRect();
|
|
1472
|
+
const newSizeInPixels = Math.max(0, position === "bottom" ? (containerRect ? getSize(containerRect) : 0) - getValue(data) : getValue(data) - (containerRect ? getValue(containerRect) : 0));
|
|
1473
|
+
isResizing.value = true;
|
|
1474
|
+
persistedSize.value = newSizeInPixels / containerSize.value;
|
|
1475
|
+
if (sizeOnResizeStart.value === void 0) sizeOnResizeStart.value = persistedSize.value;
|
|
1476
|
+
}
|
|
1477
|
+
function onResizeEnd() {
|
|
1478
|
+
if (minSizeValue.value > 0 && constrainedSize.value <= 0 || maxSizeValue.value < containerSize.value && constrainedSize.value >= containerSize.value) persistedSize.value = sizeOnResizeStart.value;
|
|
1479
|
+
sizeOnResizeStart.value = void 0;
|
|
1480
|
+
isResizing.value = false;
|
|
1481
|
+
}
|
|
1482
|
+
watch(() => unref(container$8), (el, _, onCleanUp) => {
|
|
1483
|
+
if (!el) return;
|
|
1484
|
+
const observer = new ResizeObserver(() => {
|
|
1485
|
+
containerSize.value = getOffsetSize(el);
|
|
1486
|
+
});
|
|
1487
|
+
observer.observe(el);
|
|
1488
|
+
containerSize.value = getOffsetSize(el);
|
|
1489
|
+
onCleanUp(() => observer.disconnect());
|
|
1490
|
+
}, { immediate: true });
|
|
1491
|
+
return {
|
|
1492
|
+
isResizing: computed(() => isResizing.value),
|
|
1493
|
+
isCollapsed: computed(() => isResizing.value && constrainedSize.value <= 0),
|
|
1494
|
+
isFullSize: computed(() => isResizing.value && constrainedSize.value >= containerSize.value),
|
|
1495
|
+
size: constrainedSize,
|
|
1496
|
+
onResize,
|
|
1497
|
+
onResizeEnd
|
|
1498
|
+
};
|
|
1499
|
+
}
|
|
1500
|
+
var MIN_IO_PANEL_WIDTH = 200;
|
|
1501
|
+
var LogDetailsPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1502
|
+
__name: "LogDetailsPanel",
|
|
1503
|
+
props: {
|
|
1504
|
+
isOpen: { type: Boolean },
|
|
1505
|
+
logEntry: {},
|
|
1506
|
+
window: {},
|
|
1507
|
+
latestInfo: {},
|
|
1508
|
+
panels: {},
|
|
1509
|
+
collapsingInputTableColumnName: {},
|
|
1510
|
+
collapsingOutputTableColumnName: {},
|
|
1511
|
+
isHeaderClickable: { type: Boolean }
|
|
1512
|
+
},
|
|
1513
|
+
emits: [
|
|
1514
|
+
"clickHeader",
|
|
1515
|
+
"toggleInputOpen",
|
|
1516
|
+
"toggleOutputOpen",
|
|
1517
|
+
"collapsingInputTableColumnChanged",
|
|
1518
|
+
"collapsingOutputTableColumnChanged"
|
|
1519
|
+
],
|
|
1520
|
+
setup(__props, { emit: __emit }) {
|
|
1521
|
+
const emit = __emit;
|
|
1522
|
+
const locale = useI18n();
|
|
1523
|
+
const nodeTypeStore = useNodeTypesStore();
|
|
1524
|
+
const ndvStore = useNDVStore();
|
|
1525
|
+
const experimentalNdvStore = useExperimentalNdvStore();
|
|
1526
|
+
const type = computed(() => nodeTypeStore.getNodeType(__props.logEntry.node.type));
|
|
1527
|
+
const consumedTokens = computed(() => getSubtreeTotalConsumedTokens(__props.logEntry, false));
|
|
1528
|
+
const isTriggerNode = computed(() => type.value?.group.includes("trigger"));
|
|
1529
|
+
const container$8 = useTemplateRef("container");
|
|
1530
|
+
const resizer = useResizablePanel("N8N_LOGS_INPUT_PANEL_WIDTH", {
|
|
1531
|
+
container: container$8,
|
|
1532
|
+
defaultSize: (size) => size / 2,
|
|
1533
|
+
minSize: MIN_IO_PANEL_WIDTH,
|
|
1534
|
+
maxSize: (size) => size - MIN_IO_PANEL_WIDTH,
|
|
1535
|
+
allowCollapse: true,
|
|
1536
|
+
allowFullSize: true
|
|
1537
|
+
});
|
|
1538
|
+
const shouldResize = computed(() => __props.panels === LOG_DETAILS_PANEL_STATE.BOTH);
|
|
1539
|
+
const searchShortcutPriorityPanel = computed(() => ndvStore.isNDVOpen || experimentalNdvStore.isMapperOpen ? void 0 : __props.panels === LOG_DETAILS_PANEL_STATE.INPUT ? "input" : "output");
|
|
1540
|
+
function handleResizeEnd() {
|
|
1541
|
+
if (resizer.isCollapsed.value) emit("toggleInputOpen", false);
|
|
1542
|
+
if (resizer.isFullSize.value) emit("toggleOutputOpen", false);
|
|
1543
|
+
resizer.onResizeEnd();
|
|
1544
|
+
}
|
|
1545
|
+
return (_ctx, _cache) => {
|
|
1546
|
+
return openBlock(), createElementBlock("div", {
|
|
1547
|
+
ref_key: "container",
|
|
1548
|
+
ref: container$8,
|
|
1549
|
+
class: normalizeClass(_ctx.$style.container),
|
|
1550
|
+
"data-test-id": "log-details"
|
|
1551
|
+
}, [createVNode(LogsPanelHeader_default, {
|
|
1552
|
+
"data-test-id": "log-details-header",
|
|
1553
|
+
class: normalizeClass(_ctx.$style.header),
|
|
1554
|
+
"is-clickable": _ctx.isHeaderClickable,
|
|
1555
|
+
onClick: _cache[2] || (_cache[2] = ($event) => emit("clickHeader"))
|
|
1556
|
+
}, {
|
|
1557
|
+
title: withCtx(() => [createBaseVNode("div", { class: normalizeClass(_ctx.$style.title) }, [
|
|
1558
|
+
createVNode(NodeIcon_default, {
|
|
1559
|
+
"node-type": type.value,
|
|
1560
|
+
size: 16,
|
|
1561
|
+
class: normalizeClass(_ctx.$style.icon)
|
|
1562
|
+
}, null, 8, ["node-type", "class"]),
|
|
1563
|
+
createVNode(LogsViewNodeName_default, {
|
|
1564
|
+
name: _ctx.latestInfo?.name ?? _ctx.logEntry.node.name,
|
|
1565
|
+
"is-deleted": _ctx.latestInfo?.deleted ?? false
|
|
1566
|
+
}, null, 8, ["name", "is-deleted"]),
|
|
1567
|
+
_ctx.isOpen && _ctx.logEntry.runData !== void 0 ? (openBlock(), createBlock(LogsViewExecutionSummary_default, {
|
|
1568
|
+
key: 0,
|
|
1569
|
+
class: normalizeClass(_ctx.$style.executionSummary),
|
|
1570
|
+
status: _ctx.logEntry.runData.executionStatus ?? "unknown",
|
|
1571
|
+
"consumed-tokens": consumedTokens.value,
|
|
1572
|
+
"start-time": _ctx.logEntry.runData.startTime,
|
|
1573
|
+
"time-took": _ctx.logEntry.runData.executionTime
|
|
1574
|
+
}, null, 8, [
|
|
1575
|
+
"class",
|
|
1576
|
+
"status",
|
|
1577
|
+
"consumed-tokens",
|
|
1578
|
+
"start-time",
|
|
1579
|
+
"time-took"
|
|
1580
|
+
])) : createCommentVNode("", true)
|
|
1581
|
+
], 2)]),
|
|
1582
|
+
actions: withCtx(() => [_ctx.isOpen && !isTriggerNode.value && !unref(isPlaceholderLog)(_ctx.logEntry) ? (openBlock(), createElementBlock("div", {
|
|
1583
|
+
key: 0,
|
|
1584
|
+
class: normalizeClass(_ctx.$style.actions)
|
|
1585
|
+
}, [createVNode(KeyboardShortcutTooltip_default, {
|
|
1586
|
+
label: unref(locale).baseText("generic.shortcutHint"),
|
|
1587
|
+
shortcut: { keys: ["i"] }
|
|
1588
|
+
}, {
|
|
1589
|
+
default: withCtx(() => [createVNode(unref(N8nButton_default), {
|
|
1590
|
+
size: "mini",
|
|
1591
|
+
type: "secondary",
|
|
1592
|
+
class: normalizeClass(_ctx.panels === unref(LOG_DETAILS_PANEL_STATE).OUTPUT ? "" : _ctx.$style.pressed),
|
|
1593
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("toggleInputOpen"), ["stop"]))
|
|
1594
|
+
}, {
|
|
1595
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("logs.details.header.actions.input")), 1)]),
|
|
1596
|
+
_: 1
|
|
1597
|
+
}, 8, ["class"])]),
|
|
1598
|
+
_: 1
|
|
1599
|
+
}, 8, ["label"]), createVNode(KeyboardShortcutTooltip_default, {
|
|
1600
|
+
label: unref(locale).baseText("generic.shortcutHint"),
|
|
1601
|
+
shortcut: { keys: ["o"] }
|
|
1602
|
+
}, {
|
|
1603
|
+
default: withCtx(() => [createVNode(unref(N8nButton_default), {
|
|
1604
|
+
size: "mini",
|
|
1605
|
+
type: "secondary",
|
|
1606
|
+
class: normalizeClass(_ctx.panels === unref(LOG_DETAILS_PANEL_STATE).INPUT ? "" : _ctx.$style.pressed),
|
|
1607
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(($event) => emit("toggleOutputOpen"), ["stop"]))
|
|
1608
|
+
}, {
|
|
1609
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("logs.details.header.actions.output")), 1)]),
|
|
1610
|
+
_: 1
|
|
1611
|
+
}, 8, ["class"])]),
|
|
1612
|
+
_: 1
|
|
1613
|
+
}, 8, ["label"])], 2)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "actions")]),
|
|
1614
|
+
_: 3
|
|
1615
|
+
}, 8, ["class", "is-clickable"]), _ctx.isOpen ? (openBlock(), createElementBlock("div", {
|
|
1616
|
+
key: 0,
|
|
1617
|
+
class: normalizeClass(_ctx.$style.content),
|
|
1618
|
+
"data-test-id": "logs-details-body"
|
|
1619
|
+
}, [unref(isPlaceholderLog)(_ctx.logEntry) ? (openBlock(), createElementBlock("div", {
|
|
1620
|
+
key: 0,
|
|
1621
|
+
class: normalizeClass(_ctx.$style.placeholder)
|
|
1622
|
+
}, [createVNode(unref(N8nText_default), { color: "text-base" }, {
|
|
1623
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(locale).baseText("ndv.output.runNodeHint")), 1)]),
|
|
1624
|
+
_: 1
|
|
1625
|
+
})], 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [!isTriggerNode.value && _ctx.panels !== unref(LOG_DETAILS_PANEL_STATE).OUTPUT ? (openBlock(), createBlock(unref(N8nResizeWrapper_default), {
|
|
1626
|
+
key: 0,
|
|
1627
|
+
class: normalizeClass({
|
|
1628
|
+
[_ctx.$style.inputResizer]: true,
|
|
1629
|
+
[_ctx.$style.collapsed]: unref(resizer).isCollapsed.value,
|
|
1630
|
+
[_ctx.$style.full]: unref(resizer).isFullSize.value
|
|
1631
|
+
}),
|
|
1632
|
+
width: unref(resizer).size.value,
|
|
1633
|
+
style: normalizeStyle(shouldResize.value ? { width: `${unref(resizer).size.value ?? 0}px` } : void 0),
|
|
1634
|
+
"supported-directions": ["right"],
|
|
1635
|
+
"is-resizing-enabled": shouldResize.value,
|
|
1636
|
+
window: _ctx.window,
|
|
1637
|
+
onResize: unref(resizer).onResize,
|
|
1638
|
+
onResizeend: handleResizeEnd
|
|
1639
|
+
}, {
|
|
1640
|
+
default: withCtx(() => [createVNode(LogsViewRunData_default, {
|
|
1641
|
+
"data-test-id": "log-details-input",
|
|
1642
|
+
"pane-type": "input",
|
|
1643
|
+
title: unref(locale).baseText("logs.details.header.actions.input"),
|
|
1644
|
+
"log-entry": _ctx.logEntry,
|
|
1645
|
+
"collapsing-table-column-name": _ctx.collapsingInputTableColumnName,
|
|
1646
|
+
"search-shortcut": searchShortcutPriorityPanel.value === "input" ? "ctrl+f" : void 0,
|
|
1647
|
+
onCollapsingTableColumnChanged: _cache[3] || (_cache[3] = ($event) => emit("collapsingInputTableColumnChanged", $event))
|
|
1648
|
+
}, null, 8, [
|
|
1649
|
+
"title",
|
|
1650
|
+
"log-entry",
|
|
1651
|
+
"collapsing-table-column-name",
|
|
1652
|
+
"search-shortcut"
|
|
1653
|
+
])]),
|
|
1654
|
+
_: 1
|
|
1655
|
+
}, 8, [
|
|
1656
|
+
"class",
|
|
1657
|
+
"width",
|
|
1658
|
+
"style",
|
|
1659
|
+
"is-resizing-enabled",
|
|
1660
|
+
"window",
|
|
1661
|
+
"onResize"
|
|
1662
|
+
])) : createCommentVNode("", true), isTriggerNode.value || _ctx.panels !== unref(LOG_DETAILS_PANEL_STATE).INPUT ? (openBlock(), createBlock(LogsViewRunData_default, {
|
|
1663
|
+
key: 1,
|
|
1664
|
+
"data-test-id": "log-details-output",
|
|
1665
|
+
"pane-type": "output",
|
|
1666
|
+
class: normalizeClass(_ctx.$style.outputPanel),
|
|
1667
|
+
title: unref(locale).baseText("logs.details.header.actions.output"),
|
|
1668
|
+
"log-entry": _ctx.logEntry,
|
|
1669
|
+
"collapsing-table-column-name": _ctx.collapsingOutputTableColumnName,
|
|
1670
|
+
"search-shortcut": searchShortcutPriorityPanel.value === "output" ? "ctrl+f" : void 0,
|
|
1671
|
+
onCollapsingTableColumnChanged: _cache[4] || (_cache[4] = ($event) => emit("collapsingOutputTableColumnChanged", $event))
|
|
1672
|
+
}, null, 8, [
|
|
1673
|
+
"class",
|
|
1674
|
+
"title",
|
|
1675
|
+
"log-entry",
|
|
1676
|
+
"collapsing-table-column-name",
|
|
1677
|
+
"search-shortcut"
|
|
1678
|
+
])) : createCommentVNode("", true)], 64))], 2)) : createCommentVNode("", true)], 2);
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
});
|
|
1682
|
+
var LogDetailsPanel_vue_vue_type_style_index_0_lang_module_default = {
|
|
1683
|
+
container: "_container_w6lwl_123",
|
|
1684
|
+
header: "_header_w6lwl_132",
|
|
1685
|
+
actions: "_actions_w6lwl_136",
|
|
1686
|
+
pressed: "_pressed_w6lwl_142",
|
|
1687
|
+
title: "_title_w6lwl_146",
|
|
1688
|
+
icon: "_icon_w6lwl_152",
|
|
1689
|
+
executionSummary: "_executionSummary_w6lwl_156",
|
|
1690
|
+
content: "_content_w6lwl_160",
|
|
1691
|
+
outputPanel: "_outputPanel_w6lwl_168",
|
|
1692
|
+
inputResizer: "_inputResizer_w6lwl_173",
|
|
1693
|
+
collapsed: "_collapsed_w6lwl_177",
|
|
1694
|
+
full: "_full_w6lwl_177",
|
|
1695
|
+
placeholder: "_placeholder_w6lwl_181"
|
|
1696
|
+
};
|
|
1697
|
+
var LogDetailsPanel_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogDetailsPanel_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogDetailsPanel_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1698
|
+
var LogsPanelActions_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
1699
|
+
__name: "LogsPanelActions",
|
|
1700
|
+
props: {
|
|
1701
|
+
isOpen: { type: Boolean },
|
|
1702
|
+
isSyncSelectionEnabled: { type: Boolean },
|
|
1703
|
+
showToggleButton: { type: Boolean },
|
|
1704
|
+
showPopOutButton: { type: Boolean }
|
|
1705
|
+
},
|
|
1706
|
+
emits: [
|
|
1707
|
+
"popOut",
|
|
1708
|
+
"toggleOpen",
|
|
1709
|
+
"toggleSyncSelection"
|
|
1710
|
+
],
|
|
1711
|
+
setup(__props, { emit: __emit }) {
|
|
1712
|
+
const emit = __emit;
|
|
1713
|
+
const locales = useI18n();
|
|
1714
|
+
const popOutButtonText = computed(() => locales.baseText("runData.panel.actions.popOut"));
|
|
1715
|
+
const toggleButtonText = computed(() => locales.baseText(__props.isOpen ? "runData.panel.actions.collapse" : "runData.panel.actions.open"));
|
|
1716
|
+
const menuItems = computed(() => [{
|
|
1717
|
+
id: "toggleSyncSelection",
|
|
1718
|
+
label: locales.baseText("runData.panel.actions.sync"),
|
|
1719
|
+
checked: __props.isSyncSelectionEnabled
|
|
1720
|
+
}, ...__props.showPopOutButton ? [{
|
|
1721
|
+
id: "popOut",
|
|
1722
|
+
label: popOutButtonText.value
|
|
1723
|
+
}] : []]);
|
|
1724
|
+
function handleSelectMenuItem(selected) {
|
|
1725
|
+
switch (selected) {
|
|
1726
|
+
case "popOut":
|
|
1727
|
+
emit(selected);
|
|
1728
|
+
return;
|
|
1729
|
+
case "toggleSyncSelection":
|
|
1730
|
+
emit(selected);
|
|
1731
|
+
return;
|
|
1732
|
+
}
|
|
1733
|
+
}
|
|
1734
|
+
return (_ctx, _cache) => {
|
|
1735
|
+
return openBlock(), createElementBlock("div", { class: normalizeClass(_ctx.$style.container) }, [
|
|
1736
|
+
!_ctx.isOpen && _ctx.showPopOutButton ? (openBlock(), createBlock(unref(N8nTooltip_default), {
|
|
1737
|
+
key: 0,
|
|
1738
|
+
content: popOutButtonText.value
|
|
1739
|
+
}, {
|
|
1740
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
1741
|
+
icon: "pop-out",
|
|
1742
|
+
type: "tertiary",
|
|
1743
|
+
text: "",
|
|
1744
|
+
size: "small",
|
|
1745
|
+
"icon-size": "medium",
|
|
1746
|
+
"aria-label": popOutButtonText.value,
|
|
1747
|
+
onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("popOut"), ["stop"]))
|
|
1748
|
+
}, null, 8, ["aria-label"])]),
|
|
1749
|
+
_: 1
|
|
1750
|
+
}, 8, ["content"])) : createCommentVNode("", true),
|
|
1751
|
+
_ctx.isOpen ? (openBlock(), createBlock(unref(N8nActionDropdown_default), {
|
|
1752
|
+
key: 1,
|
|
1753
|
+
"icon-size": "small",
|
|
1754
|
+
"activator-icon": "ellipsis",
|
|
1755
|
+
"activator-size": "small",
|
|
1756
|
+
items: menuItems.value,
|
|
1757
|
+
teleported: false,
|
|
1758
|
+
onSelect: handleSelectMenuItem,
|
|
1759
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
|
|
1760
|
+
}, null, 8, ["items"])) : createCommentVNode("", true),
|
|
1761
|
+
_ctx.showToggleButton ? (openBlock(), createBlock(KeyboardShortcutTooltip_default, {
|
|
1762
|
+
key: `tooltip-${_ctx.isOpen}`,
|
|
1763
|
+
label: unref(locales).baseText("generic.shortcutHint"),
|
|
1764
|
+
shortcut: { keys: ["l"] }
|
|
1765
|
+
}, {
|
|
1766
|
+
default: withCtx(() => [createVNode(unref(N8nIconButton_default), {
|
|
1767
|
+
type: "tertiary",
|
|
1768
|
+
text: "",
|
|
1769
|
+
size: "small",
|
|
1770
|
+
"icon-size": "medium",
|
|
1771
|
+
icon: _ctx.isOpen ? "chevron-down" : "chevron-up",
|
|
1772
|
+
"aria-label": toggleButtonText.value,
|
|
1773
|
+
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => emit("toggleOpen"), ["stop"]))
|
|
1774
|
+
}, null, 8, ["icon", "aria-label"])]),
|
|
1775
|
+
_: 1
|
|
1776
|
+
}, 8, ["label"])) : createCommentVNode("", true)
|
|
1777
|
+
], 2);
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
});
|
|
1781
|
+
var LogsPanelActions_vue_vue_type_style_index_0_lang_module_default = { container: "_container_yw9ej_123" };
|
|
1782
|
+
var LogsPanelActions_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogsPanelActions_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogsPanelActions_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
1783
|
+
function useLogsSelection(execution, tree, flatLogEntries, toggleExpand) {
|
|
1784
|
+
const telemetry = useTelemetry();
|
|
1785
|
+
const manualLogEntrySelection = shallowRef({ type: "initial" });
|
|
1786
|
+
const nodeIdToSelect = shallowRef();
|
|
1787
|
+
const isExecutionStopped = computed(() => execution.value?.stoppedAt !== void 0);
|
|
1788
|
+
const selected = computed(() => findSelectedLogEntry(manualLogEntrySelection.value, tree.value, !isExecutionStopped.value));
|
|
1789
|
+
const logsStore = useLogsStore();
|
|
1790
|
+
const uiStore = useUIStore();
|
|
1791
|
+
const canvasStore = useCanvasStore();
|
|
1792
|
+
const workflowsStore = useWorkflowsStore();
|
|
1793
|
+
function syncSelectionToCanvasIfEnabled(value) {
|
|
1794
|
+
if (!logsStore.isLogSelectionSyncedWithCanvas) return;
|
|
1795
|
+
canvasEventBus.emit("nodes:select", {
|
|
1796
|
+
ids: [value.node.id],
|
|
1797
|
+
panIntoView: true
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
function select(value) {
|
|
1801
|
+
manualLogEntrySelection.value = value === void 0 ? { type: "none" } : {
|
|
1802
|
+
type: "selected",
|
|
1803
|
+
entry: value
|
|
1804
|
+
};
|
|
1805
|
+
if (value) {
|
|
1806
|
+
syncSelectionToCanvasIfEnabled(value);
|
|
1807
|
+
telemetry.track("User selected node in log view", {
|
|
1808
|
+
node_type: value.node.type,
|
|
1809
|
+
node_id: value.node.id,
|
|
1810
|
+
execution_id: execution.value?.id,
|
|
1811
|
+
workflow_id: execution.value?.workflowData.id,
|
|
1812
|
+
subworkflow_depth: getDepth(value)
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
function selectPrev() {
|
|
1817
|
+
const entries = flatLogEntries.value;
|
|
1818
|
+
if (entries.length === 0) return;
|
|
1819
|
+
const prevEntry = selected.value ? getEntryAtRelativeIndex(entries, selected.value.id, -1) ?? entries[0] : entries[entries.length - 1];
|
|
1820
|
+
manualLogEntrySelection.value = {
|
|
1821
|
+
type: "selected",
|
|
1822
|
+
entry: prevEntry
|
|
1823
|
+
};
|
|
1824
|
+
syncSelectionToCanvasIfEnabled(prevEntry);
|
|
1825
|
+
}
|
|
1826
|
+
function selectNext() {
|
|
1827
|
+
const entries = flatLogEntries.value;
|
|
1828
|
+
if (entries.length === 0) return;
|
|
1829
|
+
const nextEntry = selected.value ? getEntryAtRelativeIndex(entries, selected.value.id, 1) ?? entries[entries.length - 1] : entries[0];
|
|
1830
|
+
manualLogEntrySelection.value = {
|
|
1831
|
+
type: "selected",
|
|
1832
|
+
entry: nextEntry
|
|
1833
|
+
};
|
|
1834
|
+
syncSelectionToCanvasIfEnabled(nextEntry);
|
|
1835
|
+
}
|
|
1836
|
+
watch(selected, (sel) => {
|
|
1837
|
+
if (sel) logsStore.setSubNodeSelected(isSubNodeLog(sel));
|
|
1838
|
+
}, { immediate: true });
|
|
1839
|
+
watch([() => uiStore.lastSelectedNode, () => logsStore.isLogSelectionSyncedWithCanvas], ([selectedOnCanvas, shouldSync]) => {
|
|
1840
|
+
const selectedNodeId = selectedOnCanvas ? workflowsStore.nodesByName[selectedOnCanvas]?.id : void 0;
|
|
1841
|
+
nodeIdToSelect.value = shouldSync && !canvasStore.hasRangeSelection && selected.value?.node.id !== selectedNodeId ? selectedNodeId : void 0;
|
|
1842
|
+
}, { immediate: true });
|
|
1843
|
+
watch([tree, nodeIdToSelect], ([latestTree, id]) => {
|
|
1844
|
+
if (id === void 0) return;
|
|
1845
|
+
const entry = findLogEntryRec((e) => e.node.id === id, latestTree);
|
|
1846
|
+
if (!entry) return;
|
|
1847
|
+
nodeIdToSelect.value = void 0;
|
|
1848
|
+
manualLogEntrySelection.value = {
|
|
1849
|
+
type: "selected",
|
|
1850
|
+
entry
|
|
1851
|
+
};
|
|
1852
|
+
let parent = entry.parent;
|
|
1853
|
+
while (parent !== void 0) {
|
|
1854
|
+
toggleExpand(parent, true);
|
|
1855
|
+
parent = parent.parent;
|
|
1856
|
+
}
|
|
1857
|
+
}, { immediate: true });
|
|
1858
|
+
return {
|
|
1859
|
+
selected,
|
|
1860
|
+
select,
|
|
1861
|
+
selectPrev,
|
|
1862
|
+
selectNext
|
|
1863
|
+
};
|
|
1864
|
+
}
|
|
1865
|
+
function isStyle(node) {
|
|
1866
|
+
return node instanceof HTMLStyleElement || node instanceof HTMLLinkElement && node.rel === "stylesheet";
|
|
1867
|
+
}
|
|
1868
|
+
function syncStyleMutations(destination, mutations) {
|
|
1869
|
+
const currentStyles = destination.document.head.querySelectorAll("style, link[rel=\"stylesheet\"]");
|
|
1870
|
+
for (const mutation of mutations) {
|
|
1871
|
+
for (const node of mutation.addedNodes) if (isStyle(node)) destination.document.head.appendChild(node.cloneNode(true));
|
|
1872
|
+
for (const node of mutation.removedNodes) if (isStyle(node)) {
|
|
1873
|
+
for (const found of currentStyles) if (found.isEqualNode(node)) found.remove();
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
function copyFavicon(source, target) {
|
|
1878
|
+
const iconUrl = source.document.querySelector("link[rel=icon]")?.getAttribute("href");
|
|
1879
|
+
if (iconUrl) {
|
|
1880
|
+
const link = target.document.createElement("link");
|
|
1881
|
+
link.setAttribute("rel", "icon");
|
|
1882
|
+
link.setAttribute("href", iconUrl);
|
|
1883
|
+
target.document.head.appendChild(link);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
function usePopOutWindow({ title: title$3, container: container$8, content: content$2, initialHeight, initialWidth, shouldPopOut, onRequestClose }) {
|
|
1887
|
+
const popOutWindow = ref();
|
|
1888
|
+
const isUnmounting = ref(false);
|
|
1889
|
+
const canPopOut = computed(() => window.parent === window);
|
|
1890
|
+
const isPoppedOut = computed(() => !!popOutWindow.value);
|
|
1891
|
+
const tooltipContainer = computed(() => isPoppedOut.value ? content$2.value ?? void 0 : void 0);
|
|
1892
|
+
const observer = new MutationObserver((mutations) => {
|
|
1893
|
+
if (popOutWindow.value) syncStyleMutations(popOutWindow.value, mutations);
|
|
1894
|
+
});
|
|
1895
|
+
const documentTitle = useDocumentTitle(popOutWindow);
|
|
1896
|
+
observer.observe(document.head, {
|
|
1897
|
+
childList: true,
|
|
1898
|
+
subtree: true
|
|
1899
|
+
});
|
|
1900
|
+
provide(PopOutWindowKey, popOutWindow);
|
|
1901
|
+
useProvideTooltipAppendTo(tooltipContainer);
|
|
1902
|
+
async function showPopOut() {
|
|
1903
|
+
if (!content$2.value) return;
|
|
1904
|
+
if (!popOutWindow.value) {
|
|
1905
|
+
const options = `popup=yes,width=${initialWidth},height=${initialHeight},left=100,top=100,toolbar=no,menubar=no,scrollbars=yes,resizable=yes`;
|
|
1906
|
+
popOutWindow.value = window.open("", "_blank", options) ?? void 0;
|
|
1907
|
+
}
|
|
1908
|
+
if (!popOutWindow.value) return;
|
|
1909
|
+
copyFavicon(window, popOutWindow.value);
|
|
1910
|
+
for (const styleSheet of [...document.styleSheets]) try {
|
|
1911
|
+
const cssRules = [...styleSheet.cssRules].map((rule) => rule.cssText).join("");
|
|
1912
|
+
const style = document.createElement("style");
|
|
1913
|
+
style.textContent = cssRules;
|
|
1914
|
+
popOutWindow.value.document.head.appendChild(style);
|
|
1915
|
+
} catch (e) {
|
|
1916
|
+
const link = document.createElement("link");
|
|
1917
|
+
link.rel = "stylesheet";
|
|
1918
|
+
link.type = styleSheet.type;
|
|
1919
|
+
link.media = styleSheet.media;
|
|
1920
|
+
link.href = styleSheet.href;
|
|
1921
|
+
popOutWindow.value.document.head.appendChild(link);
|
|
1922
|
+
}
|
|
1923
|
+
popOutWindow.value.document.body.append(content$2.value);
|
|
1924
|
+
popOutWindow.value.addEventListener("pagehide", () => !isUnmounting.value && onRequestClose());
|
|
1925
|
+
}
|
|
1926
|
+
function hidePopOut() {
|
|
1927
|
+
popOutWindow.value?.close();
|
|
1928
|
+
popOutWindow.value = void 0;
|
|
1929
|
+
if (content$2.value) container$8.value?.appendChild(content$2.value);
|
|
1930
|
+
}
|
|
1931
|
+
watch(shouldPopOut, (value) => value ? requestAnimationFrame(showPopOut) : hidePopOut(), { immediate: true });
|
|
1932
|
+
watch([title$3, popOutWindow], ([newTitle, win]) => {
|
|
1933
|
+
if (win) documentTitle.set(newTitle);
|
|
1934
|
+
}, { immediate: true });
|
|
1935
|
+
onScopeDispose(() => {
|
|
1936
|
+
observer.disconnect();
|
|
1937
|
+
});
|
|
1938
|
+
onBeforeUnmount(() => {
|
|
1939
|
+
isUnmounting.value = true;
|
|
1940
|
+
if (popOutWindow.value) {
|
|
1941
|
+
popOutWindow.value.close();
|
|
1942
|
+
onRequestClose();
|
|
1943
|
+
}
|
|
1944
|
+
});
|
|
1945
|
+
return {
|
|
1946
|
+
canPopOut,
|
|
1947
|
+
isPoppedOut,
|
|
1948
|
+
popOutWindow
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
var INITIAL_POPUP_HEIGHT = 400;
|
|
1952
|
+
var COLLAPSED_PANEL_HEIGHT = 32;
|
|
1953
|
+
function useLogsPanelLayout(workflowName, popOutContainer, popOutContent$1, container$8, logsContainer$1) {
|
|
1954
|
+
const logsStore = useLogsStore();
|
|
1955
|
+
const telemetry = useTelemetry();
|
|
1956
|
+
const resizer = useResizablePanel(LOCAL_STORAGE_PANEL_HEIGHT, {
|
|
1957
|
+
container: document.body,
|
|
1958
|
+
position: "bottom",
|
|
1959
|
+
snap: false,
|
|
1960
|
+
defaultSize: (size) => size * .3,
|
|
1961
|
+
minSize: 160,
|
|
1962
|
+
maxSize: (size) => size * .75,
|
|
1963
|
+
allowCollapse: true
|
|
1964
|
+
});
|
|
1965
|
+
const chatPanelResizer = useResizablePanel(LOCAL_STORAGE_PANEL_WIDTH, {
|
|
1966
|
+
container: container$8,
|
|
1967
|
+
defaultSize: (size) => Math.min(800, size * .3),
|
|
1968
|
+
minSize: 240,
|
|
1969
|
+
maxSize: (size) => size * .8
|
|
1970
|
+
});
|
|
1971
|
+
const overviewPanelResizer = useResizablePanel(LOCAL_STORAGE_OVERVIEW_PANEL_WIDTH, {
|
|
1972
|
+
container: logsContainer$1,
|
|
1973
|
+
defaultSize: (size) => Math.min(240, size * .2),
|
|
1974
|
+
minSize: 80,
|
|
1975
|
+
maxSize: 500,
|
|
1976
|
+
allowFullSize: true
|
|
1977
|
+
});
|
|
1978
|
+
const isOpen = computed(() => logsStore.isOpen ? !resizer.isCollapsed.value : resizer.isResizing.value && resizer.size.value > 0);
|
|
1979
|
+
const isCollapsingDetailsPanel = computed(() => overviewPanelResizer.isFullSize.value);
|
|
1980
|
+
const popOutWindowTitle = computed(() => `Logs - ${workflowName.value}`);
|
|
1981
|
+
const shouldPopOut = computed(() => logsStore.state === LOGS_PANEL_STATE.FLOATING);
|
|
1982
|
+
const { canPopOut, isPoppedOut, popOutWindow } = usePopOutWindow({
|
|
1983
|
+
title: popOutWindowTitle,
|
|
1984
|
+
initialHeight: INITIAL_POPUP_HEIGHT,
|
|
1985
|
+
initialWidth: window.document.body.offsetWidth * .8,
|
|
1986
|
+
container: popOutContainer,
|
|
1987
|
+
content: popOutContent$1,
|
|
1988
|
+
shouldPopOut,
|
|
1989
|
+
onRequestClose: () => {
|
|
1990
|
+
if (!isOpen.value) return;
|
|
1991
|
+
telemetry.track("User toggled log view", { new_state: "attached" });
|
|
1992
|
+
logsStore.setPreferPoppedOut(false);
|
|
1993
|
+
}
|
|
1994
|
+
});
|
|
1995
|
+
function handleToggleOpen(open) {
|
|
1996
|
+
const wasOpen = logsStore.isOpen;
|
|
1997
|
+
if (open === wasOpen) return;
|
|
1998
|
+
logsStore.toggleOpen(open);
|
|
1999
|
+
telemetry.track("User toggled log view", { new_state: wasOpen ? "collapsed" : "attached" });
|
|
2000
|
+
}
|
|
2001
|
+
function handlePopOut() {
|
|
2002
|
+
telemetry.track("User toggled log view", { new_state: "floating" });
|
|
2003
|
+
logsStore.toggleOpen(true);
|
|
2004
|
+
logsStore.setPreferPoppedOut(true);
|
|
2005
|
+
}
|
|
2006
|
+
function handleResizeEnd() {
|
|
2007
|
+
if (!logsStore.isOpen && !resizer.isCollapsed.value) handleToggleOpen(true);
|
|
2008
|
+
if (resizer.isCollapsed.value) handleToggleOpen(false);
|
|
2009
|
+
resizer.onResizeEnd();
|
|
2010
|
+
}
|
|
2011
|
+
watch([
|
|
2012
|
+
() => logsStore.state,
|
|
2013
|
+
resizer.size,
|
|
2014
|
+
isPoppedOut
|
|
2015
|
+
], ([state, height]) => {
|
|
2016
|
+
const updatedHeight = state === LOGS_PANEL_STATE.FLOATING ? 0 : state === LOGS_PANEL_STATE.ATTACHED ? height : COLLAPSED_PANEL_HEIGHT;
|
|
2017
|
+
if (state === LOGS_PANEL_STATE.FLOATING) popOutWindow?.value?.document.documentElement.style.setProperty("--logs-panel--height", "100vh");
|
|
2018
|
+
else document.documentElement.style.setProperty("--logs-panel--height", `${updatedHeight}px`);
|
|
2019
|
+
logsStore.setHeight(updatedHeight);
|
|
2020
|
+
}, { immediate: true });
|
|
2021
|
+
onBeforeUnmount(() => logsStore.setHeight(0));
|
|
2022
|
+
return {
|
|
2023
|
+
height: resizer.size,
|
|
2024
|
+
chatPanelWidth: chatPanelResizer.size,
|
|
2025
|
+
overviewPanelWidth: overviewPanelResizer.size,
|
|
2026
|
+
canPopOut,
|
|
2027
|
+
isOpen,
|
|
2028
|
+
isCollapsingDetailsPanel,
|
|
2029
|
+
isPoppedOut,
|
|
2030
|
+
isOverviewPanelFullWidth: overviewPanelResizer.isFullSize,
|
|
2031
|
+
popOutWindow,
|
|
2032
|
+
onToggleOpen: handleToggleOpen,
|
|
2033
|
+
onPopOut: handlePopOut,
|
|
2034
|
+
onResize: resizer.onResize,
|
|
2035
|
+
onResizeEnd: handleResizeEnd,
|
|
2036
|
+
onChatPanelResize: chatPanelResizer.onResize,
|
|
2037
|
+
onChatPanelResizeEnd: chatPanelResizer.onResizeEnd,
|
|
2038
|
+
onOverviewPanelResize: overviewPanelResizer.onResize,
|
|
2039
|
+
onOverviewPanelResizeEnd: overviewPanelResizer.onResizeEnd
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
var LogsViewKeyboardEventListener_default = /* @__PURE__ */ defineComponent({
|
|
2043
|
+
__name: "LogsViewKeyboardEventListener",
|
|
2044
|
+
props: {
|
|
2045
|
+
keyMap: {},
|
|
2046
|
+
container: {}
|
|
2047
|
+
},
|
|
2048
|
+
setup(__props) {
|
|
2049
|
+
const popOutWindow = inject(PopOutWindowKey, ref());
|
|
2050
|
+
const activeElement = useActiveElement({ window: popOutWindow?.value });
|
|
2051
|
+
const isBlurred = computed(() => {
|
|
2052
|
+
if (popOutWindow?.value) return popOutWindow.value.document.activeElement === null;
|
|
2053
|
+
return !activeElement.value || !__props.container || !__props.container.contains(activeElement.value) && __props.container !== activeElement.value;
|
|
2054
|
+
});
|
|
2055
|
+
useKeybindings(toRef(() => __props.keyMap), { disabled: isBlurred });
|
|
2056
|
+
return (_ctx, _cache) => {
|
|
2057
|
+
return openBlock(), createElementBlock("div");
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
});
|
|
2061
|
+
var LogsPanel_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
2062
|
+
__name: "LogsPanel",
|
|
2063
|
+
props: { isReadOnly: {
|
|
2064
|
+
type: Boolean,
|
|
2065
|
+
default: false
|
|
2066
|
+
} },
|
|
2067
|
+
setup(__props) {
|
|
2068
|
+
const props = __props;
|
|
2069
|
+
const container$8 = useTemplateRef("container");
|
|
2070
|
+
const logsContainer$1 = useTemplateRef("logsContainer");
|
|
2071
|
+
const popOutContainer = useTemplateRef("popOutContainer");
|
|
2072
|
+
const popOutContent$1 = useTemplateRef("popOutContent");
|
|
2073
|
+
const logsStore = useLogsStore();
|
|
2074
|
+
const ndvStore = useNDVStore();
|
|
2075
|
+
const workflowsStore = useWorkflowsStore();
|
|
2076
|
+
const { height, chatPanelWidth, overviewPanelWidth, canPopOut, isOpen, isPoppedOut, isCollapsingDetailsPanel, isOverviewPanelFullWidth, popOutWindow, onResize, onResizeEnd, onToggleOpen, onPopOut, onChatPanelResize, onChatPanelResizeEnd, onOverviewPanelResize, onOverviewPanelResizeEnd } = useLogsPanelLayout(computed(() => workflowsStore.workflow.name), popOutContainer, popOutContent$1, container$8, logsContainer$1);
|
|
2077
|
+
const { currentSessionId, messages: messages$1, previousChatMessages, sendMessage, refreshSession, displayExecution } = useChatState(props.isReadOnly);
|
|
2078
|
+
const { entries, execution, hasChat, latestNodeNameById, resetExecutionData, loadSubExecution } = useLogsExecutionData({ isEnabled: isOpen });
|
|
2079
|
+
const { flatLogEntries, toggleExpanded } = useLogsTreeExpand(entries, loadSubExecution);
|
|
2080
|
+
const { selected, select, selectNext, selectPrev } = useLogsSelection(execution, entries, flatLogEntries, toggleExpanded);
|
|
2081
|
+
const inputTableColumnCollapsing = ref();
|
|
2082
|
+
const outputTableColumnCollapsing = ref();
|
|
2083
|
+
const isLogDetailsOpen = computed(() => isOpen.value && selected.value !== void 0);
|
|
2084
|
+
const isLogDetailsVisuallyOpen = computed(() => isLogDetailsOpen.value && !isCollapsingDetailsPanel.value);
|
|
2085
|
+
const logsPanelActionsProps = computed(() => ({
|
|
2086
|
+
isOpen: isOpen.value,
|
|
2087
|
+
isSyncSelectionEnabled: logsStore.isLogSelectionSyncedWithCanvas,
|
|
2088
|
+
showToggleButton: !isPoppedOut.value,
|
|
2089
|
+
showPopOutButton: canPopOut.value && !isPoppedOut.value,
|
|
2090
|
+
onPopOut,
|
|
2091
|
+
onToggleOpen,
|
|
2092
|
+
onToggleSyncSelection: logsStore.toggleLogSelectionSync
|
|
2093
|
+
}));
|
|
2094
|
+
const inputCollapsingColumnName = computed(() => inputTableColumnCollapsing.value?.nodeName === selected.value?.node.name ? inputTableColumnCollapsing.value?.columnName ?? null : null);
|
|
2095
|
+
const outputCollapsingColumnName = computed(() => outputTableColumnCollapsing.value?.nodeName === selected.value?.node.name ? outputTableColumnCollapsing.value?.columnName ?? null : null);
|
|
2096
|
+
const keyMap = computed(() => ({
|
|
2097
|
+
j: selectNext,
|
|
2098
|
+
k: selectPrev,
|
|
2099
|
+
Escape: () => select(void 0),
|
|
2100
|
+
ArrowDown: selectNext,
|
|
2101
|
+
ArrowUp: selectPrev,
|
|
2102
|
+
Space: () => selected.value && toggleExpanded(selected.value),
|
|
2103
|
+
Enter: () => selected.value && handleOpenNdv(selected.value),
|
|
2104
|
+
...isPoppedOut.value ? {
|
|
2105
|
+
i: () => logsStore.toggleInputOpen(),
|
|
2106
|
+
o: () => logsStore.toggleOutputOpen()
|
|
2107
|
+
} : {}
|
|
2108
|
+
}));
|
|
2109
|
+
function handleResizeOverviewPanelEnd() {
|
|
2110
|
+
if (isOverviewPanelFullWidth.value) select(void 0);
|
|
2111
|
+
onOverviewPanelResizeEnd();
|
|
2112
|
+
}
|
|
2113
|
+
function handleOpenNdv(treeNode) {
|
|
2114
|
+
ndvStore.setActiveNodeName(treeNode.node.name, "logs_view");
|
|
2115
|
+
nextTick(() => {
|
|
2116
|
+
const source = treeNode.runData?.source[0];
|
|
2117
|
+
const inputBranch = source?.previousNodeOutput ?? 0;
|
|
2118
|
+
ndvEventBus.emit("updateInputNodeName", source?.previousNode);
|
|
2119
|
+
ndvEventBus.emit("setInputBranchIndex", inputBranch);
|
|
2120
|
+
ndvStore.setOutputRunIndex(treeNode.runIndex);
|
|
2121
|
+
});
|
|
2122
|
+
}
|
|
2123
|
+
function handleChangeInputTableColumnCollapsing(columnName) {
|
|
2124
|
+
inputTableColumnCollapsing.value = columnName && selected.value ? {
|
|
2125
|
+
nodeName: selected.value.node.name,
|
|
2126
|
+
columnName
|
|
2127
|
+
} : void 0;
|
|
2128
|
+
}
|
|
2129
|
+
function handleChangeOutputTableColumnCollapsing(columnName) {
|
|
2130
|
+
outputTableColumnCollapsing.value = columnName && selected.value ? {
|
|
2131
|
+
nodeName: selected.value.node.name,
|
|
2132
|
+
columnName
|
|
2133
|
+
} : void 0;
|
|
2134
|
+
}
|
|
2135
|
+
return (_ctx, _cache) => {
|
|
2136
|
+
return openBlock(), createElementBlock("div", {
|
|
2137
|
+
ref_key: "popOutContainer",
|
|
2138
|
+
ref: popOutContainer,
|
|
2139
|
+
"data-test-id": "logs-panel"
|
|
2140
|
+
}, [(openBlock(), createBlock(LogsViewKeyboardEventListener_default, {
|
|
2141
|
+
key: String(!!unref(popOutWindow)),
|
|
2142
|
+
"key-map": keyMap.value,
|
|
2143
|
+
container: unref(container$8)
|
|
2144
|
+
}, null, 8, ["key-map", "container"])), createBaseVNode("div", {
|
|
2145
|
+
ref_key: "popOutContent",
|
|
2146
|
+
ref: popOutContent$1,
|
|
2147
|
+
class: normalizeClass([_ctx.$style.popOutContent, unref(isPoppedOut) ? _ctx.$style.poppedOut : ""])
|
|
2148
|
+
}, [createVNode(unref(N8nResizeWrapper_default), {
|
|
2149
|
+
height: unref(isPoppedOut) ? void 0 : unref(height),
|
|
2150
|
+
"supported-directions": ["top"],
|
|
2151
|
+
"is-resizing-enabled": !unref(isPoppedOut),
|
|
2152
|
+
class: normalizeClass(_ctx.$style.resizeWrapper),
|
|
2153
|
+
style: normalizeStyle({ height: unref(isOpen) && !unref(isPoppedOut) ? `${unref(height)}px` : "auto" }),
|
|
2154
|
+
onResize: unref(onResize),
|
|
2155
|
+
onResizeend: unref(onResizeEnd)
|
|
2156
|
+
}, {
|
|
2157
|
+
default: withCtx(() => [createBaseVNode("div", {
|
|
2158
|
+
ref_key: "container",
|
|
2159
|
+
ref: container$8,
|
|
2160
|
+
class: normalizeClass(_ctx.$style.container),
|
|
2161
|
+
tabindex: "-1"
|
|
2162
|
+
}, [unref(hasChat) && (!props.isReadOnly || unref(messages$1).length > 0) ? (openBlock(), createBlock(unref(N8nResizeWrapper_default), {
|
|
2163
|
+
key: 0,
|
|
2164
|
+
"supported-directions": ["right"],
|
|
2165
|
+
"is-resizing-enabled": unref(isOpen),
|
|
2166
|
+
width: unref(chatPanelWidth),
|
|
2167
|
+
style: normalizeStyle({ width: `${unref(chatPanelWidth)}px` }),
|
|
2168
|
+
class: normalizeClass(_ctx.$style.chat),
|
|
2169
|
+
window: unref(popOutWindow),
|
|
2170
|
+
onResize: unref(onChatPanelResize),
|
|
2171
|
+
onResizeend: unref(onChatPanelResizeEnd)
|
|
2172
|
+
}, {
|
|
2173
|
+
default: withCtx(() => [(openBlock(), createBlock(ChatMessagesPanel_default, {
|
|
2174
|
+
key: `canvas-chat-${unref(currentSessionId)}${unref(isPoppedOut) ? "-pop-out" : ""}`,
|
|
2175
|
+
"data-test-id": "canvas-chat",
|
|
2176
|
+
"is-open": unref(isOpen),
|
|
2177
|
+
"is-read-only": _ctx.isReadOnly,
|
|
2178
|
+
messages: unref(messages$1),
|
|
2179
|
+
"session-id": unref(currentSessionId),
|
|
2180
|
+
"past-chat-messages": unref(previousChatMessages),
|
|
2181
|
+
"show-close-button": false,
|
|
2182
|
+
"is-new-logs-enabled": true,
|
|
2183
|
+
"is-header-clickable": !unref(isPoppedOut),
|
|
2184
|
+
onClose: unref(onToggleOpen),
|
|
2185
|
+
onRefreshSession: unref(refreshSession),
|
|
2186
|
+
onDisplayExecution: unref(displayExecution),
|
|
2187
|
+
onSendMessage: unref(sendMessage),
|
|
2188
|
+
onClickHeader: unref(onToggleOpen)
|
|
2189
|
+
}, null, 8, [
|
|
2190
|
+
"is-open",
|
|
2191
|
+
"is-read-only",
|
|
2192
|
+
"messages",
|
|
2193
|
+
"session-id",
|
|
2194
|
+
"past-chat-messages",
|
|
2195
|
+
"is-header-clickable",
|
|
2196
|
+
"onClose",
|
|
2197
|
+
"onRefreshSession",
|
|
2198
|
+
"onDisplayExecution",
|
|
2199
|
+
"onSendMessage",
|
|
2200
|
+
"onClickHeader"
|
|
2201
|
+
]))]),
|
|
2202
|
+
_: 1
|
|
2203
|
+
}, 8, [
|
|
2204
|
+
"is-resizing-enabled",
|
|
2205
|
+
"width",
|
|
2206
|
+
"style",
|
|
2207
|
+
"class",
|
|
2208
|
+
"window",
|
|
2209
|
+
"onResize",
|
|
2210
|
+
"onResizeend"
|
|
2211
|
+
])) : createCommentVNode("", true), createBaseVNode("div", {
|
|
2212
|
+
ref_key: "logsContainer",
|
|
2213
|
+
ref: logsContainer$1,
|
|
2214
|
+
class: normalizeClass(_ctx.$style.logsContainer)
|
|
2215
|
+
}, [createVNode(unref(N8nResizeWrapper_default), {
|
|
2216
|
+
class: normalizeClass(_ctx.$style.overviewResizer),
|
|
2217
|
+
width: unref(overviewPanelWidth),
|
|
2218
|
+
style: normalizeStyle({ width: isLogDetailsVisuallyOpen.value ? `${unref(overviewPanelWidth)}px` : "" }),
|
|
2219
|
+
"supported-directions": ["right"],
|
|
2220
|
+
"is-resizing-enabled": isLogDetailsOpen.value,
|
|
2221
|
+
window: unref(popOutWindow),
|
|
2222
|
+
onResize: unref(onOverviewPanelResize),
|
|
2223
|
+
onResizeend: handleResizeOverviewPanelEnd
|
|
2224
|
+
}, {
|
|
2225
|
+
default: withCtx(() => [createVNode(LogsOverviewPanel_default, {
|
|
2226
|
+
class: normalizeClass(_ctx.$style.logsOverview),
|
|
2227
|
+
"is-open": unref(isOpen),
|
|
2228
|
+
"is-read-only": _ctx.isReadOnly,
|
|
2229
|
+
"is-compact": isLogDetailsVisuallyOpen.value,
|
|
2230
|
+
selected: unref(selected),
|
|
2231
|
+
execution: unref(execution),
|
|
2232
|
+
entries: unref(entries),
|
|
2233
|
+
"latest-node-info": unref(latestNodeNameById),
|
|
2234
|
+
"flat-log-entries": unref(flatLogEntries),
|
|
2235
|
+
"is-header-clickable": !unref(isPoppedOut),
|
|
2236
|
+
onClickHeader: unref(onToggleOpen),
|
|
2237
|
+
onSelect: unref(select),
|
|
2238
|
+
onClearExecutionData: unref(resetExecutionData),
|
|
2239
|
+
onToggleExpanded: unref(toggleExpanded),
|
|
2240
|
+
onOpenNdv: handleOpenNdv
|
|
2241
|
+
}, {
|
|
2242
|
+
actions: withCtx(() => [!isLogDetailsVisuallyOpen.value ? (openBlock(), createBlock(LogsPanelActions_default, normalizeProps(mergeProps({ key: 0 }, logsPanelActionsProps.value)), null, 16)) : createCommentVNode("", true)]),
|
|
2243
|
+
_: 1
|
|
2244
|
+
}, 8, [
|
|
2245
|
+
"class",
|
|
2246
|
+
"is-open",
|
|
2247
|
+
"is-read-only",
|
|
2248
|
+
"is-compact",
|
|
2249
|
+
"selected",
|
|
2250
|
+
"execution",
|
|
2251
|
+
"entries",
|
|
2252
|
+
"latest-node-info",
|
|
2253
|
+
"flat-log-entries",
|
|
2254
|
+
"is-header-clickable",
|
|
2255
|
+
"onClickHeader",
|
|
2256
|
+
"onSelect",
|
|
2257
|
+
"onClearExecutionData",
|
|
2258
|
+
"onToggleExpanded"
|
|
2259
|
+
])]),
|
|
2260
|
+
_: 1
|
|
2261
|
+
}, 8, [
|
|
2262
|
+
"class",
|
|
2263
|
+
"width",
|
|
2264
|
+
"style",
|
|
2265
|
+
"is-resizing-enabled",
|
|
2266
|
+
"window",
|
|
2267
|
+
"onResize"
|
|
2268
|
+
]), isLogDetailsVisuallyOpen.value && unref(selected) ? (openBlock(), createBlock(LogDetailsPanel_default, {
|
|
2269
|
+
key: 0,
|
|
2270
|
+
class: normalizeClass(_ctx.$style.logDetails),
|
|
2271
|
+
"is-open": unref(isOpen),
|
|
2272
|
+
"log-entry": unref(selected),
|
|
2273
|
+
window: unref(popOutWindow),
|
|
2274
|
+
"latest-info": unref(latestNodeNameById)[unref(selected).node.id],
|
|
2275
|
+
panels: unref(logsStore).detailsState,
|
|
2276
|
+
"collapsing-input-table-column-name": inputCollapsingColumnName.value,
|
|
2277
|
+
"collapsing-output-table-column-name": outputCollapsingColumnName.value,
|
|
2278
|
+
"is-header-clickable": !unref(isPoppedOut),
|
|
2279
|
+
onClickHeader: unref(onToggleOpen),
|
|
2280
|
+
onToggleInputOpen: unref(logsStore).toggleInputOpen,
|
|
2281
|
+
onToggleOutputOpen: unref(logsStore).toggleOutputOpen,
|
|
2282
|
+
onCollapsingInputTableColumnChanged: handleChangeInputTableColumnCollapsing,
|
|
2283
|
+
onCollapsingOutputTableColumnChanged: handleChangeOutputTableColumnCollapsing
|
|
2284
|
+
}, {
|
|
2285
|
+
actions: withCtx(() => [isLogDetailsVisuallyOpen.value ? (openBlock(), createBlock(LogsPanelActions_default, normalizeProps(mergeProps({ key: 0 }, logsPanelActionsProps.value)), null, 16)) : createCommentVNode("", true)]),
|
|
2286
|
+
_: 1
|
|
2287
|
+
}, 8, [
|
|
2288
|
+
"class",
|
|
2289
|
+
"is-open",
|
|
2290
|
+
"log-entry",
|
|
2291
|
+
"window",
|
|
2292
|
+
"latest-info",
|
|
2293
|
+
"panels",
|
|
2294
|
+
"collapsing-input-table-column-name",
|
|
2295
|
+
"collapsing-output-table-column-name",
|
|
2296
|
+
"is-header-clickable",
|
|
2297
|
+
"onClickHeader",
|
|
2298
|
+
"onToggleInputOpen",
|
|
2299
|
+
"onToggleOutputOpen"
|
|
2300
|
+
])) : createCommentVNode("", true)], 2)], 2)]),
|
|
2301
|
+
_: 1
|
|
2302
|
+
}, 8, [
|
|
2303
|
+
"height",
|
|
2304
|
+
"is-resizing-enabled",
|
|
2305
|
+
"class",
|
|
2306
|
+
"style",
|
|
2307
|
+
"onResize",
|
|
2308
|
+
"onResizeend"
|
|
2309
|
+
])], 2)], 512);
|
|
2310
|
+
};
|
|
2311
|
+
}
|
|
2312
|
+
});
|
|
2313
|
+
var LogsPanel_vue_vue_type_style_index_0_lang_module_default = {
|
|
2314
|
+
popOutContent: "_popOutContent_17exv_123",
|
|
2315
|
+
resizeWrapper: "_resizeWrapper_17exv_129",
|
|
2316
|
+
poppedOut: "_poppedOut_17exv_136",
|
|
2317
|
+
container: "_container_17exv_140",
|
|
2318
|
+
chat: "_chat_17exv_149",
|
|
2319
|
+
logsContainer: "_logsContainer_17exv_153",
|
|
2320
|
+
overviewResizer: "_overviewResizer_17exv_163",
|
|
2321
|
+
logsOverview: "_logsOverview_17exv_171",
|
|
2322
|
+
logsDetails: "_logsDetails_17exv_175"
|
|
2323
|
+
};
|
|
2324
|
+
var LogsPanel_default = /* @__PURE__ */ __plugin_vue_export_helper_default(LogsPanel_vue_vue_type_script_setup_true_lang_default, [["__cssModules", { "$style": LogsPanel_vue_vue_type_style_index_0_lang_module_default }]]);
|
|
2325
|
+
export { LogsPanel_default as t };
|