This commit is contained in:
mike12345567 2020-12-15 16:42:40 +00:00
parent 21978007cf
commit c65ed9ad46
5 changed files with 14 additions and 8 deletions

View File

@ -7,7 +7,7 @@ const INITIAL_BACKEND_UI_STATE = {
} }
export const getHostingStore = () => { export const getHostingStore = () => {
const store = writable({...INITIAL_BACKEND_UI_STATE}) const store = writable({ ...INITIAL_BACKEND_UI_STATE })
store.actions = { store.actions = {
fetch: async () => { fetch: async () => {
const response = await api.get("/api/hosting/") const response = await api.get("/api/hosting/")
@ -28,7 +28,7 @@ export const getHostingStore = () => {
} }
return state return state
}) })
} },
} }
return store return store

View File

@ -7,7 +7,7 @@
<div> <div>
<Button text on:click={modal.show}> <Button text on:click={modal.show}>
<i class="ri-settings-3-fill"></i> <i class="ri-settings-3-fill" />
<p>Settings</p> <p>Settings</p>
</Button> </Button>
</div> </div>

View File

@ -24,13 +24,19 @@
onMount(async () => { onMount(async () => {
hostingInfo = await hostingStore.actions.fetch() hostingInfo = await hostingStore.actions.fetch()
selfhosted = hostingInfo.type === "self" selfhosted = hostingInfo.type === "self"
}) })
</script> </script>
<ModalContent title="Builder settings" confirmText="Save" onConfirm={save} showConfirmButton={selfhosted}> <ModalContent
title="Builder settings"
confirmText="Save"
onConfirm={save}
showConfirmButton={selfhosted}>
<h5>Hosting</h5> <h5>Hosting</h5>
<p>This section contains settings that relate to the deployment and hosting of apps made in this builder.</p> <p>
This section contains settings that relate to the deployment and hosting of
apps made in this builder.
</p>
<Toggle thin text="Self hosted" bind:checked={selfhosted} /> <Toggle thin text="Self hosted" bind:checked={selfhosted} />
{#if selfhosted} {#if selfhosted}
<Input bind:value={hostingInfo.appServerUrl} label="Apps URL" /> <Input bind:value={hostingInfo.appServerUrl} label="Apps URL" />

View File

@ -39,7 +39,7 @@
href="https://github.com/Budibase/budibase/issues/new/choose" /> href="https://github.com/Budibase/budibase/issues/new/choose" />
</div> </div>
<div class="nav-bottom"> <div class="nav-bottom">
<BuilderSettingsButton/> <BuilderSettingsButton />
</div> </div>
</div> </div>
</div> </div>

View File

@ -32,7 +32,7 @@ exports.getHostingInfo = async () => {
return doc return doc
} }
exports.getAppServerUrl = async (appId) => { exports.getAppServerUrl = async appId => {
const hostingInfo = await exports.getHostingInfo() const hostingInfo = await exports.getHostingInfo()
const protocol = getProtocol(hostingInfo) const protocol = getProtocol(hostingInfo)
let url let url