fix: show upgrade cta only to free users

This commit is contained in:
Arman
2023-12-20 16:44:53 +01:00
parent 97ecbb6534
commit 206c3ee3c9
3 changed files with 18 additions and 14 deletions
+5 -2
View File
@@ -21,6 +21,7 @@
import { tierToPlan, type PlanServices } from '$lib/stores/billing';
import { isCloud } from '$lib/system';
import { organization } from '$lib/stores/organization';
import { Button } from '$lib/elements/forms';
export let logs: Models.LogList;
export let offset = 0;
@@ -50,8 +51,10 @@
Logs are retained in rolling {hoursToDays(limit)} intervals with the
{tierToPlan($organization.billingPlan).name}
plan.
<button class="link" type="button" on:click|preventDefault={upgradeMethod}
>Upgrade</button> to increase your log retention for a longer period.
{#if $organization?.billingPlan === 'tier-0'}
<Button link on:click={upgradeMethod}>Upgrade</Button> to increase your log
retention for a longer period.
{/if}
</p>
</svelte:fragment>
{#each logs.logs as log}
+9 -7
View File
@@ -19,6 +19,7 @@
import { getServiceLimit, tierToPlan } from '$lib/stores/billing';
import { organization } from '$lib/stores/organization';
import { app } from '$lib/stores/app';
import { Button } from '$lib/elements/forms';
let selectedRequest = 'parameters';
let selectedResponse = 'logs';
@@ -310,13 +311,14 @@
<Alert>
Logs are retained in rolling {hoursToDays(limit)} intervals
with the {tier} plan.
<button
class="link"
type="button"
on:click|preventDefault={() =>
wizard.start(ChangeOrganizationTierCloud)}
>Upgrade</button> to increase your log retention for
a longer period.
{#if $organization.billingPlan === 'tier-0'}
<Button
link
on:click={() =>
wizard.start(ChangeOrganizationTierCloud)}
>Upgrade</Button> to increase your log retention
for a longer period.
{/if}
</Alert>
{/if}
<Code withCopy noMargin code={execution.logs} language="sh" />
@@ -221,11 +221,10 @@
Logs are retained in rolling {hoursToDays(limit)} intervals with the
{tierToPlan($organization.billingPlan).name}
plan.
<button
class="link"
type="button"
on:click|preventDefault={upgradeMethod}>Upgrade</button> to increase
your log retention for a longer period.
{#if $organization.billingPlan === 'tier-0'}
<Button link on:click={upgradeMethod}>Upgrade</Button> to increase
your log retention for a longer period.
{/if}
</p>
</svelte:fragment>
{#each $deploymentList.deployments as deployment, index (deployment.$id)}