1
0
Fork 0
mirror of synced 2024-06-28 11:00:55 +12:00

Adding upgrade messaging.

This commit is contained in:
mike12345567 2022-05-18 12:03:27 +01:00
parent 39806d470d
commit 7ec772e0de
2 changed files with 27 additions and 5 deletions

View file

@ -1,7 +1,14 @@
<script>
import { Body, Divider, Heading, Layout, notifications } from "@budibase/bbui"
import {
Body,
Divider,
Heading,
Layout,
notifications,
Link,
} from "@budibase/bbui"
import { onMount } from "svelte"
import { auth, licensing } from "stores/portal"
import { admin, auth, licensing } from "stores/portal"
import Usage from "components/billing/Usage.svelte"
let staticUsage = []
@ -10,6 +17,9 @@
$: quotaUsage = $licensing.quotaUsage
$: license = $auth.user?.license
$: console.log($auth.user)
const upgradeUrl = `${$admin.accountPortalUrl}/portal/upgrade`
const setMonthlyUsage = () => {
monthlyUsage = []
@ -72,7 +82,19 @@
{#if loaded}
<Layout>
<Heading>Usage</Heading>
<Body>Get information about your current usage within Budibase.</Body>
<Body
>Get information about your current usage within Budibase.
{#if $admin.cloud}
{#if $auth.user?.accountPortalAccess}
To upgrade your plan and usage limits visit your <Link
size="L"
href={upgradeUrl}>Account</Link
>.
{:else}
Contact your account holder to upgrade your usage limits.
{/if}
{/if}
</Body>
</Layout>
<Layout gap="S">
<Divider size="S" />

View file

@ -75,8 +75,8 @@ const checkCurrentApp = ctx => {
const addSessionAttributesToUser = ctx => {
ctx.body.account = ctx.user.account
ctx.body.license = ctx.user.license
ctx.body.budibaseAccess = ctx.user.budibaseAccess
ctx.body.accountPortalAccess = ctx.user.accountPortalAccess
ctx.body.budibaseAccess = !!ctx.user.budibaseAccess
ctx.body.accountPortalAccess = !!ctx.user.accountPortalAccess
ctx.body.csrfToken = ctx.user.csrfToken
}