mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 20:35:59 +00:00
fix: DB list for different connection
This commit is contained in:
@@ -4,6 +4,9 @@
|
||||
import { getFormContext } from '../forms/FormProviderCore.svelte';
|
||||
import FormSelectField from '../forms/FormSelectField.svelte';
|
||||
import { useDatabaseList } from '../utility/metadataLoaders';
|
||||
import uuidv1 from 'uuid/v1';
|
||||
import { temporaryOpenedConnections } from '../stores';
|
||||
import useEffect from '../utility/useEffect';
|
||||
|
||||
export let conidName;
|
||||
|
||||
@@ -17,6 +20,16 @@
|
||||
})),
|
||||
'label'
|
||||
);
|
||||
|
||||
const tmpid = uuidv1();
|
||||
|
||||
$: effect = useEffect(() => {
|
||||
temporaryOpenedConnections.update(x => [...x, { tmpid, conid: $values && $values[conidName] }]);
|
||||
return () => {
|
||||
temporaryOpenedConnections.update(x => x.filter(y => y.tmpid != tmpid));
|
||||
};
|
||||
});
|
||||
$: $effect;
|
||||
</script>
|
||||
|
||||
<FormSelectField {...$$restProps} options={databaseOptions} />
|
||||
|
||||
Reference in New Issue
Block a user