Browse Source

Linting.

gh-pages
mike12345567 6 years ago
parent
commit
b6e5658f4e
  1. 32
      packages/builder/src/components/settings/ThemeEditor.svelte
  2. 1
      packages/builder/src/components/settings/ThemeEditorDropdown.svelte
  3. 12
      packages/builder/src/components/start/BuilderSettingsModal.svelte
  4. 9
      packages/builder/src/components/start/CreateAppModal.svelte
  5. 5
      packages/worker/src/api/controllers/deploy.js
  6. 5
      packages/worker/src/middleware/check-key.js

32
packages/builder/src/components/settings/ThemeEditor.svelte

@ -16,23 +16,23 @@
{/if} {/if}
{#if $themeStore.darkMode && showAdvanced} {#if $themeStore.darkMode && showAdvanced}
<Slider <Slider
label="Hue" label="Hue"
bind:value={$themeStore.hue} bind:value={$themeStore.hue}
min="0" min="0"
max="360" max="360"
showValue /> showValue />
<Slider <Slider
label="Saturation" label="Saturation"
bind:value={$themeStore.saturation} bind:value={$themeStore.saturation}
min="0" min="0"
max="100" max="100"
showValue /> showValue />
<Slider <Slider
label="Lightness" label="Lightness"
bind:value={$themeStore.lightness} bind:value={$themeStore.lightness}
min="0" min="0"
max="32" max="32"
showValue /> showValue />
<div class="button"> <div class="button">
<Button text on:click={themeStore.reset}>Reset</Button> <Button text on:click={themeStore.reset}>Reset</Button>
</div> </div>
@ -51,4 +51,4 @@
.button { .button {
align-self: flex-start; align-self: flex-start;
} }
</style> </style>

1
packages/builder/src/components/settings/ThemeEditorDropdown.svelte

@ -1,5 +1,4 @@
<script> <script>
import { Label, DropdownMenu } from "@budibase/bbui" import { Label, DropdownMenu } from "@budibase/bbui"
import ThemeEditor from "./ThemeEditor.svelte" import ThemeEditor from "./ThemeEditor.svelte"

12
packages/builder/src/components/start/BuilderSettingsModal.svelte

@ -27,7 +27,6 @@
} }
function updateSelfHosting(event) { function updateSelfHosting(event) {
if (hostingInfo.type === "cloud" && event.target.checked) { if (hostingInfo.type === "cloud" && event.target.checked) {
hostingInfo.hostingUrl = "localhost:10000" hostingInfo.hostingUrl = "localhost:10000"
hostingInfo.useHttps = false hostingInfo.useHttps = false
@ -41,10 +40,7 @@
}) })
</script> </script>
<ModalContent <ModalContent title="Builder settings" confirmText="Save" onConfirm={save}>
title="Builder settings"
confirmText="Save"
onConfirm={save}>
<h5>Theme</h5> <h5>Theme</h5>
<ThemeEditor /> <ThemeEditor />
<h5>Hosting</h5> <h5>Hosting</h5>
@ -52,7 +48,11 @@
This section contains settings that relate to the deployment and hosting of This section contains settings that relate to the deployment and hosting of
apps made in this builder. apps made in this builder.
</p> </p>
<Toggle thin text="Self hosted" on:change={updateSelfHosting} bind:checked={selfhosted} /> <Toggle
thin
text="Self hosted"
on:change={updateSelfHosting}
bind:checked={selfhosted} />
{#if selfhosted} {#if selfhosted}
<Input bind:value={hostingInfo.hostingUrl} label="Hosting URL" /> <Input bind:value={hostingInfo.hostingUrl} label="Hosting URL" />
<Input bind:value={hostingInfo.selfHostKey} label="Hosting Key" /> <Input bind:value={hostingInfo.selfHostKey} label="Hosting Key" />

9
packages/builder/src/components/start/CreateAppModal.svelte

@ -1,6 +1,11 @@
<script> <script>
import { writable } from "svelte/store" import { writable } from "svelte/store"
import { store, automationStore, backendUiStore, hostingStore } from "builderStore" import {
store,
automationStore,
backendUiStore,
hostingStore,
} from "builderStore"
import { string, object } from "yup" import { string, object } from "yup"
import api, { get } from "builderStore/api" import api, { get } from "builderStore/api"
import Form from "@svelteschool/svelte-forms" import Form from "@svelteschool/svelte-forms"
@ -12,7 +17,7 @@
import { fade } from "svelte/transition" import { fade } from "svelte/transition"
import { post } from "builderStore/api" import { post } from "builderStore/api"
import analytics from "analytics" import analytics from "analytics"
import {onMount} from "svelte" import { onMount } from "svelte"
//Move this to context="module" once svelte-forms is updated so that it can bind to stores correctly //Move this to context="module" once svelte-forms is updated so that it can bind to stores correctly
const createAppStore = writable({ currentStep: 0, values: {} }) const createAppStore = writable({ currentStep: 0, values: {} })

5
packages/worker/src/api/controllers/deploy.js

@ -11,7 +11,7 @@ const PUBLIC_READ_POLICY = {
{ {
Effect: "Allow", Effect: "Allow",
Principal: { Principal: {
AWS: ["*"] AWS: ["*"],
}, },
Action: "s3:GetObject", Action: "s3:GetObject",
Resource: [`arn:aws:s3:::${APP_BUCKET}/*`], Resource: [`arn:aws:s3:::${APP_BUCKET}/*`],
@ -65,8 +65,7 @@ async function getMinioSession() {
Bucket: APP_BUCKET, Bucket: APP_BUCKET,
}) })
.promise() .promise()
} } else {
else {
throw err throw err
} }
} }

5
packages/worker/src/middleware/check-key.js

@ -1,7 +1,10 @@
const env = require("../environment") const env = require("../environment")
module.exports = async (ctx, next) => { module.exports = async (ctx, next) => {
if (!ctx.request.body.selfHostKey || env.SELF_HOST_KEY !== ctx.request.body.selfHostKey) { if (
!ctx.request.body.selfHostKey ||
env.SELF_HOST_KEY !== ctx.request.body.selfHostKey
) {
ctx.throw(401, "Deployment unauthorised") ctx.throw(401, "Deployment unauthorised")
} else { } else {
await next() await next()

Loading…
Cancel
Save