Compare commits

...

5 Commits

Author SHA1 Message Date
Lykin b7c10b33e7 chore: update dependencies 2023-12-06 11:22:04 +08:00
Lykin 2f25b524cd perf: add 'use-glob' prop to search input 2023-12-06 11:10:54 +08:00
Lykin 84b42e6461 perf: optimize type match selector 2023-12-06 10:55:28 +08:00
Lykin f9abba37d2 fix: entry editor may lose field value 2023-12-05 16:35:08 +08:00
Lykin 827ca1f2e7 feat: support more key icon display type 2023-12-05 15:58:10 +08:00
23 changed files with 227 additions and 108 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -16,11 +16,12 @@ func NewPreferences() Preferences {
WindowHeight: consts.DEFAULT_WINDOW_HEIGHT,
},
General: PreferencesGeneral{
Theme: "auto",
Language: "auto",
FontSize: consts.DEFAULT_FONT_SIZE,
ScanSize: consts.DEFAULT_SCAN_SIZE,
CheckUpdate: true,
Theme: "auto",
Language: "auto",
FontSize: consts.DEFAULT_FONT_SIZE,
ScanSize: consts.DEFAULT_SCAN_SIZE,
KeyIconStyle: 0,
CheckUpdate: true,
},
Editor: PreferencesEditor{
FontSize: consts.DEFAULT_FONT_SIZE,
@ -42,6 +43,7 @@ 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"`
@ -51,5 +53,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,omitempty"`
ShowLineNum bool `json:"showLineNum" yaml:"show_line_num"`
}

View File

