mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 17:46:00 +00:00
redis key navigation
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
<script lang="ts">
|
||||
import keycodes from '../utility/keycodes';
|
||||
import _ from 'lodash';
|
||||
import { sleep } from '../utility/common';
|
||||
|
||||
|
||||
export let list;
|
||||
export let selectedObjectStore;
|
||||
export let getSelectedObject;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { dbKeys_loadMissing, dbKeys_refreshAll, findEngineDriver } from 'dbgate-tools';
|
||||
import { dbKeys_getFlatList, dbKeys_loadMissing, dbKeys_refreshAll, findEngineDriver } from 'dbgate-tools';
|
||||
|
||||
import CloseSearchButton from '../buttons/CloseSearchButton.svelte';
|
||||
import InlineButton from '../buttons/InlineButton.svelte';
|
||||
@@ -9,17 +9,26 @@
|
||||
import FontIcon from '../icons/FontIcon.svelte';
|
||||
import AddDbKeyModal from '../modals/AddDbKeyModal.svelte';
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import { currentDatabase, focusedConnectionOrDatabase, getExtensions } from '../stores';
|
||||
import {
|
||||
currentDatabase,
|
||||
focusedConnectionOrDatabase,
|
||||
focusedTreeDbKey,
|
||||
getExtensions,
|
||||
getFocusedTreeDbKey,
|
||||
} from '../stores';
|
||||
import { apiCall } from '../utility/api';
|
||||
import { useConnectionInfo } from '../utility/metadataLoaders';
|
||||
|
||||
import DbKeysSubTree from './DbKeysSubTree.svelte';
|
||||
import WidgetsInnerContainer from './WidgetsInnerContainer.svelte';
|
||||
import FocusedConnectionInfoWidget from './FocusedConnectionInfoWidget.svelte';
|
||||
|
||||
import AppObjectListHandler from './AppObjectListHandler.svelte';
|
||||
|
||||
export let conid;
|
||||
export let database;
|
||||
|
||||
let domListHandler;
|
||||
|
||||
let filter;
|
||||
|
||||
let model = dbKeys_refreshAll();
|
||||
@@ -99,5 +108,16 @@
|
||||
<FocusedConnectionInfoWidget {conid} {database} connection={$connection} />
|
||||
{/if}
|
||||
<WidgetsInnerContainer hideContent={differentFocusedDb}>
|
||||
<DbKeysSubTree root="" {filter} {model} {changeModel} {conid} {database} {connection} />
|
||||
<AppObjectListHandler
|
||||
bind:this={domListHandler}
|
||||
list={dbKeys_getFlatList(model)}
|
||||
selectedObjectStore={focusedTreeDbKey}
|
||||
getSelectedObject={getFocusedTreeDbKey}
|
||||
selectedObjectMatcher={(o1, o2) => o1?.key == o2?.key && o1?.type == o2?.type && o1?.root == o2?.root}
|
||||
handleObjectClick={(data, clickAction) => {
|
||||
focusedTreeDbKey.set(data);
|
||||
}}
|
||||
>
|
||||
<DbKeysSubTree root="" {filter} {model} {changeModel} {conid} {database} {connection} />
|
||||
</AppObjectListHandler>
|
||||
</WidgetsInnerContainer>
|
||||
|
||||
@@ -13,9 +13,10 @@
|
||||
import InputTextModal from '../modals/InputTextModal.svelte';
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import newQuery from '../query/newQuery';
|
||||
import { activeDbKeysStore } from '../stores';
|
||||
import { activeDbKeysStore, focusedTreeDbKey } from '../stores';
|
||||
import { apiCall } from '../utility/api';
|
||||
import { getConnectionInfo } from '../utility/metadataLoaders';
|
||||
import _ from 'lodash';
|
||||
import openNewTab from '../utility/openNewTab';
|
||||
import { showSnackbarError } from '../utility/snackbar';
|
||||
|
||||
@@ -162,9 +163,16 @@
|
||||
};
|
||||
}
|
||||
}}
|
||||
on:mousedown={() => {
|
||||
$focusedTreeDbKey = _.pick(item, ['type', 'key', 'root']);
|
||||
}}
|
||||
extInfo={item.count ? `(${item.count})` : null}
|
||||
{indentLevel}
|
||||
menu={createMenu}
|
||||
isChoosed={$focusedTreeDbKey &&
|
||||
item.key == $focusedTreeDbKey.key &&
|
||||
item.root == $focusedTreeDbKey.root &&
|
||||
item.type == $focusedTreeDbKey.type}
|
||||
/>
|
||||
<!-- <div on:click={() => (isExpanded = !isExpanded)}>
|
||||
<FontIcon icon={} />
|
||||
|
||||
Reference in New Issue
Block a user