Create app user facing maintenance page.
This commit is contained in:
parent
02158a0fb1
commit
fcd7ee10f1
|
@ -3,6 +3,12 @@
|
||||||
import { Heading, Body, Button, Layout } from "@budibase/bbui"
|
import { Heading, Body, Button, Layout } from "@budibase/bbui"
|
||||||
import { admin } from "stores/portal"
|
import { admin } from "stores/portal"
|
||||||
import BudibaseLogo from "../portal/_components/BudibaseLogo.svelte"
|
import BudibaseLogo from "../portal/_components/BudibaseLogo.svelte"
|
||||||
|
|
||||||
|
$: {
|
||||||
|
if ($admin.maintenance.length === 0) {
|
||||||
|
window.location = "/builder"
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="main">
|
<div class="main">
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
appStore,
|
appStore,
|
||||||
devToolsStore,
|
devToolsStore,
|
||||||
devToolsEnabled,
|
devToolsEnabled,
|
||||||
|
environmentStore,
|
||||||
} from "stores"
|
} from "stores"
|
||||||
import NotificationDisplay from "components/overlay/NotificationDisplay.svelte"
|
import NotificationDisplay from "components/overlay/NotificationDisplay.svelte"
|
||||||
import ConfirmationDisplay from "components/overlay/ConfirmationDisplay.svelte"
|
import ConfirmationDisplay from "components/overlay/ConfirmationDisplay.svelte"
|
||||||
|
@ -36,6 +37,7 @@
|
||||||
import DevToolsHeader from "components/devtools/DevToolsHeader.svelte"
|
import DevToolsHeader from "components/devtools/DevToolsHeader.svelte"
|
||||||
import DevTools from "components/devtools/DevTools.svelte"
|
import DevTools from "components/devtools/DevTools.svelte"
|
||||||
import FreeFooter from "components/FreeFooter.svelte"
|
import FreeFooter from "components/FreeFooter.svelte"
|
||||||
|
import MaintenanceScreen from "components/MaintenanceScreen.svelte"
|
||||||
import licensing from "../licensing"
|
import licensing from "../licensing"
|
||||||
|
|
||||||
// Provide contexts
|
// Provide contexts
|
||||||
|
@ -111,6 +113,9 @@
|
||||||
class="spectrum spectrum--medium {$themeStore.baseTheme} {$themeStore.theme}"
|
class="spectrum spectrum--medium {$themeStore.baseTheme} {$themeStore.theme}"
|
||||||
class:builder={$builderStore.inBuilder}
|
class:builder={$builderStore.inBuilder}
|
||||||
>
|
>
|
||||||
|
{#if $environmentStore.maintenance.length > 0}
|
||||||
|
<MaintenanceScreen maintenanceList={$environmentStore.maintenance} />
|
||||||
|
{:else}
|
||||||
<DeviceBindingsProvider>
|
<DeviceBindingsProvider>
|
||||||
<UserBindingsProvider>
|
<UserBindingsProvider>
|
||||||
<StateBindingsProvider>
|
<StateBindingsProvider>
|
||||||
|
@ -128,8 +133,10 @@
|
||||||
<div
|
<div
|
||||||
id="clip-root"
|
id="clip-root"
|
||||||
class:preview={$builderStore.inBuilder}
|
class:preview={$builderStore.inBuilder}
|
||||||
class:tablet-preview={$builderStore.previewDevice === "tablet"}
|
class:tablet-preview={$builderStore.previewDevice ===
|
||||||
class:mobile-preview={$builderStore.previewDevice === "mobile"}
|
"tablet"}
|
||||||
|
class:mobile-preview={$builderStore.previewDevice ===
|
||||||
|
"mobile"}
|
||||||
>
|
>
|
||||||
<!-- Actual app -->
|
<!-- Actual app -->
|
||||||
<div id="app-root">
|
<div id="app-root">
|
||||||
|
@ -227,6 +234,7 @@
|
||||||
</StateBindingsProvider>
|
</StateBindingsProvider>
|
||||||
</UserBindingsProvider>
|
</UserBindingsProvider>
|
||||||
</DeviceBindingsProvider>
|
</DeviceBindingsProvider>
|
||||||
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<KeyboardManager />
|
<KeyboardManager />
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -1,6 +1,17 @@
|
||||||
|
<!--
|
||||||
|
This is the public facing maintenance screen. It is displayed when there is
|
||||||
|
required maintenance to be done on the Budibase installation. We only use this
|
||||||
|
if we detect that the Budibase installation is in a state where the vast
|
||||||
|
majority of apps would not function correctly.
|
||||||
|
|
||||||
|
The builder-facing maintenance screen is in
|
||||||
|
packages/builder/src/pages/builder/maintenance/index.svelte, and tends to
|
||||||
|
contain more detailed information and actions for the installation owner to
|
||||||
|
take.
|
||||||
|
-->
|
||||||
<script>
|
<script>
|
||||||
import { MaintenanceType } from "@budibase/types"
|
import { MaintenanceType } from "@budibase/types"
|
||||||
import { Heading, Body, Button, Layout } from "@budibase/bbui"
|
import { Heading, Body, Layout } from "@budibase/bbui"
|
||||||
|
|
||||||
export let maintenanceList
|
export let maintenanceList
|
||||||
</script>
|
</script>
|
||||||
|
@ -11,22 +22,14 @@
|
||||||
{#each maintenanceList as maintenance}
|
{#each maintenanceList as maintenance}
|
||||||
{#if maintenance.type === MaintenanceType.SQS_MISSING}
|
{#if maintenance.type === MaintenanceType.SQS_MISSING}
|
||||||
<Layout>
|
<Layout>
|
||||||
<Heading>Please upgrade your Budibase installation</Heading>
|
<Heading>Budibase installation requires maintenance</Heading>
|
||||||
<Body>
|
<Body>
|
||||||
We've detected that the version of Budibase you're using depends
|
The administrator of this Budibase installation needs to take
|
||||||
on a more recent version of the CouchDB database than what you
|
actions to update components that are out of date. Please contact
|
||||||
have installed.
|
them and show them this warning. More information will be
|
||||||
</Body>
|
available when they log into their account.
|
||||||
<Body>
|
|
||||||
To resolve this, you can either rollback to a previous version of
|
|
||||||
Budibase, or follow the migration guide to update to a later
|
|
||||||
version of CouchDB.
|
|
||||||
</Body>
|
</Body>
|
||||||
</Layout>
|
</Layout>
|
||||||
<Button
|
|
||||||
on:click={() => (window.location = "https://docs.budibase.com")}
|
|
||||||
>Migration guide</Button
|
|
||||||
>
|
|
||||||
{/if}
|
{/if}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import ClientApp from "./components/ClientApp.svelte"
|
import ClientApp from "./components/ClientApp.svelte"
|
||||||
import UpdatingApp from "./components/UpdatingApp.svelte"
|
import UpdatingApp from "./components/UpdatingApp.svelte"
|
||||||
import MaintenanceScreen from "./components/MaintenanceScreen.svelte"
|
|
||||||
import {
|
import {
|
||||||
builderStore,
|
builderStore,
|
||||||
appStore,
|
appStore,
|
||||||
|
@ -66,15 +65,6 @@ const loadBudibase = async () => {
|
||||||
await environmentStore.actions.fetchEnvironment()
|
await environmentStore.actions.fetchEnvironment()
|
||||||
}
|
}
|
||||||
|
|
||||||
const maintenanceList = get(environmentStore)?.maintenance
|
|
||||||
if (maintenanceList?.length > 0) {
|
|
||||||
new MaintenanceScreen({
|
|
||||||
target: window.document.body,
|
|
||||||
props: { maintenanceList },
|
|
||||||
})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// Register handler for runtime events from the builder
|
// Register handler for runtime events from the builder
|
||||||
window.handleBuilderRuntimeEvent = (type, data) => {
|
window.handleBuilderRuntimeEvent = (type, data) => {
|
||||||
if (!window["##BUDIBASE_IN_BUILDER##"]) {
|
if (!window["##BUDIBASE_IN_BUILDER##"]) {
|
||||||
|
|
Loading…
Reference in New Issue