PR comments.
This commit is contained in:
parent
1299917e94
commit
489c67511c
|
@ -23,5 +23,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#key $params.datasourceId}
|
{#key $params.datasourceId}
|
||||||
<slot />
|
{#if $datasources.selected}
|
||||||
|
<slot />
|
||||||
|
{/if}
|
||||||
{/key}
|
{/key}
|
||||||
|
|
|
@ -12,18 +12,11 @@
|
||||||
import PromptQueryModal from "./_components/PromptQueryModal.svelte"
|
import PromptQueryModal from "./_components/PromptQueryModal.svelte"
|
||||||
import SettingsPanel from "./_components/panels/Settings.svelte"
|
import SettingsPanel from "./_components/panels/Settings.svelte"
|
||||||
import { helpers } from "@budibase/shared-core"
|
import { helpers } from "@budibase/shared-core"
|
||||||
import { goto } from "@roxi/routify"
|
|
||||||
|
|
||||||
let selectedPanel = null
|
let selectedPanel = null
|
||||||
let panelOptions = []
|
let panelOptions = []
|
||||||
|
|
||||||
// datasources.selected can return null temporarily on datasource deletion
|
|
||||||
$: datasource = $datasources.selected
|
$: datasource = $datasources.selected
|
||||||
$: {
|
|
||||||
if (!datasource) {
|
|
||||||
$goto("./datasource")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$: getOptions(datasource)
|
$: getOptions(datasource)
|
||||||
|
|
||||||
|
@ -58,53 +51,51 @@
|
||||||
|
|
||||||
<PromptQueryModal />
|
<PromptQueryModal />
|
||||||
|
|
||||||
{#if datasource}
|
<section>
|
||||||
<section>
|
<Layout noPadding>
|
||||||
<Layout noPadding>
|
<Layout gap="XS" noPadding>
|
||||||
<Layout gap="XS" noPadding>
|
<header>
|
||||||
<header>
|
<svelte:component
|
||||||
<svelte:component
|
this={ICONS[datasource.source]}
|
||||||
this={ICONS[datasource.source]}
|
height="26"
|
||||||
height="26"
|
width="26"
|
||||||
width="26"
|
/>
|
||||||
/>
|
<Heading size="M">{$datasources.selected?.name}</Heading>
|
||||||
<Heading size="M">{$datasources.selected?.name}</Heading>
|
</header>
|
||||||
</header>
|
|
||||||
</Layout>
|
|
||||||
<EditDatasourceConfig {datasource} />
|
|
||||||
<div class="tabs">
|
|
||||||
<Tabs size="L" noPadding noHorizPadding selected={selectedPanel}>
|
|
||||||
{#each panelOptions as panelOption}
|
|
||||||
<Tab
|
|
||||||
title={panelOption}
|
|
||||||
on:click={() => (selectedPanel = panelOption)}
|
|
||||||
/>
|
|
||||||
{/each}
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{#if selectedPanel === null}
|
|
||||||
<Body>loading...</Body>
|
|
||||||
{:else if selectedPanel === "Tables"}
|
|
||||||
<TablesPanel {datasource} />
|
|
||||||
{:else if selectedPanel === "Relationships"}
|
|
||||||
<RelationshipsPanel {datasource} />
|
|
||||||
{:else if selectedPanel === "Queries"}
|
|
||||||
<QueriesPanel {datasource} />
|
|
||||||
{:else if selectedPanel === "Headers"}
|
|
||||||
<RestHeadersPanel {datasource} />
|
|
||||||
{:else if selectedPanel === "Authentication"}
|
|
||||||
<RestAuthenticationPanel {datasource} />
|
|
||||||
{:else if selectedPanel === "Variables"}
|
|
||||||
<RestVariablesPanel {datasource} />
|
|
||||||
{:else if selectedPanel === "Settings"}
|
|
||||||
<SettingsPanel {datasource} />
|
|
||||||
{:else}
|
|
||||||
<Body>Something went wrong</Body>
|
|
||||||
{/if}
|
|
||||||
</Layout>
|
</Layout>
|
||||||
</section>
|
<EditDatasourceConfig {datasource} />
|
||||||
{/if}
|
<div class="tabs">
|
||||||
|
<Tabs size="L" noPadding noHorizPadding selected={selectedPanel}>
|
||||||
|
{#each panelOptions as panelOption}
|
||||||
|
<Tab
|
||||||
|
title={panelOption}
|
||||||
|
on:click={() => (selectedPanel = panelOption)}
|
||||||
|
/>
|
||||||
|
{/each}
|
||||||
|
</Tabs>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{#if selectedPanel === null}
|
||||||
|
<Body>loading...</Body>
|
||||||
|
{:else if selectedPanel === "Tables"}
|
||||||
|
<TablesPanel {datasource} />
|
||||||
|
{:else if selectedPanel === "Relationships"}
|
||||||
|
<RelationshipsPanel {datasource} />
|
||||||
|
{:else if selectedPanel === "Queries"}
|
||||||
|
<QueriesPanel {datasource} />
|
||||||
|
{:else if selectedPanel === "Headers"}
|
||||||
|
<RestHeadersPanel {datasource} />
|
||||||
|
{:else if selectedPanel === "Authentication"}
|
||||||
|
<RestAuthenticationPanel {datasource} />
|
||||||
|
{:else if selectedPanel === "Variables"}
|
||||||
|
<RestVariablesPanel {datasource} />
|
||||||
|
{:else if selectedPanel === "Settings"}
|
||||||
|
<SettingsPanel {datasource} />
|
||||||
|
{:else}
|
||||||
|
<Body>Something went wrong</Body>
|
||||||
|
{/if}
|
||||||
|
</Layout>
|
||||||
|
</section>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
section {
|
section {
|
||||||
|
|
Loading…
Reference in New Issue