diff --git a/frontend/src/lib/components/settings/PremiumInfo.svelte b/frontend/src/lib/components/settings/PremiumInfo.svelte new file mode 100644 index 0000000000..e6fa635856 --- /dev/null +++ b/frontend/src/lib/components/settings/PremiumInfo.svelte @@ -0,0 +1,238 @@ + + +
+
+
Plans
+
+{#if customer_id} +
+ +

+ See invoices, change billing information or subscription details +

+
+{/if} + +
+ {#if premium_info?.premium} +
+ {#if plan} +
+ Current plan: {capitalize(plan ?? 'free')} plan +
+ {:else} +
Current plan: Free plan
+ {/if} + + {#if plan} + {@const team_factor = plan == 'team' ? 10 : 40} + {@const user_nb = users?.filter((x) => !x.operator)?.length ?? 0} + {@const operator_nb = users?.filter((x) => x.operator)?.length ?? 0} + {@const seats_from_users = Math.ceil(user_nb + operator_nb / 2)} + {@const seats_from_comps = Math.ceil((premium_info?.usage ?? 0) / 10000)} + +
+ + + + + Authors + + Actual pricing is calculated on the MAXIMUM number of users in a given billing + period, see the customer portal for more info. + + + +
+ {user_nb} +
+
+ + + + Operators + + Actual pricing is calculated on the MAXIMUM number of operators in a given + billing period, see the customer portal for more info. + + + +
+ {operator_nb} +
+
+ + + Seats from authors + operators + +
+ ceil({user_nb} + {operator_nb}/2) = {seats_from_users} +
+
+ + + Computations executed this month + +
+ {premium_info?.usage ?? 0} +
+
+ + + Seats from computations + +
+ ceil({premium_info?.usage ?? 0} / 10 000) = {seats_from_comps} +
+
+ + + Total seats + +
+ max({seats_from_comps}, {seats_from_users}) * {team_factor} = ${Math.max( + seats_from_comps, + seats_from_users + ) * team_factor}/mo +
+
+ + +
+
+ {/if} +
+ {:else} + This workspace is NOT on a team plan. Users use their global free-tier quotas when doing executions + in this workspace. Upgrade to a Team or Enterprise plan to unlock unlimited executions in this workspace. + {/if} +
+ +
All plans
+ +
+ {#each Object.entries(plans) as [planTitle, planDesc]} +
+

{planTitle}

+
    + {#each planDesc as item} +
  • {@html item}
  • + {/each} +
+ +
+ {#if planTitle == 'Team'} + {#if plan != 'team'} +
+ +
+ {:else} +
Workspace is on the team plan
+ {/if} + {:else if planTitle == 'Enterprise'} + {#if plan != 'enterprise'} +
+ +
+ {:else} +
Workspace is on enterprise plan
+ {/if} + {:else if !plan} + Workspace is on the free plan + {:else} +
+ +
+ {/if} +
+ {/each} +
+
+
Frequently asked questions
+ +
+
+
What is an execution?
+
+ The single credit-unit is called an "execution". An execution corresponds to a single job + whose duration is less than 1s. For any additional seconds of computation, an additional + execution is accounted for. Jobs are executed on one powerful virtual CPU with 2Gb of + memory. Most jobs will take less than 200ms to execute. +
+
+
+
+ What is the difference between an author and an operator? +
+
+ An author can write scripts/flows/apps/variables/resources. An operator can only run/view + them. +
+
+
+