mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-28 10:45:59 +00:00
fix - show schema selector, when no schema is available
This commit is contained in:
@@ -38,7 +38,9 @@
|
|||||||
return res;
|
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 ?? []);
|
$: countBySchema = computeCountBySchema(objectList ?? []);
|
||||||
|
|
||||||
function handleAddNewSchema() {
|
function handleAddNewSchema() {
|
||||||
@@ -53,8 +55,9 @@
|
|||||||
isNative
|
isNative
|
||||||
options={[
|
options={[
|
||||||
{ label: `All schemas (${objectList?.length ?? 0})`, value: '' },
|
{ label: `All schemas (${objectList?.length ?? 0})`, value: '' },
|
||||||
...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 })),
|
||||||
|
// ...schemaList.filter(x => !countBySchema[x]).map(x => ({ label: `${x} (${countBySchema[x] ?? 0})`, value: x })),
|
||||||
]}
|
]}
|
||||||
value={selectedSchema ?? appliedSchema ?? ''}
|
value={selectedSchema ?? appliedSchema ?? ''}
|
||||||
on:change={e => {
|
on:change={e => {
|
||||||
|
|||||||
Reference in New Issue
Block a user