mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 23:35:59 +00:00
export - tables select
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
<script lang="ts">
|
||||
import _ from 'lodash';
|
||||
|
||||
import FormStyledButton from '../elements/FormStyledButton.svelte';
|
||||
|
||||
import { getFormContext } from '../forms/FormProviderCore.svelte';
|
||||
import FormSelectField from '../forms/FormSelectField.svelte';
|
||||
import { useDatabaseInfo, useDatabaseList } from '../utility/metadataLoaders';
|
||||
@@ -6,8 +10,9 @@
|
||||
export let conidName;
|
||||
export let databaseName;
|
||||
export let schemaName;
|
||||
export let name;
|
||||
|
||||
const { values } = getFormContext();
|
||||
const { values, setFieldValue } = getFormContext();
|
||||
$: dbinfo = useDatabaseInfo({ conid: $values[conidName], database: $values[databaseName] });
|
||||
|
||||
$: tablesOptions = [...(($dbinfo && $dbinfo.tables) || []), ...(($dbinfo && $dbinfo.views) || [])]
|
||||
@@ -18,4 +23,28 @@
|
||||
}));
|
||||
</script>
|
||||
|
||||
<FormSelectField {...$$restProps} options={tablesOptions} isMulti />
|
||||
<div class="wrapper">
|
||||
<FormSelectField {...$$restProps} {name} options={tablesOptions} isMulti templateProps={{ noMargin: true }} />
|
||||
|
||||
<div>
|
||||
<FormStyledButton
|
||||
type="button"
|
||||
value="All tables"
|
||||
on:click={() =>
|
||||
setFieldValue(name, _.uniq([...($values[name] || []), ...($dbinfo && $dbinfo.tables.map(x => x.pureName))]))}
|
||||
/>
|
||||
<FormStyledButton
|
||||
type="button"
|
||||
value="All views"
|
||||
on:click={() =>
|
||||
setFieldValue(name, _.uniq([...($values[name] || []), ...($dbinfo && $dbinfo.views.map(x => x.pureName))]))}
|
||||
/>
|
||||
<FormStyledButton type="button" value="Remove all" on:click={() => setFieldValue(name, [])} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.wrapper {
|
||||
margin: var(--dim-large-form-margin);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
</svelte:fragment>
|
||||
|
||||
<div class="wrapper">
|
||||
<HorizontalSplitter>
|
||||
<HorizontalSplitter initialValue="70%">
|
||||
<svelte:fragment slot="1">
|
||||
<ImportExportConfigurator />
|
||||
</svelte:fragment>
|
||||
|
||||
Reference in New Issue
Block a user