diff --git a/frontend/src/lib/utils.ts b/frontend/src/lib/utils.ts index 828609146f..42bdf47a9a 100644 --- a/frontend/src/lib/utils.ts +++ b/frontend/src/lib/utils.ts @@ -655,7 +655,7 @@ export function addWhitespaceBeforeCapitals(word?: string): string { } export function isCloudHosted(): boolean { - return (get(page)?.url?.hostname == 'app.windmill.dev') || true + return (get(page)?.url?.hostname == 'app.windmill.dev') } export function isObject(obj: any) { diff --git a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte index 53758176bd..bae8b47495 100644 --- a/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte +++ b/frontend/src/routes/(root)/(logged)/workspace_settings/+page.svelte @@ -7,9 +7,15 @@ Script } from '$lib/gen' import type { User } from '$lib/gen' - import { sendUserToast, isCloudHosted } from '$lib/utils' + import { sendUserToast, isCloudHosted, capitalize } from '$lib/utils' import PageHeader from '$lib/components/PageHeader.svelte' - import { superadmin, userStore, usersWorkspaceStore, workspaceStore } from '$lib/stores' + import { + superadmin, + usageStore, + userStore, + usersWorkspaceStore, + workspaceStore + } from '$lib/stores' import CenteredPage from '$lib/components/CenteredPage.svelte' import { faSlack } from '@fortawesome/free-brands-svg-icons' import TableCustom from '$lib/components/TableCustom.svelte' @@ -427,7 +433,7 @@ {#if isCloudHosted()}
{#if customer_id} -
+
{/if} -
+
{#if premium_info?.premium} -
-
Current plan:
{plan ?? 'Free plan'}
+
{#if plan} - {@const team_factor = plan == 'team' ? 10 : 50} - {@const max = (users?.length ?? 0) * team_factor} +
{capitalize(plan ?? 'free')} plan
+ {:else} +
Free plan
+ {/if} + + {#if plan} + {@const team_factor = plan == 'team' ? 8 : 32} + {@const user_nb = Math.max(0, (users?.filter((x) => !x.operator).length ?? 0) - 1)}
- Current number of seats in this workspace: -
{users?.length ?? 0} * ${team_factor} = ${(users?.length ?? 0) * - team_factor}/mo
{user_nb} * ${team_factor} + = ${(users?.length ?? 0) * team_factor}/mo
Actual pricing is calculated on the MAXIMUM number of users in a given billing period, see the customer portal for more info.
-
- Included number of executions based on your seats and plan: -
{users?.length ?? 0} seats x {plan == 'team' ? '10k' : '50k'} = {max}k + Extra operators: +
{Math.max(0, (users?.filter((x) => x.operator).length ?? 0) - 1)} * ${team_factor / + 2} = ${((users?.length ?? 0) * team_factor) / 2}/mo
+ Actual pricing is calculated on the MAXIMUM number of users in a given billing + period, see the customer portal for more info. +
+
+ Computations executed this month: +
{premium_info?.usage ?? 0} +
+
+
+ Extra computations (above the 10k included) this month: +
{Math.max(0, (premium_info?.usage ?? 0) - 10000)} x {plan == 'team' + ? '0.001' + : '0.004'} = ${Math.max(0, (premium_info?.usage ?? 0) - 10000) * + (plan == 'team' ? 0.001 : 0.004)}
{/if}