From c2bf4128f756405395f4417c8398bf381a8d6206 Mon Sep 17 00:00:00 2001 From: Lykin <137850705+tiny-craft@users.noreply.github.com> Date: Sat, 6 Jan 2024 01:25:20 +0800 Subject: [PATCH] fix: minor bugs about keys view --- backend/services/browser_service.go | 2 +- frontend/src/components/content/ContentPane.vue | 3 ++- .../components/content_value/ContentToolbar.vue | 8 +++++++- frontend/src/components/sidebar/BrowserTree.vue | 3 +-- .../src/components/sidebar/ConnectionTree.vue | 4 ++-- frontend/src/langs/en-us.json | 6 +++--- frontend/src/langs/zh-cn.json | 6 +++--- frontend/src/objects/redisServerState.js | 12 ++++++++---- frontend/src/stores/browser.js | 15 ++++++++------- frontend/src/stores/connections.js | 4 ++-- frontend/src/stores/tab.js | 5 ++--- 11 files changed, 39 insertions(+), 29 deletions(-) diff --git a/backend/services/browser_service.go b/backend/services/browser_service.go index 924f5b9..cdc4198 100644 --- a/backend/services/browser_service.go +++ b/backend/services/browser_service.go @@ -2293,7 +2293,7 @@ func (b *browserService) ImportCSV(server string, db int, path string, conflict continue } // get ttl - if ttl < 0 { + if ttl < 0 && len(line) > 2 { // use previous if expire, ttlErr := strconv.ParseInt(line[2], 10, 64); ttlErr == nil && expire > 0 { ttlValue = time.UnixMilli(expire).Sub(time.Now()) diff --git a/frontend/src/components/content/ContentPane.vue b/frontend/src/components/content/ContentPane.vue index ff73259..f0a2996 100644 --- a/frontend/src/components/content/ContentPane.vue +++ b/frontend/src/components/content/ContentPane.vue @@ -16,6 +16,7 @@ import Pub from '@/components/icons/Pub.vue' import ContentSlog from '@/components/content_value/ContentSlog.vue' import { decodeTypes, formatTypes } from '@/consts/value_view_type.js' import ContentMonitor from '@/components/content_value/ContentMonitor.vue' +import { decodeRedisKey } from '@/utils/key_convert.js' const themeVars = useThemeVars() @@ -50,7 +51,7 @@ const tabContent = computed(() => { subTab: tab.subTab, type: toUpper(tab.type), db: tab.db, - keyPath: tab.key, + keyPath: tab.keyCode != null ? decodeRedisKey(tab.keyCode) : tab.key, keyCode: tab.keyCode, ttl: tab.ttl, value: tab.value, diff --git a/frontend/src/components/content_value/ContentToolbar.vue b/frontend/src/components/content_value/ContentToolbar.vue index 9a041d7..8209421 100644 --- a/frontend/src/components/content_value/ContentToolbar.vue +++ b/frontend/src/components/content_value/ContentToolbar.vue @@ -111,7 +111,13 @@ const onTTL = () => { TTL{{ `${ttl > 0 ? ': ' + ttl + $t('common.second') : ''}` }} - +