mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-25 00:03:52 +00:00
* DB Manager state in URL
* Fix state not saving
* shorted uri params
* infer db_type from prefix
* Revert "infer db_type from prefix"
This reverts commit 7415fbed3d.
* dbm syntax
* infer database type
* Omit main and public
* remove legacy #dbmanager:
* Preserve hash
* nit
* Fix remaining dbManagerDrawer objects
55 lines
1.3 KiB
Svelte
55 lines
1.3 KiB
Svelte
<script lang="ts">
|
|
import { WorkspaceService } from '$lib/gen'
|
|
import { workspaceStore } from '$lib/stores'
|
|
|
|
import Select from './select/Select.svelte'
|
|
import ExploreAssetButton, { assetCanBeExplored } from './ExploreAssetButton.svelte'
|
|
import { usePromise } from '$lib/svelte5Utils.svelte'
|
|
|
|
interface Props {
|
|
value?: string | undefined
|
|
disabled?: boolean
|
|
disablePortal?: boolean
|
|
showSchemaExplorer?: boolean
|
|
placeholder?: string | undefined
|
|
selectInputClass?: string
|
|
class?: string
|
|
onClear?: () => void
|
|
}
|
|
|
|
let {
|
|
value = $bindable(undefined),
|
|
disabled = false,
|
|
disablePortal = false,
|
|
showSchemaExplorer = false,
|
|
placeholder = undefined,
|
|
selectInputClass = '',
|
|
class: className = '',
|
|
onClear = undefined
|
|
}: Props = $props()
|
|
|
|
let datatables = usePromise(() =>
|
|
WorkspaceService.listDataTables({ workspace: $workspaceStore ?? '' })
|
|
)
|
|
|
|
</script>
|
|
|
|
<div class={className}>
|
|
<Select
|
|
items={datatables.value?.map((d) => ({ value: d })) ?? []}
|
|
bind:value
|
|
loading={datatables.status === 'loading'}
|
|
{disabled}
|
|
{disablePortal}
|
|
{placeholder}
|
|
inputClass={selectInputClass}
|
|
{onClear}
|
|
/>
|
|
{#if showSchemaExplorer && value && assetCanBeExplored({ kind: 'datatable', path: value })}
|
|
<ExploreAssetButton
|
|
class="mt-1 w-fit"
|
|
asset={{ kind: 'datatable', path: value }}
|
|
/>
|
|
{/if}
|
|
</div>
|