n8n-editor-ui
Version:
Workflow Editor UI for n8n
2 lines • 2.7 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]=`00dba04b-c90d-46e4-8947-17877462eee9`,e._sentryDebugIdIdentifier=`sentry-dbid-00dba04b-c90d-46e4-8947-17877462eee9`)})()}catch{}import{Nt as e,S as t}from"./vue.runtime.esm-bundler-C3C09Zii.js";import{T as n,t as r}from"./useRootStore-XEREVjMN.js";import{A as i,D as a,O as o,j as s,k as c,t as l}from"./settings.store-CAFiYCMH.js";var u=`Community`,d={loading:!0,data:{usage:{activeWorkflowTriggers:{limit:-1,value:0,warningThreshold:.8},workflowsHavingEvaluations:{value:0,limit:0}},license:{planId:``,planName:u}}},f=n(`usage`,()=>{let n=r(),f=l(),p=e({...d}),m=t(()=>p.data.license.planName||u),h=t(()=>p.data.license.planId),g=t(()=>p.data.usage.activeWorkflowTriggers.limit),_=t(()=>p.data.usage.activeWorkflowTriggers.value),v=t(()=>p.data.usage.workflowsHavingEvaluations.limit),y=t(()=>p.data.usage.workflowsHavingEvaluations.value),b=t(()=>_.value/g.value*100),x=t(()=>f.settings.instanceId),S=t(()=>p.data.managementToken),C=t(()=>f.settings.versionCli),w=t(()=>`instanceid=${x.value}&version=${C.value}`),T=t(()=>f.settings.license.environment===`production`?`https://subscription.n8n.io`:`https://staging-subscription.n8n.io`),E=e=>{p.loading=e},D=e=>{p.data=e},O=async()=>{D(await o(n.restApiContext))};return{setLoading:E,getLicenseInfo:O,setData:D,activateLicense:async(e,t)=>{D(await a(n.restApiContext,{activationKey:e,eulaUri:t})),await f.getSettings(),await f.getModuleSettings()},refreshLicenseManagementToken:async()=>{try{D(await i(n.restApiContext))}catch{await O()}},requestEnterpriseLicenseTrial:async()=>{await s(n.restApiContext)},registerCommunityEdition:async e=>await c(n.restApiContext,{email:e}),planName:m,planId:h,activeWorkflowTriggersLimit:g,activeWorkflowTriggersCount:_,workflowsWithEvaluationsLimit:v,workflowsWithEvaluationsCount:y,executionPercentage:b,instanceId:x,managementToken:S,appVersion:C,isCloseToLimit:t(()=>p.data.usage.activeWorkflowTriggers.limit<0?!1:_.value/g.value>=p.data.usage.activeWorkflowTriggers.warningThreshold),viewPlansUrl:t(()=>`${T.value}?${w.value}`),managePlanUrl:t(()=>`${T.value}/manage?token=${S.value}&${w.value}`),isLoading:t(()=>p.loading),telemetryPayload:t(()=>({instance_id:x.value,action:`view_plans`,plan_name_current:m.value,usage:_.value,quota:g.value}))}});export{f as t};
//# sourceMappingURL=usage.store-BVY0SoSp.js.map