db diff with db model

This commit is contained in:
Jan Prochazka
2021-11-06 20:43:00 +01:00
parent 337ad2968f
commit a462a56a9d
5 changed files with 52 additions and 26 deletions

View File

@@ -3,15 +3,19 @@
import FormSelectField from '../forms/FormSelectField.svelte';
import getConnectionLabel from '../utility/getConnectionLabel';
import { useConnectionList } from '../utility/metadataLoaders';
export let allowChooseModel = false;
$: connections = useConnectionList();
$: connectionOptions = _.sortBy(
($connections || []).map(conn => ({
value: conn._id,
label: getConnectionLabel(conn),
})),
'label'
);
$: connectionOptions = [
...(allowChooseModel ? [{ label: '(DB Model)', value: '__model' }] : []),
..._.sortBy(
($connections || []).map(conn => ({
value: conn._id,
label: getConnectionLabel(conn),
})),
'label'
),
];
</script>
<FormSelectField {...$$restProps} options={connectionOptions} />