update env vars with geneic splash screen

This commit is contained in:
Peter Clement 2023-02-10 14:57:42 +00:00
parent c2b7c6f388
commit 2bd6ff627a
1 changed files with 34 additions and 86 deletions

View File

@ -1,21 +1,17 @@
<script> <script>
import { import {
Layout, Layout,
Heading,
Body,
Button, Button,
Divider,
Modal, Modal,
Table, Table,
Tags,
Tag,
InlineAlert, InlineAlert,
notifications, notifications,
} from "@budibase/bbui" } from "@budibase/bbui"
import { environment, licensing, auth, admin } from "stores/portal" import { environment, licensing } from "stores/portal"
import { onMount } from "svelte" import { onMount } from "svelte"
import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte" import CreateEditVariableModal from "components/portal/environment/CreateEditVariableModal.svelte"
import EditVariableColumn from "./_components/EditVariableColumn.svelte" import EditVariableColumn from "./_components/EditVariableColumn.svelte"
import LockedFeature from "../../_components/LockedFeature.svelte"
let modal let modal
@ -61,23 +57,16 @@
} }
</script> </script>
<Layout noPadding> <LockedFeature
<Layout gap="XS" noPadding> title={"Environment Variables"}
<div class="title"> planType={"Business plan"}
<Heading size="M">Environment Variables</Heading> description={"Add and manage environment variables for development and production"}
{#if !$licensing.environmentVariablesEnabled} enabled={$licensing.environmentVariablesEnabled}
<Tags> upgradeButtonClick={async () => {
<Tag icon="LockClosed">Business plan</Tag> await environment.upgradePanelOpened()
</Tags> $licensing.goToUpgradePage()
{/if} }}
</div> >
<Body
>Add and manage environment variables for development and production</Body
>
</Layout>
<Divider size="S" />
{#if $licensing.environmentVariablesEnabled}
{#if noEncryptionKey} {#if noEncryptionKey}
<InlineAlert <InlineAlert
message="Your Budibase installation does not have a key for encryption, please update your app service's environment variables to contain an 'ENCRYPTION_KEY' value." message="Your Budibase installation does not have a key for encryption, please update your app service's environment variables to contain an 'ENCRYPTION_KEY' value."
@ -90,7 +79,6 @@
>Add Variable</Button >Add Variable</Button
> >
</div> </div>
<Layout noPadding> <Layout noPadding>
<Table <Table
{schema} {schema}
@ -101,51 +89,11 @@
{customRenderers} {customRenderers}
/> />
</Layout> </Layout>
{:else} </LockedFeature>
<div class="buttons">
<Button
primary
disabled={!$auth.accountPortalAccess && $admin.cloud}
on:click={async () => {
await environment.upgradePanelOpened()
$licensing.goToUpgradePage()
}}
>
Upgrade
</Button>
<!--Show the view plans button-->
<Button
secondary
on:click={() => {
window.open("https://budibase.com/pricing/", "_blank")
}}
>
View Plans
</Button>
</div>
{/if}
</Layout>
<Modal bind:this={modal}> <Modal bind:this={modal}>
<CreateEditVariableModal {save} /> <CreateEditVariableModal {save} />
</Modal> </Modal>
<style> <style>
.buttons {
display: flex;
gap: var(--spacing-l);
}
.title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
gap: var(--spacing-m);
}
.buttons {
display: flex;
flex-direction: row;
gap: var(--spacing-m);
}
</style> </style>