mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 22:26:01 +00:00
focusable databases WIP
This commit is contained in:
@@ -446,6 +446,7 @@ await dbgateApi.dropAllDbObjects(${JSON.stringify(
|
||||
currentArchive,
|
||||
currentDatabase,
|
||||
extensions,
|
||||
focusedConnectionOrDatabase,
|
||||
getCurrentDatabase,
|
||||
getExtensions,
|
||||
getOpenedTabs,
|
||||
@@ -512,7 +513,13 @@ await dbgateApi.dropAllDbObjects(${JSON.stringify(
|
||||
passProps?.connectionColorFactory({ conid: data?.connection?._id, database: data.name }, null, null, false)}
|
||||
isBold={$currentDatabase?.connection?._id == data?.connection?._id &&
|
||||
extractDbNameFromComposite($currentDatabase?.name) == data.name}
|
||||
on:click={() => switchCurrentDatabase(data)}
|
||||
on:dblclick={() => {
|
||||
switchCurrentDatabase(data);
|
||||
passProps?.onFocusSqlObjectList?.();
|
||||
}}
|
||||
on:click={() => {
|
||||
$focusedConnectionOrDatabase = { conid: data.connection?._id, database: data.name };
|
||||
}}
|
||||
on:dragstart
|
||||
on:dragenter
|
||||
on:dragend
|
||||
@@ -532,4 +539,6 @@ await dbgateApi.dropAllDbObjects(${JSON.stringify(
|
||||
list.filter(x => x?.name != data?.name || x?.connection?._id != data?.connection?._id)
|
||||
)
|
||||
: null}
|
||||
isChoosed={data.connection?._id == $focusedConnectionOrDatabase?.conid &&
|
||||
data.name == $focusedConnectionOrDatabase?.database}
|
||||
/>
|
||||
|
||||
@@ -15,13 +15,11 @@
|
||||
|
||||
$: databases = useDatabaseList({ conid: isExpandedOnlyBySearch ? null : data._id });
|
||||
$: dbList = isExpandedOnlyBySearch ? getLocalStorage(`database_list_${data._id}`) || [] : $databases || [];
|
||||
|
||||
$: connectionLabel = getConnectionLabel(data);
|
||||
</script>
|
||||
|
||||
<AppObjectList
|
||||
list={_.sortBy(
|
||||
dbList.filter(x => filterName(filter, x.name, connectionLabel)),
|
||||
dbList.filter(x => filterName(filter, x.name, data.displayName, data.server)),
|
||||
x => x.sortOrder ?? x.name
|
||||
).map(db => ({ ...db, connection: data }))}
|
||||
module={databaseAppObject}
|
||||
|
||||
Reference in New Issue
Block a user