n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 2.05 kB
JavaScript
(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{};e.SENTRY_RELEASE={id:`n8n@2.16.1`}}catch{}})();try{(function(){var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`8ecbd176-6ae6-4b1f-8149-75397cbca526`,e._sentryDebugIdIdentifier=`sentry-dbid-8ecbd176-6ae6-4b1f-8149-75397cbca526`)})()}catch{}import{S as e}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{s as t}from"./core-Bz5WjPxS.js";import{t as n}from"./users.store-xP93bV7X.js";import{Bo as r}from"./constants-DuQbSl-q.js";import{T as i,c as a,t as o}from"./useRootStore-XEREVjMN.js";import{t as s}from"./settings.store-CAFiYCMH.js";import{c}from"./insights.utils-YrW9I9r0.js";function l(e){if(!e)return;let{startDate:t,endDate:n,...r}=e,i={...r};return t&&(i.startDate=t.toISOString()),n&&(i.endDate=n.toISOString()),i}var u=async(e,t)=>await a(e,`GET`,`/insights/summary`,l(t)),d=async(e,t)=>await a(e,`GET`,`/insights/by-time`,l(t)),f=async(e,t)=>await a(e,`GET`,`/insights/by-time/time-saved`,l(t)),p=async(e,t)=>await a(e,`GET`,`/insights/by-workflow`,l(t)),m=i(`insights`,()=>{let i=o(),a=n(),l=s(),m=e(()=>r(a.currentUser?.globalScopes).insights),h=e(()=>l.isModuleActive(`insights`)),g=e(()=>!!l.moduleSettings.insights?.dashboard);return{globalInsightsPermissions:m,isInsightsEnabled:h,isSummaryEnabled:e(()=>m.value.list&&h.value),isDashboardEnabled:g,weeklySummary:t(async()=>c(await u(i.restApiContext)),[],{immediate:!1,resetOnExecute:!1}),summary:t(async e=>c(await u(i.restApiContext,e)),[],{immediate:!1,resetOnExecute:!1}),charts:t(async e=>await(g.value?d:f)(i.restApiContext,e),[],{immediate:!1,resetOnExecute:!1}),table:t(async e=>await p(i.restApiContext,e),{count:0,data:[]},{immediate:!1,resetOnExecute:!1}),dateRanges:e(()=>l.moduleSettings.insights?.dateRanges??[])}});export{m as t};
//# sourceMappingURL=insights.store-i6LlshbL.js.map