diff --git a/backend/services/browser_service.go b/backend/services/browser_service.go index 8369bf9..e83f8e4 100644 --- a/backend/services/browser_service.go +++ b/backend/services/browser_service.go @@ -390,7 +390,20 @@ func (b *browserService) ServerInfo(name string) (resp types.JSResp) { // @param path contain connection name and db name func (b *browserService) OpenDatabase(connName string, db int, match string, keyType string) (resp types.JSResp) { b.setClientCursor(connName, db, 0) - return b.LoadNextKeys(connName, db, match, keyType) + + item, err := b.getRedisClient(connName, db) + if err != nil { + resp.Msg = err.Error() + return + } + client, ctx := item.client, item.ctx + maxKeys := b.loadDBSize(ctx, client) + + resp.Success = true + resp.Data = map[string]any{ + "maxKeys": maxKeys, + } + return } // scan keys @@ -433,6 +446,7 @@ func (b *browserService) scanKeys(ctx context.Context, client redis.UniversalCli // cluster mode var mutex sync.Mutex err = cluster.ForEachMaster(ctx, func(ctx context.Context, cli *redis.Client) error { + // FIXME: BUG? can not fully load in cluster mode? maybe remove the shared "cursor" return scan(ctx, cli, func(k []any) { mutex.Lock() keys = append(keys, k...) diff --git a/frontend/src/components/common/IconButton.vue b/frontend/src/components/common/IconButton.vue index e632d46..4692da5 100644 --- a/frontend/src/components/common/IconButton.vue +++ b/frontend/src/components/common/IconButton.vue @@ -26,6 +26,7 @@ const props = defineProps({ disabled: Boolean, buttonStyle: [String, Object], buttonClass: [String, Object], + small: Boolean, }) const hasTooltip = computed(() => { @@ -42,6 +43,7 @@ const hasTooltip = computed(() => { :disabled="disabled" :focusable="false" :loading="loading" + :size="small ? 'small' : ''" :style="props.buttonStyle" :text="!border" :type="type" @@ -64,6 +66,7 @@ const hasTooltip = computed(() => { :disabled="disabled" :focusable="false" :loading="loading" + :size="small ? 'small' : ''" :style="props.buttonStyle" :text="!border" :type="type" diff --git a/frontend/src/components/common/RedisTypeSelector.vue b/frontend/src/components/common/RedisTypeSelector.vue new file mode 100644 index 0000000..c6abe5d --- /dev/null +++ b/frontend/src/components/common/RedisTypeSelector.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/frontend/src/components/common/RedisTypeTag.vue b/frontend/src/components/common/RedisTypeTag.vue index 3bba2de..eb9573d 100644 --- a/frontend/src/components/common/RedisTypeTag.vue +++ b/frontend/src/components/common/RedisTypeTag.vue @@ -12,7 +12,6 @@ const props = defineProps({ default: 'STRING', }, binaryKey: Boolean, - bordered: Boolean, size: String, }) @@ -27,9 +26,8 @@ const backgroundColor = computed(() => {