mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
fix - show schema selector, when no schema is available
This commit is contained in:
parent
592d7987ab
commit
1f7b632553
@ -38,7 +38,9 @@
|
||||
return res;
|
||||
}
|
||||
|
||||
$: schemaList = _.uniq(_.compact(dbinfo?.schemas?.map(x => x.schemaName) ?? []));
|
||||
$: schemaList = _.uniq(
|
||||
_.compact([selectedSchema, ...Object.keys(countBySchema), ...(dbinfo?.schemas?.map(x => x.schemaName) ?? [])])
|
||||
);
|
||||
$: countBySchema = computeCountBySchema(objectList ?? []);
|
||||
|
||||
function handleAddNewSchema() {
|
||||
@ -53,8 +55,9 @@
|
||||
isNative
|
||||
options={[
|
||||
{ label: `All schemas (${objectList?.length ?? 0})`, value: '' },
|
||||
...schemaList.filter(x => countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })),
|
||||
...schemaList.filter(x => !countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })),
|
||||
...schemaList.map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })),
|
||||
// ...schemaList.filter(x => countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })),
|
||||
// ...schemaList.filter(x => !countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })),
|
||||
]}
|
||||
value={selectedSchema ?? appliedSchema ?? ''}
|
||||
on:change={e => {
|
||||
|
Loading…
Reference in New Issue
Block a user