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 f2addd0b9c
commit be04060ff1
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
# to the builder, if this were a prefix then it would break minio
- match: { path: "/" }
redirect: { path_redirect: "/app/" }
redirect: { path_redirect: "/builder/" }
- match: { prefix: "/db/" }
route:
@ -42,14 +42,14 @@ static_resources:
route:
cluster: builder-dev
- match: { prefix: "/app/" }
- match: { prefix: "/builder/" }
route:
cluster: builder-dev
- match: { prefix: "/app" }
- match: { prefix: "/builder" }
route:
cluster: builder-dev
prefix_rewrite: "/app/"
prefix_rewrite: "/builder/"
# minio is on the default route because this works
# 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,
"projectId": "bmbemn",
"env": {

View File

@ -59,7 +59,7 @@
const selectRelationship = ({ tableId, rowId, fieldName }) => {
$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
await del(`/api/applications/${id}`)
loading = false
$goto("/app")
$goto("/builder")
}
</script>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

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

View File

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