Compare commits
No commits in common. "5deb6ce44320129a95821f88c833dd9a85af0ae5" and "29b51f836f6ef65ce7bca7cbe6dc5ebc6fbe0be0" have entirely different histories.
5deb6ce443
...
29b51f836f
|
@ -27,12 +27,11 @@ func NewPreferences() Preferences {
|
||||||
AllowTrack: true,
|
AllowTrack: true,
|
||||||
},
|
},
|
||||||
Editor: PreferencesEditor{
|
Editor: PreferencesEditor{
|
||||||
FontSize: consts.DEFAULT_FONT_SIZE,
|
FontSize: consts.DEFAULT_FONT_SIZE,
|
||||||
ShowLineNum: true,
|
ShowLineNum: true,
|
||||||
ShowFolding: true,
|
ShowFolding: true,
|
||||||
DropText: true,
|
DropText: true,
|
||||||
Links: true,
|
Links: true,
|
||||||
EntryTextAlign: 0,
|
|
||||||
},
|
},
|
||||||
Cli: PreferencesCli{
|
Cli: PreferencesCli{
|
||||||
FontSize: consts.DEFAULT_FONT_SIZE,
|
FontSize: consts.DEFAULT_FONT_SIZE,
|
||||||
|
@ -68,14 +67,13 @@ type PreferencesGeneral struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PreferencesEditor struct {
|
type PreferencesEditor struct {
|
||||||
Font string `json:"font" yaml:"font,omitempty"`
|
Font string `json:"font" yaml:"font,omitempty"`
|
||||||
FontFamily []string `json:"fontFamily" yaml:"font_family,omitempty"`
|
FontFamily []string `json:"fontFamily" yaml:"font_family,omitempty"`
|
||||||
FontSize int `json:"fontSize" yaml:"font_size"`
|
FontSize int `json:"fontSize" yaml:"font_size"`
|
||||||
ShowLineNum bool `json:"showLineNum" yaml:"show_line_num"`
|
ShowLineNum bool `json:"showLineNum" yaml:"show_line_num"`
|
||||||
ShowFolding bool `json:"showFolding" yaml:"show_folding"`
|
ShowFolding bool `json:"showFolding" yaml:"show_folding"`
|
||||||
DropText bool `json:"dropText" yaml:"drop_text"`
|
DropText bool `json:"dropText" yaml:"drop_text"`
|
||||||
Links bool `json:"links" yaml:"links"`
|
Links bool `json:"links" yaml:"links"`
|
||||||
EntryTextAlign int `json:"entryTextAlign" yaml:"entry_text_align"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type PreferencesCli struct {
|
type PreferencesCli struct {
|
||||||
|
|
|
@ -253,15 +253,6 @@ const onTermKey = (e) => {
|
||||||
}
|
}
|
||||||
// block all ctrl key combinations input
|
// block all ctrl key combinations input
|
||||||
return false
|
return false
|
||||||
} else {
|
|
||||||
switch (e.key) {
|
|
||||||
case 'Home': // move to head of line
|
|
||||||
moveInputCursorTo(0)
|
|
||||||
return false
|
|
||||||
case 'End': // move to tail of line
|
|
||||||
moveInputCursorTo(Number.MAX_SAFE_INTEGER)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -19,10 +19,6 @@ import { decodeRedisKey } from '@/utils/key_convert.js'
|
||||||
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
||||||
import { formatBytes } from '@/utils/byte_convert.js'
|
import { formatBytes } from '@/utils/byte_convert.js'
|
||||||
import copy from 'copy-text-to-clipboard'
|
import copy from 'copy-text-to-clipboard'
|
||||||
import SwitchButton from '@/components/common/SwitchButton.vue'
|
|
||||||
import AlignLeft from '@/components/icons/AlignLeft.vue'
|
|
||||||
import AlignCenter from '@/components/icons/AlignCenter.vue'
|
|
||||||
import { TextAlignType } from '@/consts/text_align_type.js'
|
|
||||||
|
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
const themeVars = useThemeVars()
|
const themeVars = useThemeVars()
|
||||||
|
@ -49,10 +45,9 @@ const props = defineProps({
|
||||||
decode: String,
|
decode: String,
|
||||||
end: Boolean,
|
end: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
textAlign: Number,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match', 'update:textAlign'])
|
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -83,7 +78,7 @@ const fieldFilterOption = ref(null)
|
||||||
const fieldColumn = computed(() => ({
|
const fieldColumn = computed(() => ({
|
||||||
key: 'key',
|
key: 'key',
|
||||||
title: () => i18n.t('common.field'),
|
title: () => i18n.t('common.field'),
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
ellipsis: {
|
ellipsis: {
|
||||||
|
@ -116,7 +111,7 @@ const isCode = computed(() => {
|
||||||
const valueColumn = computed(() => ({
|
const valueColumn = computed(() => ({
|
||||||
key: 'value',
|
key: 'value',
|
||||||
title: () => i18n.t('common.value'),
|
title: () => i18n.t('common.value'),
|
||||||
align: isCode.value ? 'left' : props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: isCode.value ? 'left' : 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
ellipsis: isCode.value
|
ellipsis: isCode.value
|
||||||
|
@ -269,7 +264,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
return index + 1
|
return index + 1
|
||||||
|
@ -285,7 +280,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
if (index + 1 === currentEditRow.no) {
|
if (index + 1 === currentEditRow.no) {
|
||||||
|
@ -447,13 +442,6 @@ defineExpose({
|
||||||
<n-divider v-if="showMemoryUsage" vertical />
|
<n-divider v-if="showMemoryUsage" vertical />
|
||||||
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
||||||
<div class="flex-item-expand"></div>
|
<div class="flex-item-expand"></div>
|
||||||
<switch-button
|
|
||||||
:icons="[AlignCenter, AlignLeft]"
|
|
||||||
:stroke-width="3.5"
|
|
||||||
:t-tooltips="['interface.text_align_center', 'interface.text_align_left']"
|
|
||||||
:value="props.textAlign"
|
|
||||||
unselect-stroke-width="3"
|
|
||||||
@update:value="(val) => emit('update:textAlign', val)" />
|
|
||||||
<format-selector
|
<format-selector
|
||||||
v-show="!inEdit"
|
v-show="!inEdit"
|
||||||
:decode="props.decode"
|
:decode="props.decode"
|
||||||
|
|
|
@ -18,10 +18,6 @@ import Edit from '@/components/icons/Edit.vue'
|
||||||
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
||||||
import { formatBytes } from '@/utils/byte_convert.js'
|
import { formatBytes } from '@/utils/byte_convert.js'
|
||||||
import copy from 'copy-text-to-clipboard'
|
import copy from 'copy-text-to-clipboard'
|
||||||
import { TextAlignType } from '@/consts/text_align_type.js'
|
|
||||||
import AlignLeft from '@/components/icons/AlignLeft.vue'
|
|
||||||
import AlignCenter from '@/components/icons/AlignCenter.vue'
|
|
||||||
import SwitchButton from '@/components/common/SwitchButton.vue'
|
|
||||||
|
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
const themeVars = useThemeVars()
|
const themeVars = useThemeVars()
|
||||||
|
@ -55,10 +51,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
end: Boolean,
|
end: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
textAlign: Number,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match', 'update:textAlign'])
|
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -89,7 +84,7 @@ const valueFilterOption = ref(null)
|
||||||
const valueColumn = computed(() => ({
|
const valueColumn = computed(() => ({
|
||||||
key: 'value',
|
key: 'value',
|
||||||
title: () => i18n.t('common.value'),
|
title: () => i18n.t('common.value'),
|
||||||
align: isCode.value ? 'left' : props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: isCode.value ? 'left' : 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
ellipsis: isCode.value
|
ellipsis: isCode.value
|
||||||
? false
|
? false
|
||||||
|
@ -219,7 +214,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
return index + 1
|
return index + 1
|
||||||
|
@ -234,7 +229,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
if (index + 1 === currentEditRow.no) {
|
if (index + 1 === currentEditRow.no) {
|
||||||
|
@ -396,13 +391,6 @@ defineExpose({
|
||||||
<n-divider v-if="showMemoryUsage" vertical />
|
<n-divider v-if="showMemoryUsage" vertical />
|
||||||
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
||||||
<div class="flex-item-expand"></div>
|
<div class="flex-item-expand"></div>
|
||||||
<switch-button
|
|
||||||
:icons="[AlignCenter, AlignLeft]"
|
|
||||||
:stroke-width="3.5"
|
|
||||||
:t-tooltips="['interface.text_align_center', 'interface.text_align_left']"
|
|
||||||
:value="props.textAlign"
|
|
||||||
unselect-stroke-width="3"
|
|
||||||
@update:value="(val) => emit('update:textAlign', val)" />
|
|
||||||
<format-selector
|
<format-selector
|
||||||
v-show="!inEdit"
|
v-show="!inEdit"
|
||||||
:decode="props.decode"
|
:decode="props.decode"
|
||||||
|
|
|
@ -18,10 +18,6 @@ import FormatSelector from '@/components/content_value/FormatSelector.vue'
|
||||||
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
||||||
import { formatBytes } from '@/utils/byte_convert.js'
|
import { formatBytes } from '@/utils/byte_convert.js'
|
||||||
import copy from 'copy-text-to-clipboard'
|
import copy from 'copy-text-to-clipboard'
|
||||||
import AlignLeft from '@/components/icons/AlignLeft.vue'
|
|
||||||
import AlignCenter from '@/components/icons/AlignCenter.vue'
|
|
||||||
import SwitchButton from '@/components/common/SwitchButton.vue'
|
|
||||||
import { TextAlignType } from '@/consts/text_align_type.js'
|
|
||||||
|
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
const themeVars = useThemeVars()
|
const themeVars = useThemeVars()
|
||||||
|
@ -54,10 +50,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
end: Boolean,
|
end: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
textAlign: Number,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match', 'update:textAlign'])
|
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -88,7 +83,7 @@ const valueFilterOption = ref(null)
|
||||||
const valueColumn = computed(() => ({
|
const valueColumn = computed(() => ({
|
||||||
key: 'value',
|
key: 'value',
|
||||||
title: () => i18n.t('common.value'),
|
title: () => i18n.t('common.value'),
|
||||||
align: isCode.value ? 'left' : props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: isCode.value ? 'left' : 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
ellipsis: isCode.value
|
ellipsis: isCode.value
|
||||||
? false
|
? false
|
||||||
|
@ -216,7 +211,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
return index + 1
|
return index + 1
|
||||||
|
@ -231,7 +226,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
if (index + 1 === currentEditRow.no) {
|
if (index + 1 === currentEditRow.no) {
|
||||||
|
@ -393,13 +388,6 @@ defineExpose({
|
||||||
<n-divider v-if="showMemoryUsage" vertical />
|
<n-divider v-if="showMemoryUsage" vertical />
|
||||||
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
||||||
<div class="flex-item-expand"></div>
|
<div class="flex-item-expand"></div>
|
||||||
<switch-button
|
|
||||||
:icons="[AlignCenter, AlignLeft]"
|
|
||||||
:stroke-width="3.5"
|
|
||||||
:t-tooltips="['interface.text_align_center', 'interface.text_align_left']"
|
|
||||||
:value="props.textAlign"
|
|
||||||
unselect-stroke-width="3"
|
|
||||||
@update:value="(val) => emit('update:textAlign', val)" />
|
|
||||||
<format-selector
|
<format-selector
|
||||||
v-show="!inEdit"
|
v-show="!inEdit"
|
||||||
:decode="props.decode"
|
:decode="props.decode"
|
||||||
|
|
|
@ -14,13 +14,10 @@ import useDialogStore from 'stores/dialog.js'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import ContentToolbar from '@/components/content_value/ContentToolbar.vue'
|
import ContentToolbar from '@/components/content_value/ContentToolbar.vue'
|
||||||
import ContentValueJson from '@/components/content_value/ContentValueJson.vue'
|
import ContentValueJson from '@/components/content_value/ContentValueJson.vue'
|
||||||
import usePreferencesStore from 'stores/preferences.js'
|
|
||||||
import { TextAlignType } from '@/consts/text_align_type.js'
|
|
||||||
|
|
||||||
const themeVars = useThemeVars()
|
const themeVars = useThemeVars()
|
||||||
const browserStore = useBrowserStore()
|
const browserStore = useBrowserStore()
|
||||||
const dialogStore = useDialogStore()
|
const dialogStore = useDialogStore()
|
||||||
const prefStore = usePreferencesStore()
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
blank: Boolean,
|
blank: Boolean,
|
||||||
|
@ -181,11 +178,6 @@ const onMatch = (match) => {
|
||||||
loadData(true, false, match || '')
|
loadData(true, false, match || '')
|
||||||
}
|
}
|
||||||
|
|
||||||
const onEntryTextAlignChanged = (align) => {
|
|
||||||
prefStore.editor.entryTextAlign = align !== TextAlignType.Left ? TextAlignType.Center : TextAlignType.Left
|
|
||||||
prefStore.savePreferences()
|
|
||||||
}
|
|
||||||
|
|
||||||
const contentRef = ref(null)
|
const contentRef = ref(null)
|
||||||
const initContent = async () => {
|
const initContent = async () => {
|
||||||
// onReload()
|
// onReload()
|
||||||
|
@ -233,14 +225,12 @@ watch(() => data.value?.keyPath, initContent)
|
||||||
:ttl="data.ttl"
|
:ttl="data.ttl"
|
||||||
:value="data.value"
|
:value="data.value"
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
:text-align="prefStore.entryTextAlign"
|
|
||||||
@delete="onDelete"
|
@delete="onDelete"
|
||||||
@keydown="onKeyShortcut"
|
@keydown="onKeyShortcut"
|
||||||
@loadall="onLoadAll"
|
@loadall="onLoadAll"
|
||||||
@loadmore="onLoadMore"
|
@loadmore="onLoadMore"
|
||||||
@match="onMatch"
|
@match="onMatch"
|
||||||
@reload="onReload"
|
@reload="onReload">
|
||||||
@update:text-align="onEntryTextAlignChanged">
|
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<content-toolbar
|
<content-toolbar
|
||||||
:db="data.db"
|
:db="data.db"
|
||||||
|
|
|
@ -18,10 +18,6 @@ import Edit from '@/components/icons/Edit.vue'
|
||||||
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
import ContentSearchInput from '@/components/content_value/ContentSearchInput.vue'
|
||||||
import { formatBytes } from '@/utils/byte_convert.js'
|
import { formatBytes } from '@/utils/byte_convert.js'
|
||||||
import copy from 'copy-text-to-clipboard'
|
import copy from 'copy-text-to-clipboard'
|
||||||
import { TextAlignType } from '@/consts/text_align_type.js'
|
|
||||||
import AlignLeft from '@/components/icons/AlignLeft.vue'
|
|
||||||
import AlignCenter from '@/components/icons/AlignCenter.vue'
|
|
||||||
import SwitchButton from '@/components/common/SwitchButton.vue'
|
|
||||||
|
|
||||||
const i18n = useI18n()
|
const i18n = useI18n()
|
||||||
const themeVars = useThemeVars()
|
const themeVars = useThemeVars()
|
||||||
|
@ -54,10 +50,9 @@ const props = defineProps({
|
||||||
},
|
},
|
||||||
end: Boolean,
|
end: Boolean,
|
||||||
loading: Boolean,
|
loading: Boolean,
|
||||||
textAlign: Number,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match', 'update:textAlign'])
|
const emit = defineEmits(['loadmore', 'loadall', 'reload', 'match'])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -87,7 +82,7 @@ const fullEdit = ref(false)
|
||||||
const scoreColumn = computed(() => ({
|
const scoreColumn = computed(() => ({
|
||||||
key: 'score',
|
key: 'score',
|
||||||
title: () => i18n.t('common.score'),
|
title: () => i18n.t('common.score'),
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
sorter: (row1, row2) => row1.s - row2.s,
|
sorter: (row1, row2) => row1.s - row2.s,
|
||||||
|
@ -136,7 +131,7 @@ const valueFilterOption = ref(null)
|
||||||
const valueColumn = computed(() => ({
|
const valueColumn = computed(() => ({
|
||||||
key: 'value',
|
key: 'value',
|
||||||
title: () => i18n.t('common.value'),
|
title: () => i18n.t('common.value'),
|
||||||
align: isCode.value ? 'left' : props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: isCode.value ? 'left' : 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
resizable: true,
|
resizable: true,
|
||||||
ellipsis: isCode.value
|
ellipsis: isCode.value
|
||||||
|
@ -261,7 +256,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
return index + 1
|
return index + 1
|
||||||
|
@ -277,7 +272,7 @@ const columns = computed(() => {
|
||||||
key: 'no',
|
key: 'no',
|
||||||
title: '#',
|
title: '#',
|
||||||
width: 80,
|
width: 80,
|
||||||
align: props.textAlign !== TextAlignType.Left ? 'center' : 'left',
|
align: 'center',
|
||||||
titleAlign: 'center',
|
titleAlign: 'center',
|
||||||
render: (row, index) => {
|
render: (row, index) => {
|
||||||
if (index + 1 === currentEditRow.no) {
|
if (index + 1 === currentEditRow.no) {
|
||||||
|
@ -426,13 +421,6 @@ defineExpose({
|
||||||
<n-divider v-if="showMemoryUsage" vertical />
|
<n-divider v-if="showMemoryUsage" vertical />
|
||||||
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
<n-text v-if="showMemoryUsage">{{ $t('interface.memory_usage') }}: {{ formatBytes(props.size) }}</n-text>
|
||||||
<div class="flex-item-expand"></div>
|
<div class="flex-item-expand"></div>
|
||||||
<switch-button
|
|
||||||
:icons="[AlignCenter, AlignLeft]"
|
|
||||||
:stroke-width="3.5"
|
|
||||||
:t-tooltips="['interface.text_align_center', 'interface.text_align_left']"
|
|
||||||
:value="props.textAlign"
|
|
||||||
unselect-stroke-width="3"
|
|
||||||
@update:value="(val) => emit('update:textAlign', val)" />
|
|
||||||
<format-selector
|
<format-selector
|
||||||
v-show="!inEdit"
|
v-show="!inEdit"
|
||||||
:decode="props.decode"
|
:decode="props.decode"
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
strokeWidth: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: 3,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M36 19H12"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M42 9H6"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M42 29H6"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M36 39H12"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
</svg>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
|
@ -1,39 +0,0 @@
|
||||||
<script setup>
|
|
||||||
const props = defineProps({
|
|
||||||
strokeWidth: {
|
|
||||||
type: [Number, String],
|
|
||||||
default: 3,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<svg fill="none" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M42 9H6"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M34 19H6"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M42 29H6"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
<path
|
|
||||||
:stroke-width="props.strokeWidth"
|
|
||||||
d="M34 39H6"
|
|
||||||
stroke="currentColor"
|
|
||||||
stroke-linecap="round"
|
|
||||||
stroke-linejoin="round" />
|
|
||||||
</svg>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
|
@ -1,8 +0,0 @@
|
||||||
/**
|
|
||||||
* all types of text alignment
|
|
||||||
* @enum {number}
|
|
||||||
*/
|
|
||||||
export const TextAlignType = {
|
|
||||||
Center: 0,
|
|
||||||
Left: 1,
|
|
||||||
}
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "Length",
|
"length": "Length",
|
||||||
"entries": "Entries",
|
"entries": "Entries",
|
||||||
"memory_usage": "Memory Usage",
|
"memory_usage": "Memory Usage",
|
||||||
"text_align_left": "Text Align Left",
|
|
||||||
"text_align_center": "Text Align Center",
|
|
||||||
"view_as": "View As",
|
"view_as": "View As",
|
||||||
"decode_with": "Decode / Decompress",
|
"decode_with": "Decode / Decompress",
|
||||||
"custom_decoder": "New Custom Decoder",
|
"custom_decoder": "New Custom Decoder",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "Longitud",
|
"length": "Longitud",
|
||||||
"entries": "Entradas",
|
"entries": "Entradas",
|
||||||
"memory_usage": "Uso de memoria",
|
"memory_usage": "Uso de memoria",
|
||||||
"text_align_left": "Alinear a la izquierda",
|
|
||||||
"text_align_center": "Centrar",
|
|
||||||
"view_as": "Ver como",
|
"view_as": "Ver como",
|
||||||
"decode_with": "Decodificar / Descomprimir",
|
"decode_with": "Decodificar / Descomprimir",
|
||||||
"custom_decoder": "Nuevo decodificador personalizado",
|
"custom_decoder": "Nuevo decodificador personalizado",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "Longueur",
|
"length": "Longueur",
|
||||||
"entries": "Entrées",
|
"entries": "Entrées",
|
||||||
"memory_usage": "Utilisation de la mémoire",
|
"memory_usage": "Utilisation de la mémoire",
|
||||||
"text_align_left": "Aligner à gauche",
|
|
||||||
"text_align_center": "Centrer",
|
|
||||||
"view_as": "Voir comme",
|
"view_as": "Voir comme",
|
||||||
"decode_with": "Décoder / Décompresser",
|
"decode_with": "Décoder / Décompresser",
|
||||||
"custom_decoder": "Nouveau décodeur personnalisé",
|
"custom_decoder": "Nouveau décodeur personnalisé",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "長さ",
|
"length": "長さ",
|
||||||
"entries": "エントリ",
|
"entries": "エントリ",
|
||||||
"memory_usage": "メモリ使用量",
|
"memory_usage": "メモリ使用量",
|
||||||
"text_align_left": "左揃え",
|
|
||||||
"text_align_center": "中央揃え",
|
|
||||||
"view_as": "表示形式",
|
"view_as": "表示形式",
|
||||||
"decode_with": "デコード/解凍",
|
"decode_with": "デコード/解凍",
|
||||||
"custom_decoder": "新しいカスタムデコーダー",
|
"custom_decoder": "新しいカスタムデコーダー",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "길이",
|
"length": "길이",
|
||||||
"entries": "항목 수",
|
"entries": "항목 수",
|
||||||
"memory_usage": "메모리 사용량",
|
"memory_usage": "메모리 사용량",
|
||||||
"text_align_left": "텍스트 왼쪽 정렬",
|
|
||||||
"text_align_center": "텍스트 가운데 정렬",
|
|
||||||
"view_as": "보기",
|
"view_as": "보기",
|
||||||
"decode_with": "디코딩/압축 해제",
|
"decode_with": "디코딩/압축 해제",
|
||||||
"custom_decoder": "새 사용자 정의 디코더",
|
"custom_decoder": "새 사용자 정의 디코더",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "Tamanho",
|
"length": "Tamanho",
|
||||||
"entries": "Entradas",
|
"entries": "Entradas",
|
||||||
"memory_usage": "Uso de Memória",
|
"memory_usage": "Uso de Memória",
|
||||||
"text_align_left": "Alinhar à esquerda",
|
|
||||||
"text_align_center": "Centralizar",
|
|
||||||
"view_as": "Visualizar Como",
|
"view_as": "Visualizar Como",
|
||||||
"decode_with": "Decodificar / Descompressão",
|
"decode_with": "Decodificar / Descompressão",
|
||||||
"custom_decoder": "Novo Decodificador Personalizado",
|
"custom_decoder": "Novo Decodificador Personalizado",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "Длина",
|
"length": "Длина",
|
||||||
"entries": "Записи",
|
"entries": "Записи",
|
||||||
"memory_usage": "Использование памяти",
|
"memory_usage": "Использование памяти",
|
||||||
"text_align_left": "Выравнивание по левому краю",
|
|
||||||
"text_align_center": "Выравнивание по центру",
|
|
||||||
"view_as": "Вид",
|
"view_as": "Вид",
|
||||||
"decode_with": "Декодировать/Распаковать",
|
"decode_with": "Декодировать/Распаковать",
|
||||||
"custom_decoder": "Новый пользовательский декодер",
|
"custom_decoder": "Новый пользовательский декодер",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "长度",
|
"length": "长度",
|
||||||
"entries": "条目",
|
"entries": "条目",
|
||||||
"memory_usage": "内存占用",
|
"memory_usage": "内存占用",
|
||||||
"text_align_left": "文本居左",
|
|
||||||
"text_align_center": "文本居中",
|
|
||||||
"view_as": "查看方式",
|
"view_as": "查看方式",
|
||||||
"decode_with": "解码/解压方式",
|
"decode_with": "解码/解压方式",
|
||||||
"custom_decoder": "添加自定义解码",
|
"custom_decoder": "添加自定义解码",
|
||||||
|
|
|
@ -126,8 +126,6 @@
|
||||||
"length": "長度",
|
"length": "長度",
|
||||||
"entries": "條目",
|
"entries": "條目",
|
||||||
"memory_usage": "記憶體使用量",
|
"memory_usage": "記憶體使用量",
|
||||||
"text_align_left": "文字靠左",
|
|
||||||
"text_align_center": "文字置中",
|
|
||||||
"view_as": "檢視方式",
|
"view_as": "檢視方式",
|
||||||
"decode_with": "解碼/解壓方式",
|
"decode_with": "解碼/解壓方式",
|
||||||
"custom_decoder": "新增自定義解碼",
|
"custom_decoder": "新增自定義解碼",
|
||||||
|
|
|
@ -15,7 +15,6 @@ import { enUS, NButton, NSpace, useOsTheme, zhCN } from 'naive-ui'
|
||||||
import { h, nextTick } from 'vue'
|
import { h, nextTick } from 'vue'
|
||||||
import { compareVersion } from '@/utils/version.js'
|
import { compareVersion } from '@/utils/version.js'
|
||||||
import { typesIconStyle } from '@/consts/support_redis_type.js'
|
import { typesIconStyle } from '@/consts/support_redis_type.js'
|
||||||
import { TextAlignType } from '@/consts/text_align_type.js'
|
|
||||||
|
|
||||||
const osTheme = useOsTheme()
|
const osTheme = useOsTheme()
|
||||||
const usePreferencesStore = defineStore('preferences', {
|
const usePreferencesStore = defineStore('preferences', {
|
||||||
|
@ -64,7 +63,6 @@ const usePreferencesStore = defineStore('preferences', {
|
||||||
showFolding: true,
|
showFolding: true,
|
||||||
dropText: true,
|
dropText: true,
|
||||||
links: true,
|
links: true,
|
||||||
entryTextAlign: TextAlignType.Center,
|
|
||||||
},
|
},
|
||||||
cli: {
|
cli: {
|
||||||
fontFamily: [],
|
fontFamily: [],
|
||||||
|
@ -273,10 +271,6 @@ const usePreferencesStore = defineStore('preferences', {
|
||||||
keyIconType() {
|
keyIconType() {
|
||||||
return get(this.general, 'keyIconStyle', typesIconStyle.SHORT)
|
return get(this.general, 'keyIconStyle', typesIconStyle.SHORT)
|
||||||
},
|
},
|
||||||
|
|
||||||
entryTextAlign() {
|
|
||||||
return get(this.editor, 'entryTextAlign', TextAlignType.Center)
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
_applyPreferences(data) {
|
_applyPreferences(data) {
|
||||||
|
|
Loading…
Reference in New Issue