mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 15:16:01 +00:00
import export
This commit is contained in:
21
packages/web/src/impexp/FormDatabaseSelect.svelte
Normal file
21
packages/web/src/impexp/FormDatabaseSelect.svelte
Normal file
@@ -0,0 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { getFormContext } from '../forms/FormProviderCore.svelte';
|
||||
import FormSelectField from '../forms/FormSelectField.svelte';
|
||||
import { useDatabaseList } from '../utility/metadataLoaders';
|
||||
|
||||
export let conidName;
|
||||
|
||||
const { values } = getFormContext();
|
||||
$: databases = useDatabaseList({ conid: $values[conidName] });
|
||||
|
||||
$: databaseOptions = ($databases || []).map(db => ({
|
||||
value: db.name,
|
||||
label: db.name,
|
||||
}));
|
||||
</script>
|
||||
|
||||
{#if databaseOptions.length == 0}
|
||||
<div>Not available</div>
|
||||
{:else}
|
||||
<FormSelectField {...$$restProps} options={databaseOptions} />
|
||||
{/if}
|
||||
Reference in New Issue
Block a user