@ -10,13 +10,12 @@
"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.7.1",
"vue-i18n": "^9.8.0",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0"
},
@ -466,23 +465,23 @@
}
},
"node_modules/@intlify/core-base": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.7.1.tgz",
"integrity": "sha512-jPJTeECEhqQ7g//8g3Fb79j5SzSSRqlFCWD6pcX94uMLXU+L1m07gVZnnvzoJBnaMyJHiiwxOqZVfvu6rQfLvw==",
"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==",
"dependencies": {
"@intlify/message-compiler": "9.7.1",
"@intlify/shared": "9.7.1"
"@intlify/message-compiler": "9.8.0",
"@intlify/shared": "9.8.0"
},
"engines": {
"node": ">= 16"
}
},
"node_modules/@intlify/message-compiler": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.7.1.tgz",
"integrity": "sha512-HfIr2Hn/K7b0Zv4kGqkxAxwtipyxAwhI9a3krN5cuhH/G9gkaik7of1PdzjR3Mix43t2onBiKYQyaU7mo7e0aA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.8.0.tgz",
"integrity": "sha512-McnYWhcoYmDJvssVu6QGR0shqlkJuL1HHdi5lK7fNqvQqRYaQ4lSLjYmZxwc8tRNMdIe9/KUKfyPxU9M6yCtNQ==",
"dependencies": {
"@intlify/shared": "9.7.1",
"@intlify/shared": "9.8.0",
"source-map-js": "^1.0.2"
},
"engines": {
@ -490,9 +489,9 @@
}
},
"node_modules/@intlify/shared": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.7.1.tgz",
"integrity": "sha512-CBKnHzlUYGrk5QII9q4nElAQKO5cX1rRx8VmSWXltyOZjbkGHXYQTHULn6KwRi+CypuBCfmPkyPBHMzosypIeg==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.8.0.tgz",
"integrity": "sha512-TmgR0RCLjzrSo+W3wT0ALf9851iFMlVI9EYNGeWvZFUQTAJx0bvfsMlPdgVtV1tDNRiAfhkFsMKu6jtUY1ZLKQ==",
"engines": {
"node": ">= 16"
}
@ -1219,6 +1218,7 @@
"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.7.1",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.7.1.tgz",
"integrity": "sha512-A6DzWqJQMdzBj+392+g3zIgGV0FnFC7o/V+txs5yIALANEZzY6ZV8hM2wvZR3nTbQI7dntAmzBHMeoEteJO0kQ==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.8.0.tgz",
"integrity": "sha512-Izho+6PYjejsTq2mzjcRdBZ5VLRQoSuuexvR8029h5CpN03FYqiqBrShMyf2I1DKkN6kw/xmujcbvC+4QybpsQ==",
"dependencies": {
"@intlify/core-base": "9.7.1",
"@intlify/shared": "9.7.1",
"@intlify/core-base": "9.8.0",
"@intlify/shared": "9.8.0",
"@vue/devtools-api": "^6.5.0"
},
"engines": {
@ -2412,27 +2412,27 @@
}
},
"@intlify/core-base": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/@intlify/core-base/-/core-base-9.7.1.tgz",
"integrity": "sha512-jPJTeECEhqQ7g//8g3Fb79j5SzSSRqlFCWD6pcX94uMLXU+L1m07gVZnnvzoJBnaMyJHiiwxOqZVfvu6rQfLvw==",
"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==",
"requires": {
"@intlify/message-compiler": "9.7.1",
"@intlify/shared": "9.7.1"
"@intlify/message-compiler": "9.8.0",
"@intlify/shared": "9.8.0"
}
},
"@intlify/message-compiler": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.7.1.tgz",
"integrity": "sha512-HfIr2Hn/K7b0Zv4kGqkxAxwtipyxAwhI9a3krN5cuhH/G9gkaik7of1PdzjR3Mix43t2onBiKYQyaU7mo7e0aA==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/message-compiler/-/message-compiler-9.8.0.tgz",
"integrity": "sha512-McnYWhcoYmDJvssVu6QGR0shqlkJuL1HHdi5lK7fNqvQqRYaQ4lSLjYmZxwc8tRNMdIe9/KUKfyPxU9M6yCtNQ==",
"requires": {
"@intlify/shared": "9.7.1",
"@intlify/shared": "9.8.0",
"source-map-js": "^1.0.2"
}
},
"@intlify/shared": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.7.1.tgz",
"integrity": "sha512-CBKnHzlUYGrk5QII9q4nElAQKO5cX1rRx8VmSWXltyOZjbkGHXYQTHULn6KwRi+CypuBCfmPkyPBHMzosypIeg=="
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/@intlify/shared/-/shared-9.8.0.tgz",
"integrity": "sha512-TmgR0RCLjzrSo+W3wT0ALf9851iFMlVI9EYNGeWvZFUQTAJx0bvfsMlPdgVtV1tDNRiAfhkFsMKu6jtUY1ZLKQ=="
},
"@jridgewell/sourcemap-codec": {
"version": "1.4.15",
@ -2979,7 +2979,8 @@
"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=="
"integrity": "sha512-fJ7cW7fQGCYAkgv4CPfwFHrfd/cLS4Hau96JuJ+ZTOWhjnhoeN1ub1tFmALm/+lW5z4WCAuAV9bm05AP0mS6Gw==",
"dev": true
},
"human-signals": {
"version": "2.1.0",
@ -3598,12 +3599,12 @@
}
},
"vue-i18n": {
"version": "9.7.1",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.7.1.tgz",
"integrity": "sha512-A6DzWqJQMdzBj+392+g3zIgGV0FnFC7o/V+txs5yIALANEZzY6ZV8hM2wvZR3nTbQI7dntAmzBHMeoEteJO0kQ==",
"version": "9.8.0",
"resolved": "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.8.0.tgz",
"integrity": "sha512-Izho+6PYjejsTq2mzjcRdBZ5VLRQoSuuexvR8029h5CpN03FYqiqBrShMyf2I1DKkN6kw/xmujcbvC+4QybpsQ==",
"requires": {
"@intlify/core-base": "9.7.1",
"@intlify/shared": "9.7.1",
"@intlify/core-base": "9.8.0",
"@intlify/shared": "9.8.0",
"@vue/devtools-api": "^6.5.0"
}
},

View File

