mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 21:03:59 +00:00
redis: hide write operations when connection is readonly
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
export let indentLevel = 0;
|
||||
|
||||
export let reloadToken = 0;
|
||||
export let connection;
|
||||
let reloadToken2 = 0;
|
||||
|
||||
let maxShowCount = SHOW_INCREMENT;
|
||||
@@ -33,6 +34,7 @@
|
||||
{conid}
|
||||
{database}
|
||||
{root}
|
||||
{connection}
|
||||
{item}
|
||||
{indentLevel}
|
||||
onRefreshParent={() => {
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
import { showModal } from '../modals/modalTools';
|
||||
import { currentDatabase, getExtensions } from '../stores';
|
||||
import { apiCall } from '../utility/api';
|
||||
import { useConnectionInfo } from '../utility/metadataLoaders';
|
||||
|
||||
import DbKeysSubTree from './DbKeysSubTree.svelte';
|
||||
import WidgetsInnerContainer from './WidgetsInnerContainer.svelte';
|
||||
@@ -62,5 +63,5 @@
|
||||
</InlineButton>
|
||||
</SearchBoxWrapper>
|
||||
<WidgetsInnerContainer>
|
||||
<DbKeysSubTree {conid} {database} root="" {reloadToken} />
|
||||
<DbKeysSubTree {conid} {database} root="" {reloadToken} connection={$currentDatabase?.connection} />
|
||||
</WidgetsInnerContainer>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
export let conid;
|
||||
export let database;
|
||||
export let connection;
|
||||
|
||||
export let root;
|
||||
|
||||
@@ -29,8 +30,7 @@
|
||||
let reloadToken = 0;
|
||||
|
||||
// $: console.log(item.text, indentLevel);
|
||||
async function createMenu() {
|
||||
const connection = await getConnectionInfo({ conid });
|
||||
function createMenu() {
|
||||
return [
|
||||
item.key != null &&
|
||||
!connection?.isReadOnly && {
|
||||
@@ -83,7 +83,8 @@
|
||||
reloadToken += 1;
|
||||
},
|
||||
},
|
||||
item.type == 'dir' && {
|
||||
item.type == 'dir' &&
|
||||
!connection?.isReadOnly && {
|
||||
label: 'Delete branch',
|
||||
onClick: () => {
|
||||
const branch = `${item.root}:*`;
|
||||
@@ -169,5 +170,5 @@
|
||||
</div> -->
|
||||
|
||||
{#if isExpanded}
|
||||
<DbKeysSubTree {conid} {database} root={item.root} indentLevel={indentLevel + 1} {reloadToken} />
|
||||
<DbKeysSubTree {conid} {database} root={item.root} indentLevel={indentLevel + 1} {reloadToken} {connection} />
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user