2020-05-29 14:28:12 +02:00
|
|
|
<script>
|
2020-11-18 23:04:18 +01:00
|
|
|
import { onMount } from "svelte"
|
2020-11-05 18:47:27 +01:00
|
|
|
import { store, currentScreens } from "builderStore"
|
2020-11-18 23:04:18 +01:00
|
|
|
import api from "builderStore/api"
|
2020-11-19 17:41:29 +01:00
|
|
|
import ComponentNavigationTree from "components/userInterface/ComponentNavigationTree/index.svelte"
|
2020-05-29 14:28:12 +02:00
|
|
|
import PageLayout from "components/userInterface/PageLayout.svelte"
|
|
|
|
import PagesList from "components/userInterface/PagesList.svelte"
|
2020-10-08 10:35:11 +02:00
|
|
|
import NewScreenModal from "components/userInterface/NewScreenModal.svelte"
|
2020-10-22 19:12:40 +02:00
|
|
|
import { Modal } from "@budibase/bbui"
|
2020-05-29 19:32:52 +02:00
|
|
|
|
2020-10-08 10:35:11 +02:00
|
|
|
let modal
|
2020-11-18 23:04:18 +01:00
|
|
|
|
|
|
|
let routes = {}
|
|
|
|
|
|
|
|
async function fetchRoutes() {
|
|
|
|
const response = await api.get("/api/routing")
|
|
|
|
const json = await response.json()
|
|
|
|
|
|
|
|
routes = json.routes
|
|
|
|
}
|
|
|
|
|
|
|
|
onMount(() => {
|
|
|
|
fetchRoutes()
|
|
|
|
})
|
2020-05-29 14:28:12 +02:00
|
|
|
</script>
|
|
|
|
|
2020-10-22 19:12:40 +02:00
|
|
|
<div class="title">
|
|
|
|
<h1>Screens</h1>
|
2020-10-27 16:26:07 +01:00
|
|
|
<i on:click={modal.show} data-cy="new-screen" class="ri-add-circle-fill" />
|
2020-10-22 19:12:40 +02:00
|
|
|
</div>
|
2020-05-29 19:31:47 +02:00
|
|
|
<PagesList />
|
|
|
|
<div class="nav-items-container">
|
2020-10-21 10:19:26 +02:00
|
|
|
<PageLayout layout={$store.pages[$store.currentPageName]} />
|
2020-11-19 17:41:29 +01:00
|
|
|
<ComponentNavigationTree {routes} />
|
2020-05-29 14:28:12 +02:00
|
|
|
</div>
|
2020-10-08 10:35:11 +02:00
|
|
|
<Modal bind:this={modal}>
|
|
|
|
<NewScreenModal />
|
|
|
|
</Modal>
|
2020-10-22 19:12:40 +02:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.title {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
.title h1 {
|
|
|
|
font-size: var(--font-size-m);
|
|
|
|
font-weight: 500;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
.title i {
|
|
|
|
font-size: 20px;
|
|
|
|
}
|
|
|
|
.title i:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
color: var(--blue);
|
|
|
|
}
|
|
|
|
</style>
|