@ -11,13 +11,12 @@
"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.7.1",
"vue-i18n": "^9.8.0",
"xterm": "^5.3.0",
"xterm-addon-fit": "^0.8.0"
},

View File

@ -1 +1 @@
3dc6322e376d91c1cb4a6bd5312d176f
d5ec7e0103cfa8c99bc40c20ffdcb4fb

View File

@ -1,7 +1,7 @@
<script setup>
import { computed, h } from 'vue'
import { useThemeVars } from 'naive-ui'
import { types, typesBgColor, typesColor } from '@/consts/support_redis_type.js'
import { NSpace, useThemeVars } from 'naive-ui'
import { types, typesBgColor, typesColor, typesShortName } from '@/consts/support_redis_type.js'
import { get, map, toUpper } from 'lodash'
import RedisTypeTag from '@/components/common/RedisTypeTag.vue'
@ -26,6 +26,7 @@ const themeVars = useThemeVars()
const renderIcon = (option) => {
return h(RedisTypeTag, {
type: option.key,
defaultLabel: 'A',
short: true,
size: 'small',
inverse: option.key === props.value,
@ -33,15 +34,27 @@ const renderIcon = (option) => {
}
const renderLabel = (option) => {
return h(
'div',
{
style: {
fontWeight: option.key === props.value ? 'bold' : 'normal',
const children = [
h(
'div',
{
style: {
fontWeight: option.key === props.value ? 'bold' : 'normal',
},
},
},
option.label,
)
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)
}
const fontColor = computed(() => {
@ -53,7 +66,7 @@ const backgroundColor = computed(() => {
})
const displayValue = computed(() => {
return get(types, toUpper(props.value), 'ALL')
return get(typesShortName, toUpper(props.value), 'A')
})
const handleSelect = (select) => {

View File

@ -2,16 +2,22 @@
import { computed } from 'vue'
import { typesBgColor, typesColor, typesShortName } from '@/consts/support_redis_type.js'
import Binary from '@/components/icons/Binary.vue'
import { toUpper } from 'lodash'
import { get, 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,
})
@ -34,14 +40,23 @@ const backgroundColor = computed(() => {
const label = computed(() => {
if (props.short) {
return typesShortName[toUpper(props.type)] || 'N'
return get(typesShortName, toUpper(props.type), props.defaultLabel || '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',

View File

@ -1,5 +1,5 @@
<script setup>
import { computed, defineEmits, defineProps, nextTick, reactive, ref, watch } from 'vue'
import { computed, defineEmits, defineProps, nextTick, reactive, ref, watchEffect } from 'vue'
import { useThemeVars } from 'naive-ui'
import Save from '@/components/icons/Save.vue'
import { decodeTypes, formatTypes } from '@/consts/value_view_type.js'
@ -13,8 +13,12 @@ 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],
},
@ -54,15 +58,17 @@ const emit = defineEmits([
'close',
])
watch(
() => props.value,
(val) => {
if (val != null) {
watchEffect(
() => {
if (props.show && props.value != null) {
onFormatChanged()
} else {
viewAs.value = ''
}
},
{
flush: 'post',
},
)
const loading = ref(false)
@ -84,7 +90,7 @@ const displayValue = computed(() => {
})
const editingContent = ref('')
const enableSave = computed(() => {
return editingContent.value !== viewAs.value
return toString(props.field) !== viewAs.field || editingContent.value !== viewAs.value
})
const viewLanguage = computed(() => {
@ -150,7 +156,7 @@ const onSave = () => {
</script>
<template>
<div class="entry-editor flex-box-v">
<div v-show="show" 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 -->

View File

@ -18,6 +18,10 @@ const props = defineProps({
type: Boolean,
default: false,
},
useGlob: {
type: Boolean,
default: false,
},
})
const emit = defineEmits(['filterChanged', 'matchChanged'])
@ -82,7 +86,6 @@ defineExpose({
<template>
<n-input-group>
<slot name="prepend" />
<n-input
v-model:value="inputData.filter"
:placeholder="$t('interface.filter')"
@ -99,18 +102,24 @@ defineExpose({
{{ inputData.match }}
</n-tag>
</template>
{{ $t('interface.full_search_result', { pattern: inputData.match }) }}
{{
$t('interface.full_search_result', {
pattern: props.useGlob ? inputData.match : '*' + inputData.match + '*',
})
}}
</n-tooltip>
</template>
<template #suffix>
<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 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>
</template>
</n-input>

View File

@ -402,6 +402,7 @@ 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"

View File

@ -379,6 +379,7 @@ 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"

View File

@ -376,6 +376,7 @@ 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"

View File

@ -411,6 +411,7 @@ 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"

View File

@ -1,8 +1,10 @@
<script setup>
import { ref, watch } from 'vue'
import { computed, ref, watchEffect } 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()
@ -26,14 +28,19 @@ const initPreferences = async () => {
}
}
watch(
() => dialogStore.preferencesDialogVisible,
(visible) => {
if (visible) {
initPreferences()
}
},
)
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)
})
const onSavePreferences = async () => {
const success = await prefStore.savePreferences()
@ -96,6 +103,9 @@ 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">

View File

@ -217,6 +217,7 @@ onMounted(() => onReload())
:debounce-wait="1000"
:full-search-icon="Search"
small
use-glob
@filter-changed="onFilterInput"
@match-changed="onMatchInput">
<template #prepend>

View File

@ -24,6 +24,8 @@ 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,
@ -48,6 +50,7 @@ const checkedKeys = reactive({
})
const connectionStore = useConnectionStore()
const browserStore = useBrowserStore()
const prefStore = usePreferencesStore()
const tabStore = useTabStore()
const dialogStore = useDialogStore()
@ -356,6 +359,7 @@ const renderPrefix = ({ option }) => {
default: () => h(Database, { inverse: option.opened === true }),
},
)
case ConnectionType.RedisKey:
return h(
NIcon,
@ -364,7 +368,17 @@ 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,
@ -381,12 +395,30 @@ const renderPrefix = ({ option }) => {
},
)
}
return h(RedisTypeTag, {
type: toUpper(option.redisType),
short: true,
size: 'small',
inverse: includes(selectedKeys.value, option.key),
})
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),
})
}
}
}

View File

@ -15,7 +15,7 @@ export const typesShortName = {
STRING: 'S',
HASH: 'H',
LIST: 'L',
SET: 'S',
SET: 'E',
ZSET: 'Z',
STREAM: 'X',
}
@ -51,3 +51,14 @@ 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,
}

View File

@ -35,6 +35,11 @@
"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",
@ -86,7 +91,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",

View File

@ -35,6 +35,11 @@
"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请求时使用系统代理",
@ -86,7 +91,7 @@
"unpin_edit": "取消固定",
"search": "搜索",
"full_search": "全文匹配",
"full_search_result": "内容已匹配为 *{pattern}*",
"full_search_result": "内容已匹配为 {pattern}",
"filter_field": "筛选字段",
"filter_value": "筛选值",
"length": "长度",

View File

@ -13,6 +13,7 @@ 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', {
@ -44,6 +45,7 @@ const usePreferencesStore = defineStore('preferences', {
font: '',
fontSize: 14,
scanSize: 3000,
keyIconStyle: 0,
useSysProxy: false,
useSysProxyHttp: false,
checkUpdate: true,
@ -52,7 +54,7 @@ const usePreferencesStore = defineStore('preferences', {
editor: {
font: '',
fontSize: 14,
showLineNum: false,
showLineNum: true,
},
lastPref: {},
fontList: [],
@ -187,6 +189,10 @@ 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
View File

@ -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.3
github.com/klauspost/compress v1.17.4
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.15.0
golang.org/x/crypto v0.16.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.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
)

16
go.sum
View File

@ -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.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA=
github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM=
github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4=
github.com/klauspost/compress v1.17.4/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.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
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.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
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/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8=
golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww=
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/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=