Compare commits
No commits in common. "b7c10b33e75fdf634da92d6a99399b8851dcbf50" and "ba55cbcbd30e3a0be69eb8e942f5cbcbb583c52a" have entirely different histories.
b7c10b33e7
...
ba55cbcbd3
|
@ -47,8 +47,8 @@ func (c *ConnectionsStorage) defaultConnectionItem() types.ConnectionConfig {
|
|||
|
||||
func (c *ConnectionsStorage) getConnections() (ret types.Connections) {
|
||||
b, err := c.storage.Load()
|
||||
ret = c.defaultConnections()
|
||||
if err != nil {
|
||||
ret = c.defaultConnections()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ func (p *PreferencesStorage) DefaultPreferences() types.Preferences {
|
|||
|
||||
func (p *PreferencesStorage) getPreferences() (ret types.Preferences) {
|
||||
b, err := p.storage.Load()
|
||||
ret = p.DefaultPreferences()
|
||||
if err != nil {
|
||||
ret = p.DefaultPreferences()
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -16,12 +16,11 @@ func NewPreferences() Preferences {
|
|||
WindowHeight: consts.DEFAULT_WINDOW_HEIGHT,
|
||||
},
|
||||
General: PreferencesGeneral{
|
||||
Theme: "auto",
|
||||
Language: "auto",
|
||||
FontSize: consts.DEFAULT_FONT_SIZE,
|
||||
ScanSize: consts.DEFAULT_SCAN_SIZE,
|
||||
KeyIconStyle: 0,
|
||||
CheckUpdate: true,
|
||||
Theme: "auto",
|
||||
Language: "auto",
|
||||
FontSize: consts.DEFAULT_FONT_SIZE,
|
||||
ScanSize: consts.DEFAULT_SCAN_SIZE,
|
||||
CheckUpdate: true,
|
||||
},
|
||||
Editor: PreferencesEditor{
|
||||
FontSize: consts.DEFAULT_FONT_SIZE,
|
||||
|
@ -43,7 +42,6 @@ type PreferencesGeneral struct {
|
|||
Font string `json:"font" yaml:"font,omitempty"`
|
||||
FontSize int `json:"fontSize" yaml:"font_size"`
|
||||
ScanSize int `json:"scanSize" yaml:"scan_size"`
|
||||
KeyIconStyle int `json:"keyIconStyle" yaml:"key_icon_style"`
|
||||
UseSysProxy bool `json:"useSysProxy" yaml:"use_sys_proxy,omitempty"`
|
||||
UseSysProxyHttp bool `json:"useSysProxyHttp" yaml:"use_sys_proxy_http,omitempty"`
|
||||
CheckUpdate bool `json:"checkUpdate" yaml:"check_update"`
|
||||
|
@ -53,5 +51,5 @@ type PreferencesGeneral struct {
|
|||
type PreferencesEditor struct {
|
||||
Font string `json:"font" yaml:"font,omitempty"`
|
||||
FontSize int `json:"fontSize" yaml:"font_size"`
|
||||
ShowLineNum bool `json:"showLineNum" yaml:"show_line_num"`
|
||||
ShowLineNum bool `json:"showLineNum" yaml:"show_line_num,omitempty"`
|
||||
}
|
||||
|
|
|
@ -10,12 +10,13 @@
|
|||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"dayjs": "^1.11.10",
|
||||
"highlight.js": "^11.9.0",
|
||||
"lodash": "^4.17.21",
|
||||
"monaco-editor": "^0.44.0",
|
||||
"pinia": "^2.1.7",
|
||||
"sass": "^1.69.5",
|
||||
"vue": "^3.3.9",
|
||||
"vue-i18n": "^9.8.0",
|
||||
"vue-i18n": "^9.7.1",
|
||||
"xterm": "^5.3.0",
|
||||
"xterm-addon-fit": "^0.8.0"
|
||||
},
|
||||
|
@ -465,23 +466,23 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@intlify/core-base": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.8.0.tgz",
|
||||
"integrity": "sha512-UxaSZVZ1DwqC/CltUZrWZNaWNhfmKtfyV4BJSt/Zt4Or/fZs1iFj0B+OekYk1+MRHfIOe3+x00uXGQI4PbO/9g==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.7.1.tgz",
|
||||
"integrity": "sha512-jPJTeECEhqQ7g//8g3Fb79j5SzSSRqlFCWD6pcX94uMLXU+L1m07gVZnnvzoJBnaMyJHiiwxOqZVfvu6rQfLvw==",
|
||||
"dependencies": {
|
||||
"@intlify/message-compiler": "9.8.0",
|
||||
"@intlify/shared": "9.8.0"
|
||||
"@intlify/message-compiler": "9.7.1",
|
||||
"@intlify/shared": "9.7.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
}
|
||||
},
|
||||
"node_modules/@intlify/message-compiler": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.8.0.tgz",
|
||||
"integrity": "sha512-McnYWhcoYmDJvssVu6QGR0shqlkJuL1HHdi5lK7fNqvQqRYaQ4lSLjYmZxwc8tRNMdIe9/KUKfyPxU9M6yCtNQ==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.7.1.tgz",
|
||||
"integrity": "sha512-HfIr2Hn/K7b0Zv4kGqkxAxwtipyxAwhI9a3krN5cuhH/G9gkaik7of1PdzjR3Mix43t2onBiKYQyaU7mo7e0aA==",
|
||||
"dependencies": {
|
||||
"@intlify/shared": "9.8.0",
|
||||
"@intlify/shared": "9.7.1",
|
||||
"source-map-js": "^1.0.2"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -489,9 +490,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@intlify/shared": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.8.0.tgz",
|
||||
"integrity": "sha512-TmgR0RCLjzrSo+W3wT0ALf9851iFMlVI9EYNGeWvZFUQTAJx0bvfsMlPdgVtV1tDNRiAfhkFsMKu6jtUY1ZLKQ==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.7.1.tgz",
|
||||
"integrity": "sha512-CBKnHzlUYGrk5QII9q4nElAQKO5cX1rRx8VmSWXltyOZjbkGHXYQTHULn6KwRi+CypuBCfmPkyPBHMzosypIeg==",
|
||||
"engines": {
|
||||
"node": ">= 16"
|
||||
}
|
||||
|
@ -1218,7 +1219,6 @@
|
|||
"version": "11.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-11.9.0.tgz",
|
||||
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=12.0.0"
|
||||
}
|
||||
|
@ -2100,12 +2100,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/vue-i18n": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.8.0.tgz",
|
||||
"integrity": "sha512-Izho+6PYjejsTq2mzjcRdBZ5VLRQoSuuexvR8029h5CpN03FYqiqBrShMyf2I1DKkN6kw/xmujcbvC+4QybpsQ==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.7.1.tgz",
|
||||
"integrity": "sha512-A6DzWqJQMdzBj+392+g3zIgGV0FnFC7o/V+txs5yIALANEZzY6ZV8hM2wvZR3nTbQI7dntAmzBHMeoEteJO0kQ==",
|
||||
"dependencies": {
|
||||
"@intlify/core-base": "9.8.0",
|
||||
"@intlify/shared": "9.8.0",
|
||||
"@intlify/core-base": "9.7.1",
|
||||
"@intlify/shared": "9.7.1",
|
||||
"@vue/devtools-api": "^6.5.0"
|
||||
},
|
||||
"engines": {
|
||||
|
@ -2412,27 +2412,27 @@
|
|||
}
|
||||
},
|
||||
"@intlify/core-base": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.8.0.tgz",
|
||||
"integrity": "sha512-UxaSZVZ1DwqC/CltUZrWZNaWNhfmKtfyV4BJSt/Zt4Or/fZs1iFj0B+OekYk1+MRHfIOe3+x00uXGQI4PbO/9g==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.7.1.tgz",
|
||||
"integrity": "sha512-jPJTeECEhqQ7g//8g3Fb79j5SzSSRqlFCWD6pcX94uMLXU+L1m07gVZnnvzoJBnaMyJHiiwxOqZVfvu6rQfLvw==",
|
||||
"requires": {
|
||||
"@intlify/message-compiler": "9.8.0",
|
||||
"@intlify/shared": "9.8.0"
|
||||
"@intlify/message-compiler": "9.7.1",
|
||||
"@intlify/shared": "9.7.1"
|
||||
}
|
||||
},
|
||||
"@intlify/message-compiler": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.8.0.tgz",
|
||||
"integrity": "sha512-McnYWhcoYmDJvssVu6QGR0shqlkJuL1HHdi5lK7fNqvQqRYaQ4lSLjYmZxwc8tRNMdIe9/KUKfyPxU9M6yCtNQ==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.7.1.tgz",
|
||||
"integrity": "sha512-HfIr2Hn/K7b0Zv4kGqkxAxwtipyxAwhI9a3krN5cuhH/G9gkaik7of1PdzjR3Mix43t2onBiKYQyaU7mo7e0aA==",
|
||||
"requires": {
|
||||
"@intlify/shared": "9.8.0",
|
||||
"@intlify/shared": "9.7.1",
|
||||
"source-map-js": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"@intlify/shared": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.8.0.tgz",
|
||||
"integrity": "sha512-TmgR0RCLjzrSo+W3wT0ALf9851iFMlVI9EYNGeWvZFUQTAJx0bvfsMlPdgVtV1tDNRiAfhkFsMKu6jtUY1ZLKQ=="
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.7.1.tgz",
|
||||
"integrity": "sha512-CBKnHzlUYGrk5QII9q4nElAQKO5cX1rRx8VmSWXltyOZjbkGHXYQTHULn6KwRi+CypuBCfmPkyPBHMzosypIeg=="
|
||||
},
|
||||
"@jridgewell/sourcemap-codec": {
|
||||
"version": "1.4.15",
|
||||
|
@ -2979,8 +2979,7 @@
|
|||
"highlight.js": {
|
||||
"version": "11.9.0",
|
||||
"resolved": "https://registry.npmmirror.com/highlight.js/-/highlight.js-11.9.0.tgz",
|
||||
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw=="
|
||||
},
|
||||
"human-signals": {
|
||||
"version": "2.1.0",
|
||||
|
@ -3599,12 +3598,12 @@
|
|||
}
|
||||
},
|
||||
"vue-i18n": {
|
||||
"version": "9.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.8.0.tgz",
|
||||
"integrity": "sha512-Izho+6PYjejsTq2mzjcRdBZ5VLRQoSuuexvR8029h5CpN03FYqiqBrShMyf2I1DKkN6kw/xmujcbvC+4QybpsQ==",
|
||||
"version": "9.7.1",
|
||||
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.7.1.tgz",
|
||||
"integrity": "sha512-A6DzWqJQMdzBj+392+g3zIgGV0FnFC7o/V+txs5yIALANEZzY6ZV8hM2wvZR3nTbQI7dntAmzBHMeoEteJO0kQ==",
|
||||
"requires": {
|
||||
"@intlify/core-base": "9.8.0",
|
||||
"@intlify/shared": "9.8.0",
|
||||
"@intlify/core-base": "9.7.1",
|
||||
"@intlify/shared": "9.7.1",
|
||||
"@vue/devtools-api": "^6.5.0"
|
||||
}
|
||||
},
|
||||
|
|
|
@ -11,12 +11,13 @@
|
|||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"dayjs": "^1.11.10",
|
||||
"highlight.js": "^11.9.0",
|
||||
"lodash": "^4.17.21",
|
||||
"monaco-editor": "^0.44.0",
|
||||
"pinia": "^2.1.7",
|
||||
"sass": "^1.69.5",
|
||||
"vue": "^3.3.9",
|
||||
"vue-i18n": "^9.8.0",
|
||||
"vue-i18n": "^9.7.1",
|
||||
"xterm": "^5.3.0",
|
||||
"xterm-addon-fit": "^0.8.0"
|
||||
},
|
||||
|
|
|
@ -1 +1 @@
|
|||
d5ec7e0103cfa8c99bc40c20ffdcb4fb
|
||||
3dc6322e376d91c1cb4a6bd5312d176f
|
|
@ -1,7 +1,7 @@
|
|||
<script setup>
|
||||
import { computed, h } from 'vue'
|
||||
import { NSpace, useThemeVars } from 'naive-ui'
|
||||
import { types, typesBgColor, typesColor, typesShortName } from '@/consts/support_redis_type.js'
|
||||
import { useThemeVars } from 'naive-ui'
|
||||
import { types, typesBgColor, typesColor } from '@/consts/support_redis_type.js'
|
||||
import { get, map, toUpper } from 'lodash'
|
||||
import RedisTypeTag from '@/components/common/RedisTypeTag.vue'
|
||||
|
||||
|
@ -26,7 +26,6 @@ const themeVars = useThemeVars()
|
|||
const renderIcon = (option) => {
|
||||
return h(RedisTypeTag, {
|
||||
type: option.key,
|
||||
defaultLabel: 'A',
|
||||
short: true,
|
||||
size: 'small',
|
||||
inverse: option.key === props.value,
|
||||
|
@ -34,27 +33,15 @@ const renderIcon = (option) => {
|
|||
}
|
||||
|
||||
const renderLabel = (option) => {
|
||||
const children = [
|
||||
h(
|
||||
'div',
|
||||
{
|
||||
style: {
|
||||
fontWeight: option.key === props.value ? 'bold' : 'normal',
|
||||
},
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
style: {
|
||||
fontWeight: option.key === props.value ? 'bold' : 'normal',
|
||||
},
|
||||
option.label,
|
||||
),
|
||||
h(
|
||||
'div',
|
||||
{ style: { width: '16px' } },
|
||||
h(RedisTypeTag, {
|
||||
type: toUpper(option.key),
|
||||
point: true,
|
||||
style: { display: option.key === props.value ? 'block' : 'none' },
|
||||
}),
|
||||
),
|
||||
]
|
||||
return h(NSpace, { align: 'center', wrapItem: false }, () => children)
|
||||
},
|
||||
option.label,
|
||||
)
|
||||
}
|
||||
|
||||
const fontColor = computed(() => {
|
||||
|
@ -66,7 +53,7 @@ const backgroundColor = computed(() => {
|
|||
})
|
||||
|
||||
const displayValue = computed(() => {
|
||||
return get(typesShortName, toUpper(props.value), 'A')
|
||||
return get(types, toUpper(props.value), 'ALL')
|
||||
})
|
||||
|
||||
const handleSelect = (select) => {
|
||||
|
|
|
@ -2,22 +2,16 @@
|
|||
import { computed } from 'vue'
|
||||
import { typesBgColor, typesColor, typesShortName } from '@/consts/support_redis_type.js'
|
||||
import Binary from '@/components/icons/Binary.vue'
|
||||
import { get, toUpper } from 'lodash'
|
||||
import { toUpper } from 'lodash'
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: String,
|
||||
default: 'STRING',
|
||||
},
|
||||
defaultLabel: String,
|
||||
binaryKey: Boolean,
|
||||
size: String,
|
||||
short: Boolean,
|
||||
point: Boolean,
|
||||
pointSize: {
|
||||
type: Number,
|
||||
default: 14,
|
||||
},
|
||||
round: Boolean,
|
||||
inverse: Boolean,
|
||||
})
|
||||
|
@ -40,23 +34,14 @@ const backgroundColor = computed(() => {
|
|||
|
||||
const label = computed(() => {
|
||||
if (props.short) {
|
||||
return get(typesShortName, toUpper(props.type), props.defaultLabel || 'N')
|
||||
return typesShortName[toUpper(props.type)] || 'N'
|
||||
}
|
||||
return toUpper(props.type)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="props.point"
|
||||
:style="{
|
||||
backgroundColor: fontColor,
|
||||
width: Math.max(props.pointSize, 5) + 'px',
|
||||
height: Math.max(props.pointSize, 5) + 'px',
|
||||
}"
|
||||
class="redis-type-tag-round redis-type-tag-point" />
|
||||
<n-tag
|
||||
v-else
|
||||
:class="{
|
||||
'redis-type-tag-normal': !props.short && props.size !== 'small',
|
||||
'redis-type-tag-small': !props.short && props.size === 'small',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<script setup>
|
||||
import { computed, defineEmits, defineProps, nextTick, reactive, ref, watchEffect } from 'vue'
|
||||
import { computed, defineEmits, defineProps, nextTick, reactive, ref, watch } from 'vue'
|
||||
import { useThemeVars } from 'naive-ui'
|
||||
import Save from '@/components/icons/Save.vue'
|
||||
import { decodeTypes, formatTypes } from '@/consts/value_view_type.js'
|
||||
|
@ -13,12 +13,8 @@ import Pin from '@/components/icons/Pin.vue'
|
|||
import OffScreen from '@/components/icons/OffScreen.vue'
|
||||
import ContentEditor from '@/components/content_value/ContentEditor.vue'
|
||||
import usePreferencesStore from 'stores/preferences.js'
|
||||
import { toString } from 'lodash'
|
||||
|
||||
const props = defineProps({
|
||||
show: {
|
||||
type: Boolean,
|
||||
},
|
||||
field: {
|
||||
type: [String, Number],
|
||||
},
|
||||
|
@ -58,17 +54,15 @@ const emit = defineEmits([
|
|||
'close',
|
||||
])
|
||||
|
||||
watchEffect(
|
||||
() => {
|
||||
if (props.show && props.value != null) {
|
||||
watch(
|
||||
() => props.value,
|
||||
(val) => {
|
||||
if (val != null) {
|
||||
onFormatChanged()
|
||||
} else {
|
||||
viewAs.value = ''
|
||||
}
|
||||
},
|
||||
{
|
||||
flush: 'post',
|
||||
},
|
||||
)
|
||||
|
||||
const loading = ref(false)
|
||||
|
@ -90,7 +84,7 @@ const displayValue = computed(() => {
|
|||
})
|
||||
const editingContent = ref('')
|
||||
const enableSave = computed(() => {
|
||||
return toString(props.field) !== viewAs.field || editingContent.value !== viewAs.value
|
||||
return editingContent.value !== viewAs.value
|
||||
})
|
||||
|
||||
const viewLanguage = computed(() => {
|
||||
|
@ -156,7 +150,7 @@ const onSave = () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<div v-show="show" class="entry-editor flex-box-v">
|
||||
<div class="entry-editor flex-box-v">
|
||||
<n-card :title="$t('interface.edit_row')" autofocus size="small" style="height: 100%">
|
||||
<div class="editor-content flex-box-v" style="height: 100%">
|
||||
<!-- field -->
|
||||
|
|
|
@ -18,10 +18,6 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
useGlob: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const emit = defineEmits(['filterChanged', 'matchChanged'])
|
||||
|
@ -86,6 +82,7 @@ defineExpose({
|
|||
<template>
|
||||
<n-input-group>
|
||||
<slot name="prepend" />
|
||||
|
||||
<n-input
|
||||
v-model:value="inputData.filter"
|
||||
:placeholder="$t('interface.filter')"
|
||||
|
@ -102,24 +99,18 @@ defineExpose({
|
|||
{{ inputData.match }}
|
||||
</n-tag>
|
||||
</template>
|
||||
{{
|
||||
$t('interface.full_search_result', {
|
||||
pattern: props.useGlob ? inputData.match : '*' + inputData.match + '*',
|
||||
})
|
||||
}}
|
||||
{{ $t('interface.full_search_result', { pattern: inputData.match }) }}
|
||||
</n-tooltip>
|
||||
</template>
|
||||
<template #suffix>
|
||||
<template v-if="props.useGlob">
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon :component="Help" />
|
||||
</template>
|
||||
<div class="text-block" style="max-width: 600px">
|
||||
{{ $t('dialogue.filter.filter_pattern_tip') }}
|
||||
</div>
|
||||
</n-tooltip>
|
||||
</template>
|
||||
<n-tooltip trigger="hover">
|
||||
<template #trigger>
|
||||
<n-icon :component="Help" />
|
||||
</template>
|
||||
<div class="text-block" style="max-width: 600px">
|
||||
{{ $t('dialogue.filter.filter_pattern_tip') }}
|
||||
</div>
|
||||
</n-tooltip>
|
||||
</template>
|
||||
</n-input>
|
||||
|
||||
|
|
|
@ -402,7 +402,6 @@ defineExpose({
|
|||
:field="currentEditRow.key"
|
||||
:field-label="$t('common.field')"
|
||||
:format="currentEditRow.format"
|
||||
:show="inEdit"
|
||||
:value="currentEditRow.value"
|
||||
:value-label="$t('common.value')"
|
||||
class="flex-item-expand"
|
||||
|
|
|
@ -379,7 +379,6 @@ defineExpose({
|
|||
:field-label="$t('common.index')"
|
||||
:field-readonly="true"
|
||||
:format="currentEditRow.format"
|
||||
:show="inEdit"
|
||||
:value="currentEditRow.value"
|
||||
:value-label="$t('common.value')"
|
||||
class="flex-item-expand"
|
||||
|
|
|
@ -376,7 +376,6 @@ defineExpose({
|
|||
:field-label="$t('common.index')"
|
||||
:field-readonly="true"
|
||||
:format="currentEditRow.format"
|
||||
:show="inEdit"
|
||||
:value="currentEditRow.value"
|
||||
:value-label="$t('common.value')"
|
||||
class="flex-item-expand"
|
||||
|
|
|
@ -411,7 +411,6 @@ defineExpose({
|
|||
:field="currentEditRow.score"
|
||||
:field-label="$t('common.score')"
|
||||
:format="currentEditRow.format"
|
||||
:show="inEdit"
|
||||
:value="currentEditRow.value"
|
||||
:value-label="$t('common.value')"
|
||||
class="flex-item-expand"
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<script setup>
|
||||
import { computed, ref, watchEffect } from 'vue'
|
||||
import { ref, watch } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import useDialog from 'stores/dialog'
|
||||
import usePreferencesStore from 'stores/preferences.js'
|
||||
import { map, sortBy } from 'lodash'
|
||||
import { typesIconStyle } from '@/consts/support_redis_type.js'
|
||||
|
||||
const prefStore = usePreferencesStore()
|
||||
|
||||
|
@ -28,19 +26,14 @@ const initPreferences = async () => {
|
|||
}
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
if (dialogStore.preferencesDialogVisible) {
|
||||
initPreferences()
|
||||
}
|
||||
})
|
||||
|
||||
const keyOptions = computed(() => {
|
||||
const opts = map(typesIconStyle, (v) => ({
|
||||
value: v,
|
||||
label: i18n.t('preferences.general.key_icon_style' + v),
|
||||
}))
|
||||
return sortBy(opts, (o) => o.value)
|
||||
})
|
||||
watch(
|
||||
() => dialogStore.preferencesDialogVisible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
initPreferences()
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
const onSavePreferences = async () => {
|
||||
const success = await prefStore.savePreferences()
|
||||
|
@ -103,9 +96,6 @@ const onClose = () => {
|
|||
<n-form-item-gi :label="$t('preferences.general.scan_size')" :span="12">
|
||||
<n-input-number v-model:value="prefStore.general.scanSize" :min="1" />
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi :label="$t('preferences.general.key_icon_style')" :span="12">
|
||||
<n-select v-model:value="prefStore.general.keyIconStyle" :options="keyOptions" />
|
||||
</n-form-item-gi>
|
||||
<n-form-item-gi :label="$t('preferences.general.proxy')" :span="24">
|
||||
<n-space>
|
||||
<n-checkbox v-model:checked="prefStore.general.useSysProxy">
|
||||
|
|
|
@ -217,7 +217,6 @@ onMounted(() => onReload())
|
|||
:debounce-wait="1000"
|
||||
:full-search-icon="Search"
|
||||
small
|
||||
use-glob
|
||||
@filter-changed="onFilterInput"
|
||||
@match-changed="onMatchInput">
|
||||
<template #prepend>
|
||||
|
|
|
@ -24,8 +24,6 @@ import LoadAll from '@/components/icons/LoadAll.vue'
|
|||
import useBrowserStore from 'stores/browser.js'
|
||||
import { useRender } from '@/utils/render.js'
|
||||
import RedisTypeTag from '@/components/common/RedisTypeTag.vue'
|
||||
import usePreferencesStore from 'stores/preferences.js'
|
||||
import { typesIconStyle } from '@/consts/support_redis_type.js'
|
||||
|
||||
const props = defineProps({
|
||||
server: String,
|
||||
|
@ -50,7 +48,6 @@ const checkedKeys = reactive({
|
|||
})
|
||||
const connectionStore = useConnectionStore()
|
||||
const browserStore = useBrowserStore()
|
||||
const prefStore = usePreferencesStore()
|
||||
const tabStore = useTabStore()
|
||||
const dialogStore = useDialogStore()
|
||||
|
||||
|
@ -359,7 +356,6 @@ const renderPrefix = ({ option }) => {
|
|||
default: () => h(Database, { inverse: option.opened === true }),
|
||||
},
|
||||
)
|
||||
|
||||
case ConnectionType.RedisKey:
|
||||
return h(
|
||||
NIcon,
|
||||
|
@ -368,17 +364,7 @@ const renderPrefix = ({ option }) => {
|
|||
default: () => h(Layer),
|
||||
},
|
||||
)
|
||||
|
||||
case ConnectionType.RedisValue:
|
||||
if (prefStore.keyIconType === typesIconStyle.ICON) {
|
||||
return h(
|
||||
NIcon,
|
||||
{ size: 20 },
|
||||
{
|
||||
default: () => h(!!option.redisKeyCode ? Binary : Key),
|
||||
},
|
||||
)
|
||||
}
|
||||
if (option.redisType == null || option.redisType === 'loading') {
|
||||
browserStore.loadKeyType({
|
||||
server: props.server,
|
||||
|
@ -395,30 +381,12 @@ const renderPrefix = ({ option }) => {
|
|||
},
|
||||
)
|
||||
}
|
||||
switch (prefStore.keyIconType) {
|
||||
case typesIconStyle.FULL:
|
||||
return h(RedisTypeTag, {
|
||||
type: toUpper(option.redisType),
|
||||
short: false,
|
||||
size: 'small',
|
||||
inverse: includes(selectedKeys.value, option.key),
|
||||
})
|
||||
|
||||
case typesIconStyle.POINT:
|
||||
return h(RedisTypeTag, {
|
||||
type: toUpper(option.redisType),
|
||||
point: true,
|
||||
})
|
||||
|
||||
case typesIconStyle.SHORT:
|
||||
default:
|
||||
return h(RedisTypeTag, {
|
||||
type: toUpper(option.redisType),
|
||||
short: true,
|
||||
size: 'small',
|
||||
inverse: includes(selectedKeys.value, option.key),
|
||||
})
|
||||
}
|
||||
return h(RedisTypeTag, {
|
||||
type: toUpper(option.redisType),
|
||||
short: true,
|
||||
size: 'small',
|
||||
inverse: includes(selectedKeys.value, option.key),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export const typesShortName = {
|
|||
STRING: 'S',
|
||||
HASH: 'H',
|
||||
LIST: 'L',
|
||||
SET: 'E',
|
||||
SET: 'S',
|
||||
ZSET: 'Z',
|
||||
STREAM: 'X',
|
||||
}
|
||||
|
@ -51,14 +51,3 @@ export const typesBgColor = {
|
|||
export const validType = (t) => {
|
||||
return types.hasOwnProperty(t)
|
||||
}
|
||||
|
||||
/**
|
||||
* icon type in browser tree
|
||||
* @enum {string}
|
||||
*/
|
||||
export const typesIconStyle = {
|
||||
SHORT: 0,
|
||||
FULL: 1,
|
||||
POINT: 2,
|
||||
ICON: 3,
|
||||
}
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
"font": "Font",
|
||||
"font_size": "Font Size",
|
||||
"scan_size": "Default Size for SCAN Command",
|
||||
"key_icon_style": "Key Icon Style",
|
||||
"key_icon_style0": "Short",
|
||||
"key_icon_style1": "Full",
|
||||
"key_icon_style2": "Point",
|
||||
"key_icon_style3": "Key Icon",
|
||||
"proxy": "Proxy",
|
||||
"use_system_proxy": "Use system proxy",
|
||||
"use_system_proxy_http": "Use system proxy only for HTTP(S) request",
|
||||
|
@ -91,7 +86,7 @@
|
|||
"unpin_edit": "Cancel Pin",
|
||||
"search": "Search",
|
||||
"full_search": "Full Search",
|
||||
"full_search_result": "The content has been matched as '{pattern}'",
|
||||
"full_search_result": "The content has been matched as '*{pattern}*'",
|
||||
"filter_field": "Filter Field",
|
||||
"filter_value": "Filter Value",
|
||||
"length": "Length",
|
||||
|
|
|
@ -35,11 +35,6 @@
|
|||
"font": "字体",
|
||||
"font_size": "字体尺寸",
|
||||
"scan_size": "SCAN命令默认数量",
|
||||
"key_icon_style": "键图标样式",
|
||||
"key_icon_style0": "紧凑类型",
|
||||
"key_icon_style1": "全称类型",
|
||||
"key_icon_style2": "圆点类型",
|
||||
"key_icon_style3": "键图标",
|
||||
"proxy": "代理",
|
||||
"use_system_proxy": "使用系统代理",
|
||||
"use_system_proxy_http": "仅在HTTP请求时使用系统代理",
|
||||
|
@ -91,7 +86,7 @@
|
|||
"unpin_edit": "取消固定",
|
||||
"search": "搜索",
|
||||
"full_search": "全文匹配",
|
||||
"full_search_result": "内容已匹配为 {pattern}",
|
||||
"full_search_result": "内容已匹配为 *{pattern}*",
|
||||
"filter_field": "筛选字段",
|
||||
"filter_value": "筛选值",
|
||||
"length": "长度",
|
||||
|
|
|
@ -13,7 +13,6 @@ import { i18nGlobal } from '@/utils/i18n.js'
|
|||
import { enUS, NButton, NSpace, useOsTheme, zhCN } from 'naive-ui'
|
||||
import { h, nextTick } from 'vue'
|
||||
import { compareVersion } from '@/utils/version.js'
|
||||
import { typesIconStyle } from '@/consts/support_redis_type.js'
|
||||
|
||||
const osTheme = useOsTheme()
|
||||
const usePreferencesStore = defineStore('preferences', {
|
||||
|
@ -45,7 +44,6 @@ const usePreferencesStore = defineStore('preferences', {
|
|||
font: '',
|
||||
fontSize: 14,
|
||||
scanSize: 3000,
|
||||
keyIconStyle: 0,
|
||||
useSysProxy: false,
|
||||
useSysProxyHttp: false,
|
||||
checkUpdate: true,
|
||||
|
@ -54,7 +52,7 @@ const usePreferencesStore = defineStore('preferences', {
|
|||
editor: {
|
||||
font: '',
|
||||
fontSize: 14,
|
||||
showLineNum: true,
|
||||
showLineNum: false,
|
||||
},
|
||||
lastPref: {},
|
||||
fontList: [],
|
||||
|
@ -189,10 +187,6 @@ const usePreferencesStore = defineStore('preferences', {
|
|||
showLineNum() {
|
||||
return get(this.editor, 'showLineNum', true)
|
||||
},
|
||||
|
||||
keyIconType() {
|
||||
return get(this.general, 'keyIconStyle', typesIconStyle.SHORT)
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
_applyPreferences(data) {
|
||||
|
|
6
go.mod
6
go.mod
|
@ -6,11 +6,11 @@ require (
|
|||
github.com/adrg/sysfont v0.1.2
|
||||
github.com/andybalholm/brotli v1.0.6
|
||||
github.com/google/uuid v1.4.0
|
||||
github.com/klauspost/compress v1.17.4
|
||||
github.com/klauspost/compress v1.17.3
|
||||
github.com/redis/go-redis/v9 v9.3.0
|
||||
github.com/vrischmann/userdir v0.0.0-20151206171402-20f291cebd68
|
||||
github.com/wailsapp/wails/v2 v2.6.0
|
||||
golang.org/x/crypto v0.16.0
|
||||
golang.org/x/crypto v0.15.0
|
||||
gopkg.in/yaml.v3 v3.0.1
|
||||
)
|
||||
|
||||
|
@ -43,7 +43,7 @@ require (
|
|||
github.com/wailsapp/mimetype v1.4.1 // indirect
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect
|
||||
golang.org/x/net v0.18.0 // indirect
|
||||
golang.org/x/sys v0.15.0 // indirect
|
||||
golang.org/x/sys v0.14.0 // indirect
|
||||
golang.org/x/text v0.14.0 // indirect
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
|
||||
)
|
||||
|
|
16
go.sum
16
go.sum
|
@ -28,8 +28,8 @@ github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4=
|
|||
github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e h1:Q3+PugElBCf4PFpxhErSzU3/PY5sFL5Z6rfv4AbGAck=
|
||||
github.com/jchv/go-winloader v0.0.0-20210711035445-715c2860da7e/go.mod h1:alcuEEnZsY1WQsagKhZDsoPCRoOijYqhZvPwLG0kzVs=
|
||||
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
|
||||
github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
|
||||
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
|
||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
|
@ -96,8 +96,8 @@ github.com/wailsapp/mimetype v1.4.1 h1:pQN9ycO7uo4vsUUuPeHEYoUkLVkaRntMnHJxVwYhw
|
|||
github.com/wailsapp/mimetype v1.4.1/go.mod h1:9aV5k31bBOv5z6u+QP8TltzvNGJPmNJD4XlAL3U+j3o=
|
||||
github.com/wailsapp/wails/v2 v2.6.0 h1:EyH0zR/EO6dDiqNy8qU5spaXDfkluiq77xrkabPYD4c=
|
||||
github.com/wailsapp/wails/v2 v2.6.0/go.mod h1:WBG9KKWuw0FKfoepBrr/vRlyTmHaMibWesK3yz6nNiM=
|
||||
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
|
||||
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
|
||||
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
|
||||
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
|
||||
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
|
||||
golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
|
@ -114,11 +114,11 @@ golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBc
|
|||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
|
||||
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
|
||||
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
|
||||
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8=
|
||||
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
|
|
Loading…
Reference in New Issue