Server builder under /builder rather than /app for top level to avoid confusion

This commit is contained in:
Andrew Kingston 2021-05-07 08:17:21 +01:00
parent f173d16695
commit 9f39690eb1
55 changed files with 32 additions and 29 deletions

View File

@ -19,7 +19,7 @@ static_resources:
# special case to redirect specifically the route path # special case to redirect specifically the route path
# to the builder, if this were a prefix then it would break minio # to the builder, if this were a prefix then it would break minio
- match: { path: "/" } - match: { path: "/" }
redirect: { path_redirect: "/app/" } redirect: { path_redirect: "/builder/" }
- match: { prefix: "/db/" } - match: { prefix: "/db/" }
route: route:
@ -42,14 +42,14 @@ static_resources:
route: route:
cluster: builder-dev cluster: builder-dev
- match: { prefix: "/app/" } - match: { prefix: "/builder/" }
route: route:
cluster: builder-dev cluster: builder-dev
- match: { prefix: "/app" } - match: { prefix: "/builder" }
route: route:
cluster: builder-dev cluster: builder-dev
prefix_rewrite: "/app/" prefix_rewrite: "/builder/"
# minio is on the default route because this works # minio is on the default route because this works
# best, minio + AWS SDK doesn't handle path proxy # best, minio + AWS SDK doesn't handle path proxy

View File

@ -1,5 +1,5 @@
{ {
"baseUrl": "http://localhost:10000/app/", "baseUrl": "http://localhost:10000/builder/",
"video": true, "video": true,
"projectId": "bmbemn", "projectId": "bmbemn",
"env": { "env": {

View File

@ -59,7 +59,7 @@
const selectRelationship = ({ tableId, rowId, fieldName }) => { const selectRelationship = ({ tableId, rowId, fieldName }) => {
$goto( $goto(
`/app/builder/${$params.application}/data/table/${tableId}/relationship/${rowId}/${fieldName}` `/builder/app/${$params.application}/data/table/${tableId}/relationship/${rowId}/${fieldName}`
) )
} }

View File

@ -11,7 +11,7 @@
const id = $params.application const id = $params.application
await del(`/api/applications/${id}`) await del(`/api/applications/${id}`)
loading = false loading = false
$goto("/app") $goto("/builder")
} }
</script> </script>

View File

@ -36,7 +36,7 @@
<Layout noPadding gap="XS"> <Layout noPadding gap="XS">
<div class="preview" use:gradient /> <div class="preview" use:gradient />
<div class="title"> <div class="title">
<Link href={`/app/builder/${_id}`}> <Link href={`/builder/app/${_id}`}>
<Heading size="XS"> <Heading size="XS">
{name} {name}
</Heading> </Heading>

View File

@ -112,7 +112,7 @@
} }
const userResp = await api.post(`/api/users/metadata/self`, user) const userResp = await api.post(`/api/users/metadata/self`, user)
await userResp.json() await userResp.json()
$goto(`/app/builder/${appJson._id}`) window.location = `/builder/app/${appJson._id}`
} catch (error) { } catch (error) {
console.error(error) console.error(error)
notifications.error(error) notifications.error(error)

View File

@ -11,12 +11,14 @@
await admin.init() await admin.init()
await auth.checkAuth() await auth.checkAuth()
loaded = true loaded = true
})
// Force creation of an admin user if one doesn't exist // Force creation of an admin user if one doesn't exist
if (!hasAdminUser) { $: {
if (loaded && !hasAdminUser) {
$goto("./admin") $goto("./admin")
} }
}) }
// Redirect to log in at any time if the user isn't authenticated // Redirect to log in at any time if the user isn't authenticated
$: { $: {

View File

@ -2,15 +2,14 @@
import { import {
Button, Button,
Heading, Heading,
Label,
notifications, notifications,
Layout, Layout,
Input, Input,
Body, Body,
} from "@budibase/bbui" } from "@budibase/bbui"
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
import { onMount } from "svelte"
import api from "builderStore/api" import api from "builderStore/api"
import { admin } from "stores/portal"
let adminUser = {} let adminUser = {}
@ -18,13 +17,15 @@
try { try {
// Save the admin user // Save the admin user
const response = await api.post(`/api/admin/users/init`, adminUser) const response = await api.post(`/api/admin/users/init`, adminUser)
const json = await response.json() const json = await response.json()
if (response.status !== 200) throw new Error(json.message) if (response.status !== 200) {
notifications.success(`Admin user created.`) throw new Error(json.message)
}
notifications.success(`Admin user created`)
await admin.init()
$goto("../portal") $goto("../portal")
} catch (err) { } catch (err) {
notifications.error(`Failed to create admin user.`) notifications.error(`Failed to create admin user`)
} }
} }
</script> </script>

View File

@ -35,19 +35,19 @@
onMount(getInfo) onMount(getInfo)
let menu = [ let menu = [
{ title: "Apps", href: "/app/portal/apps" }, { title: "Apps", href: "/builder/portal/apps" },
{ title: "Drafts", href: "/app/portal/drafts" }, { title: "Drafts", href: "/builder/portal/drafts" },
{ title: "Users", href: "/app/portal/users", heading: "Manage" }, { title: "Users", href: "/builder/portal/users", heading: "Manage" },
{ title: "Groups", href: "/app/portal/groups" }, { title: "Groups", href: "/builder/portal/groups" },
{ title: "Auth", href: "/app/portal/oauth" }, { title: "Auth", href: "/builder/portal/oauth" },
{ title: "Email", href: "/app/portal/email" }, { title: "Email", href: "/builder/portal/email" },
{ {
title: "General", title: "General",
href: "/app/portal/settings/general", href: "/builder/portal/settings/general",
heading: "Settings", heading: "Settings",
}, },
{ title: "Theming", href: "/app/portal/theming" }, { title: "Theming", href: "/builder/portal/theming" },
{ title: "Account", href: "/app/portal/account" }, { title: "Account", href: "/builder/portal/account" },
] ]
</script> </script>

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,4 +1,4 @@
<script> <script>
import { goto } from "@roxi/routify" import { goto } from "@roxi/routify"
$goto("./app") $goto("./builder")
</script> </script>

View File

@ -6,7 +6,7 @@ import path from "path"
export default ({ mode }) => { export default ({ mode }) => {
const isProduction = mode === "production" const isProduction = mode === "production"
return { return {
base: "/app/", base: "/builder/",
build: { build: {
minify: isProduction, minify: isProduction,
outDir: "../server/builder", outDir: "../server/builder",