refactor: reorganized the structure of the multi-language content.

This commit is contained in:
tiny-craft 2023-09-07 18:38:34 +08:00
parent e15bf3ab2f
commit 9152a32fd3
41 changed files with 748 additions and 641 deletions

View File

@ -22,11 +22,14 @@ const emit = defineEmits(['edit', 'delete', 'save', 'cancel'])
</div> </div>
<div v-else class="flex-box-h edit-column-func"> <div v-else class="flex-box-h edit-column-func">
<icon-button v-if="!props.readonly" :icon="Edit" @click="emit('edit')" /> <icon-button v-if="!props.readonly" :icon="Edit" @click="emit('edit')" />
<n-popconfirm :negative-text="$t('cancel')" :positive-text="$t('confirm')" @positive-click="emit('delete')"> <n-popconfirm
:negative-text="$t('common.cancel')"
:positive-text="$t('common.confirm')"
@positive-click="emit('delete')">
<template #trigger> <template #trigger>
<icon-button :icon="Delete" /> <icon-button :icon="Delete" />
</template> </template>
{{ $t('remove_tip', { name: props.bindKey }) }} {{ $t('dialogue.remove_tip', { name: props.bindKey }) }}
</n-popconfirm> </n-popconfirm>
</div> </div>
</template> </template>

View File

@ -23,7 +23,7 @@ const filterServerOption = computed(() => {
value: server, value: server,
})) }))
options.splice(0, 0, { options.splice(0, 0, {
label: i18n.t('all'), label: i18n.t('common.all'),
value: '', value: '',
}) })
return options return options
@ -45,7 +45,7 @@ const loadHistory = () => {
} }
const cleanHistory = async () => { const cleanHistory = async () => {
$dialog.warning(i18n.t('confirm_clean_log'), () => { $dialog.warning(i18n.t('log.confirm_clean_log'), () => {
data.loading = true data.loading = true
connectionStore connectionStore
.cleanCmdHistory() .cleanCmdHistory()
@ -53,7 +53,7 @@ const cleanHistory = async () => {
if (success) { if (success) {
data.history = [] data.history = []
tableRef.value?.scrollTo({ top: 0 }) tableRef.value?.scrollTo({ top: 0 })
$message.success(i18n.t('success')) $message.success(i18n.t('common.success'))
} }
}) })
.finally(() => { .finally(() => {
@ -69,26 +69,26 @@ defineExpose({
<template> <template>
<n-card <n-card
:title="$t('launch_log')" :title="$t('log.launch_log')"
:bordered="false" :bordered="false"
class="content-container flex-box-v" class="content-container flex-box-v"
content-style="display: flex;flex-direction: column; overflow: hidden;"> content-style="display: flex;flex-direction: column; overflow: hidden;">
<n-form :disabled="data.loading" class="flex-item" inline> <n-form :disabled="data.loading" class="flex-item" inline>
<n-form-item :label="$t('filter_server')"> <n-form-item :label="$t('log.filter_server')">
<n-select <n-select
v-model:value="data.server" v-model:value="data.server"
:consistent-menu-width="false" :consistent-menu-width="false"
:options="filterServerOption" :options="filterServerOption"
style="min-width: 100px" /> style="min-width: 100px" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('filter_keyword')"> <n-form-item :label="$t('log.filter_keyword')">
<n-input v-model:value="data.keyword" clearable placeholder="" /> <n-input v-model:value="data.keyword" clearable placeholder="" />
</n-form-item> </n-form-item>
<n-form-item label="&nbsp;"> <n-form-item label="&nbsp;">
<icon-button :icon="Refresh" border t-tooltip="refresh" @click="loadHistory" /> <icon-button :icon="Refresh" border t-tooltip="log.refresh" @click="loadHistory" />
</n-form-item> </n-form-item>
<n-form-item label="&nbsp;"> <n-form-item label="&nbsp;">
<icon-button :icon="Delete" border t-tooltip="clean_log" @click="cleanHistory" /> <icon-button :icon="Delete" border t-tooltip="log.clean_log" @click="cleanHistory" />
</n-form-item> </n-form-item>
</n-form> </n-form>
<div class="content-value fill-height flex-box-h"> <div class="content-value fill-height flex-box-h">
@ -96,7 +96,7 @@ defineExpose({
ref="tableRef" ref="tableRef"
:columns="[ :columns="[
{ {
title: $t('exec_time'), title: $t('log.exec_time'),
key: 'timestamp', key: 'timestamp',
defaultSortOrder: 'ascend', defaultSortOrder: 'ascend',
sorter: 'default', sorter: 'default',
@ -108,7 +108,7 @@ defineExpose({
}, },
}, },
{ {
title: $t('server'), title: $t('log.server'),
key: 'server', key: 'server',
filterOptionValue: data.server, filterOptionValue: data.server,
filter(value, row) { filter(value, row) {
@ -120,7 +120,7 @@ defineExpose({
ellipsis: true, ellipsis: true,
}, },
{ {
title: $t('cmd'), title: $t('log.cmd'),
key: 'cmd', key: 'cmd',
titleAlign: 'center', titleAlign: 'center',
filterOptionValue: data.keyword, filterOptionValue: data.keyword,
@ -130,7 +130,7 @@ defineExpose({
}, },
}, },
{ {
title: $t('cost_time'), title: $t('log.cost_time'),
key: 'cost', key: 'cost',
width: 100, width: 100,
align: 'center', align: 'center',

View File

@ -138,9 +138,9 @@ const onReloadKey = async () => {
@refresh="refreshInfo(true)" /> @refresh="refreshInfo(true)" />
</div> </div>
<div v-else-if="showNonexists" class="content-container flex-item-expand flex-box-v"> <div v-else-if="showNonexists" class="content-container flex-item-expand flex-box-v">
<n-empty :description="$t('nonexist_tab_content')" class="empty-content"> <n-empty :description="$t('interface.nonexist_tab_content')" class="empty-content">
<template #extra> <template #extra>
<n-button :focusable="false" @click="onReloadKey">{{ $t('reload') }}</n-button> <n-button :focusable="false" @click="onReloadKey">{{ $t('interface.reload') }}</n-button>
</template> </template>
</n-empty> </n-empty>
</div> </div>

View File

@ -8,13 +8,13 @@ const dialogStore = useDialogStore()
<template> <template>
<div class="content-container flex-box-v"> <div class="content-container flex-box-v">
<!-- TODO: replace icon to app icon --> <!-- TODO: replace icon to app icon -->
<n-empty :description="$t('empty_server_content')"> <n-empty :description="$t('interface.empty_server_content')">
<template #extra> <template #extra>
<n-button :focusable="false" @click="dialogStore.openNewDialog()"> <n-button :focusable="false" @click="dialogStore.openNewDialog()">
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
{{ $t('new_conn') }} {{ $t('interface.new_conn') }}
</n-button> </n-button>
</template> </template>
</n-empty> </n-empty>

View File

@ -13,7 +13,7 @@ const tabStore = useTabStore()
const connectionStore = useConnectionStore() const connectionStore = useConnectionStore()
const onCloseTab = (tabIndex) => { const onCloseTab = (tabIndex) => {
$dialog.warning(i18n.t('close_confirm'), () => { $dialog.warning(i18n.t('dialogue.close_confirm'), () => {
const tab = get(tabStore.tabs, tabIndex) const tab = get(tabStore.tabs, tabIndex)
if (tab != null) { if (tab != null) {
connectionStore.closeConnection(tab.name) connectionStore.closeConnection(tab.name)

View File

@ -28,7 +28,7 @@ const role = computed(() => {
return get(props.info, 'Replication.role', '') return get(props.info, 'Replication.role', '')
}) })
const timeUnit = ['unit_minute', 'unit_hour', 'unit_day'] const timeUnit = ['common.unit_minute', 'common.unit_hour', 'common.unit_day']
const uptime = computed(() => { const uptime = computed(() => {
let seconds = get(props.info, 'Server.uptime_in_seconds', 0) let seconds = get(props.info, 'Server.uptime_in_seconds', 0)
seconds /= 60 seconds /= 60
@ -102,13 +102,13 @@ const infoFilter = ref('')
</template> </template>
<template #header-extra> <template #header-extra>
<n-space align="center" inline> <n-space align="center" inline>
{{ $t('auto_refresh') }} {{ $t('status.auto_refresh') }}
<n-switch <n-switch
:value="props.autoRefresh" :value="props.autoRefresh"
:loading="props.autoLoading" :loading="props.autoLoading"
@update:value="(v) => emit('update:autoRefresh', v)" /> @update:value="(v) => emit('update:autoRefresh', v)" />
<n-tooltip> <n-tooltip>
{{ $t('refresh') }} {{ $t('status.refresh') }}
<template #trigger> <template #trigger>
<n-button <n-button
circle circle
@ -127,31 +127,31 @@ const infoFilter = ref('')
<n-spin :show="props.loading"> <n-spin :show="props.loading">
<n-grid style="min-width: 500px" x-gap="5"> <n-grid style="min-width: 500px" x-gap="5">
<n-gi :span="6"> <n-gi :span="6">
<n-statistic :label="$t('uptime')" :value="uptime[0]"> <n-statistic :label="$t('status.uptime')" :value="uptime[0]">
<template #suffix>{{ $t(uptime[1]) }}</template> <template #suffix>{{ $t(uptime[1]) }}</template>
</n-statistic> </n-statistic>
</n-gi> </n-gi>
<n-gi :span="6"> <n-gi :span="6">
<n-statistic <n-statistic
:label="$t('connected_clients')" :label="$t('status.connected_clients')"
:value="get(props.info, 'Clients.connected_clients', 0)" /> :value="get(props.info, 'Clients.connected_clients', 0)" />
</n-gi> </n-gi>
<n-gi :span="6"> <n-gi :span="6">
<n-statistic :value="totalKeys"> <n-statistic :value="totalKeys">
<template #label> <template #label>
{{ $t('total_keys') }} {{ $t('status.total_keys') }}
</template> </template>
</n-statistic> </n-statistic>
</n-gi> </n-gi>
<n-gi :span="6"> <n-gi :span="6">
<n-statistic :label="$t('memory_used')" :value="usedMemory[0]"> <n-statistic :label="$t('status.memory_used')" :value="usedMemory[0]">
<template #suffix>{{ usedMemory[1] }}</template> <template #suffix>{{ usedMemory[1] }}</template>
</n-statistic> </n-statistic>
</n-gi> </n-gi>
</n-grid> </n-grid>
</n-spin> </n-spin>
</n-card> </n-card>
<n-card :title="$t('all_info')"> <n-card :title="$t('status.all_info')">
<template #header-extra> <template #header-extra>
<n-input v-model:value="infoFilter" clearable placeholder=""> <n-input v-model:value="infoFilter" clearable placeholder="">
<template #prefix> <template #prefix>
@ -165,7 +165,7 @@ const infoFilter = ref('')
<n-data-table <n-data-table
:columns="[ :columns="[
{ {
title: $t('key'), title: $t('common.key'),
key: 'key', key: 'key',
defaultSortOrder: 'ascend', defaultSortOrder: 'ascend',
sorter: 'default', sorter: 'default',
@ -175,7 +175,7 @@ const infoFilter = ref('')
return !!~row.key.indexOf(value.toString()) return !!~row.key.indexOf(value.toString())
}, },
}, },
{ title: $t('value'), key: 'value' }, { title: $t('common.value'), key: 'value' },
]" ]"
:data="map(v, (value, key) => ({ value, key }))" /> :data="map(v, (value, key) => ({ value, key }))" />
</n-tab-pane> </n-tab-pane>

View File

@ -41,7 +41,7 @@ const onCopyKey = () => {
ClipboardSetText(props.keyPath) ClipboardSetText(props.keyPath)
.then((succ) => { .then((succ) => {
if (succ) { if (succ) {
$message.success(i18n.t('copy_succ')) $message.success(i18n.t('dialogue.copy_succ'))
} }
}) })
.catch((e) => { .catch((e) => {
@ -50,10 +50,10 @@ const onCopyKey = () => {
} }
const onDeleteKey = () => { const onDeleteKey = () => {
$dialog.warning(i18n.t('remove_tip', { name: props.keyPath }), () => { $dialog.warning(i18n.t('dialogue.remove_tip', { name: props.keyPath }), () => {
connectionStore.deleteKey(props.server, props.db, props.keyPath).then((success) => { connectionStore.deleteKey(props.server, props.db, props.keyPath).then((success) => {
if (success) { if (success) {
$message.success(i18n.t('delete_key_succ', { key: props.keyPath })) $message.success(i18n.t('dialogue.delete_key_succ', { key: props.keyPath }))
} }
}) })
}) })
@ -66,10 +66,10 @@ const onDeleteKey = () => {
<redis-type-tag :type="props.keyType" size="large" /> <redis-type-tag :type="props.keyType" size="large" />
<n-input v-model:value="props.keyPath"> <n-input v-model:value="props.keyPath">
<template #suffix> <template #suffix>
<icon-button :icon="Refresh" size="18" t-tooltip="reload" @click="onReloadKey" /> <icon-button :icon="Refresh" size="18" t-tooltip="interface.reload" @click="onReloadKey" />
</template> </template>
</n-input> </n-input>
<icon-button :icon="Copy" border size="18" t-tooltip="copy_key" @click="onCopyKey" /> <icon-button :icon="Copy" border size="18" t-tooltip="interface.copy_key" @click="onCopyKey" />
</n-input-group> </n-input-group>
<n-button-group> <n-button-group>
<n-tooltip> <n-tooltip>
@ -79,9 +79,9 @@ const onDeleteKey = () => {
<n-icon :component="Timer" size="18" /> <n-icon :component="Timer" size="18" />
</template> </template>
<template v-if="ttl < 0"> <template v-if="ttl < 0">
{{ $t('forever') }} {{ $t('interface.forever') }}
</template> </template>
<template v-else>{{ ttl }} {{ $t('second') }}</template> <template v-else>{{ ttl }} {{ $t('common.second') }}</template>
</n-button> </n-button>
</template> </template>
TTL TTL
@ -90,7 +90,7 @@ const onDeleteKey = () => {
:icon="Edit" :icon="Edit"
border border
size="18" size="18"
t-tooltip="rename_key" t-tooltip="interface.rename_key"
@click="dialogStore.openRenameKeyDialog(props.server, props.db, props.keyPath)" /> @click="dialogStore.openRenameKeyDialog(props.server, props.db, props.keyPath)" />
</n-button-group> </n-button-group>
<n-tooltip> <n-tooltip>
@ -101,7 +101,7 @@ const onDeleteKey = () => {
</template> </template>
</n-button> </n-button>
</template> </template>
{{ $t('delete_key') }} {{ $t('interface.delete_key') }}
</n-tooltip> </n-tooltip>
</div> </div>
</template> </template>

View File

@ -24,11 +24,11 @@ const props = defineProps({
const filterOption = [ const filterOption = [
{ {
value: 1, value: 1,
label: i18n.t('field'), label: i18n.t('common.field'),
}, },
{ {
value: 2, value: 2,
label: i18n.t('value'), label: i18n.t('common.value'),
}, },
] ]
const filterType = ref(1) const filterType = ref(1)
@ -43,7 +43,7 @@ const currentEditRow = ref({
}) })
const fieldColumn = reactive({ const fieldColumn = reactive({
key: 'key', key: 'key',
title: i18n.t('field'), title: i18n.t('common.field'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
resizable: true, resizable: true,
@ -68,7 +68,7 @@ const fieldColumn = reactive({
}) })
const valueColumn = reactive({ const valueColumn = reactive({
key: 'value', key: 'value',
title: i18n.t('value'), title: i18n.t('common.value'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
resizable: true, resizable: true,
@ -99,7 +99,7 @@ const valueColumn = reactive({
}) })
const actionColumn = { const actionColumn = {
key: 'action', key: 'action',
title: i18n.t('action'), title: i18n.t('interface.action'),
width: 100, width: 100,
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
@ -123,7 +123,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('delete_key_succ', { key: row.key })) $message.success(i18n.t('dialogue.delete_key_succ', { key: row.key }))
// update display value // update display value
// if (!isEmpty(removed)) { // if (!isEmpty(removed)) {
// for (const elem of removed) { // for (const elem of removed) {
@ -149,7 +149,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
// update display value // update display value
// if (!isEmpty(updated)) { // if (!isEmpty(updated)) {
// for (const key in updated) { // for (const key in updated) {
@ -251,7 +251,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
@update:value="onChangeFilterType" /> @update:value="onChangeFilterType" />
<n-input <n-input
v-model:value="filterValue" v-model:value="filterValue"
:placeholder="$t('search')" :placeholder="$t('interface.search')"
clearable clearable
@clear="clearFilter" @clear="clearFilter"
@update:value="onFilterInput" /> @update:value="onFilterInput" />
@ -262,7 +262,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
{{ $t('add_row') }} {{ $t('interface.add_row') }}
</n-button> </n-button>
</div> </div>
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">

View File

@ -31,7 +31,7 @@ const currentEditRow = ref({
}) })
const valueColumn = reactive({ const valueColumn = reactive({
key: 'value', key: 'value',
title: i18n.t('value'), title: i18n.t('common.value'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
filterOptionValue: null, filterOptionValue: null,
@ -57,7 +57,7 @@ const valueColumn = reactive({
}) })
const actionColumn = { const actionColumn = {
key: 'action', key: 'action',
title: i18n.t('action'), title: i18n.t('interface.action'),
width: 100, width: 100,
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
@ -80,7 +80,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('delete_key_succ', { key: '#' + row.no })) $message.success(i18n.t('dialogue.delete_key_succ', { key: '#' + row.no }))
// update display value // update display value
// if (!isEmpty(removed)) { // if (!isEmpty(removed)) {
// props.value.splice(removed[0], 1) // props.value.splice(removed[0], 1)
@ -103,7 +103,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
// update display value // update display value
// if (!isEmpty(updated)) { // if (!isEmpty(updated)) {
// for (const key in updated) { // for (const key in updated) {
@ -176,7 +176,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="flex-box-h"> <div class="flex-box-h">
<n-input <n-input
v-model:value="filterValue" v-model:value="filterValue"
:placeholder="$t('search')" :placeholder="$t('interface.search')"
clearable clearable
@clear="clearFilter" @clear="clearFilter"
@update:value="onFilterInput" /> @update:value="onFilterInput" />
@ -186,7 +186,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
{{ $t('add_row') }} {{ $t('interface.add_row') }}
</n-button> </n-button>
</div> </div>
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">

View File

@ -32,7 +32,7 @@ const currentEditRow = ref({
const valueColumn = reactive({ const valueColumn = reactive({
key: 'value', key: 'value',
title: i18n.t('value'), title: i18n.t('common.value'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
filterOptionValue: null, filterOptionValue: null,
@ -58,7 +58,7 @@ const valueColumn = reactive({
}) })
const actionColumn = { const actionColumn = {
key: 'action', key: 'action',
title: i18n.t('action'), title: i18n.t('interface.action'),
width: 100, width: 100,
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
@ -82,7 +82,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('delete_key_succ', { key: row.value })) $message.success(i18n.t('dialogue.delete_key_succ', { key: row.value }))
// update display value // update display value
// props.value.splice(row.no - 1, 1) // props.value.splice(row.no - 1, 1)
} else { } else {
@ -103,7 +103,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
// update display value // update display value
// props.value[row.no - 1] = currentEditRow.value.value // props.value[row.no - 1] = currentEditRow.value.value
} else { } else {
@ -172,7 +172,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<div class="flex-box-h"> <div class="flex-box-h">
<n-input <n-input
v-model:value="filterValue" v-model:value="filterValue"
:placeholder="$t('search')" :placeholder="$t('interface.search')"
clearable clearable
@clear="clearFilter" @clear="clearFilter"
@update:value="onFilterInput" /> @update:value="onFilterInput" />
@ -182,7 +182,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
{{ $t('add_row') }} {{ $t('interface.add_row') }}
</n-button> </n-button>
</div> </div>
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">

View File

@ -25,11 +25,11 @@ const props = defineProps({
const filterOption = [ const filterOption = [
{ {
value: 1, value: 1,
label: i18n.t('field'), label: i18n.t('common.field'),
}, },
{ {
value: 2, value: 2,
label: i18n.t('value'), label: i18n.t('common.value'),
}, },
] ]
const filterType = ref(1) const filterType = ref(1)
@ -46,7 +46,7 @@ const idColumn = reactive({
}) })
const valueColumn = reactive({ const valueColumn = reactive({
key: 'value', key: 'value',
title: i18n.t('value'), title: i18n.t('common.value'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
resizable: true, resizable: true,
@ -71,7 +71,7 @@ const valueColumn = reactive({
}) })
const actionColumn = { const actionColumn = {
key: 'action', key: 'action',
title: i18n.t('action'), title: i18n.t('interface.action'),
width: 60, width: 60,
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
@ -90,7 +90,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('delete_key_succ', { key: row.id })) $message.success(i18n.t('dialogue.delete_key_succ', { key: row.id }))
// update display value // update display value
// if (!isEmpty(removed)) { // if (!isEmpty(removed)) {
// for (const elem of removed) { // for (const elem of removed) {
@ -164,7 +164,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
@update:value="onChangeFilterType" /> @update:value="onChangeFilterType" />
<n-input <n-input
v-model:value="filterValue" v-model:value="filterValue"
:placeholder="$t('search')" :placeholder="$t('interface.search')"
clearable clearable
@clear="clearFilter" @clear="clearFilter"
@update:value="onFilterInput" /> @update:value="onFilterInput" />
@ -175,7 +175,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
{{ $t('add_row') }} {{ $t('interface.add_row') }}
</n-button> </n-button>
</div> </div>
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">

View File

@ -115,7 +115,7 @@ const onCopyValue = () => {
ClipboardSetText(viewValue.value) ClipboardSetText(viewValue.value)
.then((succ) => { .then((succ) => {
if (succ) { if (succ) {
$message.success(i18n.t('copy_succ')) $message.success(i18n.t('dialogue.copy_succ'))
} }
}) })
.catch((e) => { .catch((e) => {
@ -152,7 +152,7 @@ const onSaveValue = async () => {
) )
if (success) { if (success) {
await connectionStore.loadKeyValue(props.name, props.db, props.keyPath) await connectionStore.loadKeyValue(props.name, props.db, props.keyPath)
$message.success(i18n.t('save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -169,7 +169,7 @@ const onSaveValue = async () => {
<div class="content-wrapper flex-box-v"> <div class="content-wrapper flex-box-v">
<content-toolbar :db="props.db" :key-path="keyPath" :key-type="keyType" :server="props.name" :ttl="ttl" /> <content-toolbar :db="props.db" :key-path="keyPath" :key-type="keyType" :server="props.name" :ttl="ttl" />
<div class="tb2 flex-box-h"> <div class="tb2 flex-box-h">
<n-text>{{ $t('view_as') }}</n-text> <n-text>{{ $t('interface.view_as') }}</n-text>
<n-select v-model:value="viewAs" :options="viewOption" style="width: 200px" /> <n-select v-model:value="viewAs" :options="viewOption" style="width: 200px" />
<div class="flex-item-expand"></div> <div class="flex-item-expand"></div>
<n-button-group v-if="!inEdit"> <n-button-group v-if="!inEdit">
@ -177,13 +177,13 @@ const onSaveValue = async () => {
<template #icon> <template #icon>
<n-icon :component="Copy" size="18" /> <n-icon :component="Copy" size="18" />
</template> </template>
{{ $t('copy_value') }} {{ $t('interface.copy_value') }}
</n-button> </n-button>
<n-button plain :focusable="false" @click="onEditValue"> <n-button plain :focusable="false" @click="onEditValue">
<template #icon> <template #icon>
<n-icon :component="Edit" size="18" /> <n-icon :component="Edit" size="18" />
</template> </template>
{{ $t('edit_value') }} {{ $t('interface.edit_value') }}
</n-button> </n-button>
</n-button-group> </n-button-group>
<n-button-group v-else> <n-button-group v-else>
@ -191,13 +191,13 @@ const onSaveValue = async () => {
<template #icon> <template #icon>
<n-icon :component="Save" size="18" /> <n-icon :component="Save" size="18" />
</template> </template>
{{ $t('save_update') }} {{ $t('interface.save_update') }}
</n-button> </n-button>
<n-button :loading="saving" :focusable="false" plain @click="onCancelEdit"> <n-button :loading="saving" :focusable="false" plain @click="onCancelEdit">
<template #icon> <template #icon>
<n-icon :component="Close" size="18" /> <n-icon :component="Close" size="18" />
</template> </template>
{{ $t('cancel') }} {{ $t('common.cancel') }}
</n-button> </n-button>
</n-button-group> </n-button-group>
</div> </div>

View File

@ -25,11 +25,11 @@ const props = defineProps({
const filterOption = [ const filterOption = [
{ {
value: 1, value: 1,
label: i18n.t('value'), label: i18n.t('common.value'),
}, },
{ {
value: 2, value: 2,
label: i18n.t('score'), label: i18n.t('interface.score'),
}, },
] ]
const filterType = ref(1) const filterType = ref(1)
@ -44,7 +44,7 @@ const currentEditRow = ref({
}) })
const scoreColumn = reactive({ const scoreColumn = reactive({
key: 'score', key: 'score',
title: i18n.t('score'), title: i18n.t('interface.score'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
resizable: true, resizable: true,
@ -98,7 +98,7 @@ const scoreColumn = reactive({
}) })
const valueColumn = reactive({ const valueColumn = reactive({
key: 'value', key: 'value',
title: i18n.t('value'), title: i18n.t('common.value'),
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
resizable: true, resizable: true,
@ -129,7 +129,7 @@ const valueColumn = reactive({
}) })
const actionColumn = { const actionColumn = {
key: 'action', key: 'action',
title: i18n.t('action'), title: i18n.t('interface.action'),
width: 100, width: 100,
align: 'center', align: 'center',
titleAlign: 'center', titleAlign: 'center',
@ -153,7 +153,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('delete_key_succ', { key: row.value })) $message.success(i18n.t('dialogue.delete_key_succ', { key: row.value }))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -165,7 +165,7 @@ const actionColumn = {
try { try {
const newValue = currentEditRow.value.value const newValue = currentEditRow.value.value
if (isEmpty(newValue)) { if (isEmpty(newValue)) {
$message.error(i18n.t('spec_field_required', { key: i18n.t('value') })) $message.error(i18n.t('dialogue.spec_field_required', { key: i18n.t('common.value') }))
return return
} }
const { success, msg } = await connectionStore.updateZSetItem( const { success, msg } = await connectionStore.updateZSetItem(
@ -178,7 +178,7 @@ const actionColumn = {
) )
if (success) { if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {}) connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
$message.success(i18n.t('save_value_succ')) $message.success(i18n.t('dialogue.save_value_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -279,12 +279,12 @@ const onUpdateFilter = (filters, sourceColumn) => {
<template #trigger> <template #trigger>
<n-input <n-input
v-model:value="filterValue" v-model:value="filterValue"
:placeholder="$t('search')" :placeholder="$t('interface.search')"
clearable clearable
@clear="clearFilter" @clear="clearFilter"
@update:value="onFilterInput" /> @update:value="onFilterInput" />
</template> </template>
<div class="text-block">{{ $t('score_filter_tip') }}</div> <div class="text-block">{{ $t('interface.score_filter_tip') }}</div>
</n-tooltip> </n-tooltip>
</n-input-group> </n-input-group>
</div> </div>
@ -293,7 +293,7 @@ const onUpdateFilter = (filters, sourceColumn) => {
<template #icon> <template #icon>
<n-icon :component="AddLink" size="18" /> <n-icon :component="AddLink" size="18" />
</template> </template>
{{ $t('add_row') }} {{ $t('interface.add_row') }}
</n-button> </n-button>
</div> </div>
<div class="value-wrapper fill-height flex-box-h"> <div class="value-wrapper fill-height flex-box-h">

View File

@ -47,15 +47,15 @@ const defaultValue = {
const title = computed(() => { const title = computed(() => {
switch (newForm.type) { switch (newForm.type) {
case types.LIST: case types.LIST:
return i18n.t('new_item') return i18n.t('dialogue.field.new_item')
case types.HASH: case types.HASH:
return i18n.t('new_field') return i18n.t('dialogue.field.new')
case types.SET: case types.SET:
return i18n.t('new_field') return i18n.t('dialogue.field.new')
case types.ZSET: case types.ZSET:
return i18n.t('new_field') return i18n.t('dialogue.field.new')
case types.STREAM: case types.STREAM:
return i18n.t('new_field') return i18n.t('dialogue.field.new')
} }
return '' return ''
}) })
@ -98,7 +98,7 @@ const onAdd = async () => {
if (newForm.reload) { if (newForm.reload) {
connectionStore.loadKeyValue(server, db, key).then(() => {}) connectionStore.loadKeyValue(server, db, key).then(() => {})
} }
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -112,7 +112,7 @@ const onAdd = async () => {
if (newForm.reload) { if (newForm.reload) {
connectionStore.loadKeyValue(server, db, key).then(() => {}) connectionStore.loadKeyValue(server, db, key).then(() => {})
} }
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -126,7 +126,7 @@ const onAdd = async () => {
if (newForm.reload) { if (newForm.reload) {
connectionStore.loadKeyValue(server, db, key).then(() => {}) connectionStore.loadKeyValue(server, db, key).then(() => {})
} }
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -140,7 +140,7 @@ const onAdd = async () => {
if (newForm.reload) { if (newForm.reload) {
connectionStore.loadKeyValue(server, db, key).then(() => {}) connectionStore.loadKeyValue(server, db, key).then(() => {})
} }
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -161,7 +161,7 @@ const onAdd = async () => {
if (newForm.reload) { if (newForm.reload) {
connectionStore.loadKeyValue(server, db, key).then(() => {}) connectionStore.loadKeyValue(server, db, key).then(() => {})
} }
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -187,9 +187,9 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:negative-button-props="{ size: 'medium' }" :negative-button-props="{ size: 'medium' }"
:negative-text="$t('cancel')" :negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }" :positive-button-props="{ size: 'medium' }"
:positive-text="$t('confirm')" :positive-text="$t('common.confirm')"
:show-icon="false" :show-icon="false"
:title="title" :title="title"
preset="dialog" preset="dialog"
@ -199,7 +199,7 @@ const onClose = () => {
@negative-click="onClose"> @negative-click="onClose">
<n-scrollbar style="max-height: 500px"> <n-scrollbar style="max-height: 500px">
<n-form :model="newForm" :show-require-mark="false" label-placement="top" style="padding-right: 15px"> <n-form :model="newForm" :show-require-mark="false" label-placement="top" style="padding-right: 15px">
<n-form-item :label="$t('key')" path="key" required> <n-form-item :label="$t('common.key')" path="key" required>
<n-input v-model:value="newForm.key" placeholder="" readonly /> <n-input v-model:value="newForm.key" placeholder="" readonly />
</n-form-item> </n-form-item>
<component <component
@ -208,7 +208,7 @@ const onClose = () => {
v-model:value="newForm.value" /> v-model:value="newForm.value" />
<n-form-item label=" " path="key" required> <n-form-item label=" " path="key" required>
<n-checkbox v-model:checked="newForm.reload"> <n-checkbox v-model:checked="newForm.reload">
{{ $t('reload_when_succ') }} {{ $t('dialogue.field.reload_when_succ') }}
</n-checkbox> </n-checkbox>
</n-form-item> </n-form-item>
</n-form> </n-form>

View File

@ -18,7 +18,7 @@ const i18n = useI18n()
const editName = ref('') const editName = ref('')
const generalForm = ref(null) const generalForm = ref(null)
const generalFormRules = () => { const generalFormRules = () => {
const requiredMsg = i18n.t('field_required') const requiredMsg = i18n.t('dialogue.field_required')
const illegalChars = ['/', '\\'] const illegalChars = ['/', '\\']
return { return {
name: [ name: [
@ -27,7 +27,7 @@ const generalFormRules = () => {
validator: (rule, value) => { validator: (rule, value) => {
return every(illegalChars, (c) => !includes(value, c)) return every(illegalChars, (c) => !includes(value, c))
}, },
message: i18n.t('illegal_characters'), message: i18n.t('dialogue.illegal_characters'),
trigger: 'input', trigger: 'input',
}, },
], ],
@ -50,7 +50,7 @@ const groupOptions = computed(() => {
value: group, value: group,
})) }))
options.splice(0, 0, { options.splice(0, 0, {
label: i18n.t('no_group'), label: i18n.t('dialogue.connection.no_group'),
value: '', value: '',
}) })
return options return options
@ -86,7 +86,7 @@ const onSaveConnection = async () => {
return return
} }
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
onClose() onClose()
} }
@ -149,26 +149,30 @@ const onClose = () => {
:mask-closable="false" :mask-closable="false"
:on-after-leave="resetForm" :on-after-leave="resetForm"
:show-icon="false" :show-icon="false"
:title="isEditMode ? $t('edit_conn_title') : $t('new_conn_title')" :title="isEditMode ? $t('dialogue.connection.edit_title') : $t('dialogue.connection.new_title')"
preset="dialog" preset="dialog"
transform-origin="center"> transform-origin="center">
<n-spin :show="closingConnection"> <n-spin :show="closingConnection">
<n-tabs v-model:value="tab" animated type="line"> <n-tabs v-model:value="tab" animated type="line">
<n-tab-pane :tab="$t('general')" display-directive="show" name="general"> <n-tab-pane :tab="$t('dialogue.connection.general')" display-directive="show" name="general">
<n-form <n-form
ref="generalFormRef" ref="generalFormRef"
:model="generalForm" :model="generalForm"
:rules="generalFormRules()" :rules="generalFormRules()"
:show-require-mark="false" :show-require-mark="false"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('conn_name')" path="name" required> <n-form-item :label="$t('dialogue.connection.conn_name')" path="name" required>
<n-input v-model:value="generalForm.name" :placeholder="$t('conn_name_tip')" /> <n-input
v-model:value="generalForm.name"
:placeholder="$t('dialogue.connection.name_tip')" />
</n-form-item> </n-form-item>
<n-form-item v-if="!isEditMode" :label="$t('conn_group')" required> <n-form-item v-if="!isEditMode" :label="$t('dialogue.connection.group')" required>
<n-select v-model:value="generalForm.group" :options="groupOptions" /> <n-select v-model:value="generalForm.group" :options="groupOptions" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_addr')" path="addr" required> <n-form-item :label="$t('dialogue.connection.addr')" path="addr" required>
<n-input v-model:value="generalForm.addr" :placeholder="$t('conn_addr_tip')" /> <n-input
v-model:value="generalForm.addr"
:placeholder="$t('dialogue.connection.addr_tip')" />
<n-text style="width: 40px; text-align: center">:</n-text> <n-text style="width: 40px; text-align: center">:</n-text>
<n-input-number <n-input-number
v-model:value="generalForm.port" v-model:value="generalForm.port"
@ -176,51 +180,51 @@ const onClose = () => {
:min="1" :min="1"
style="width: 200px" /> style="width: 200px" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_pwd')" path="password"> <n-form-item :label="$t('dialogue.connection.pwd')" path="password">
<n-input <n-input
v-model:value="generalForm.password" v-model:value="generalForm.password"
:placeholder="$t('conn_pwd_tip')" :placeholder="$t('dialogue.connection.pwd_tip')"
show-password-on="click" show-password-on="click"
type="password" /> type="password" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_usr')" path="username"> <n-form-item :label="$t('dialogue.connection.usr')" path="username">
<n-input v-model="generalForm.username" :placeholder="$t('conn_usr_tip')" /> <n-input v-model="generalForm.username" :placeholder="$t('dialogue.connection.usr_tip')" />
</n-form-item> </n-form-item>
</n-form> </n-form>
</n-tab-pane> </n-tab-pane>
<n-tab-pane :tab="$t('advanced')" display-directive="show" name="advanced"> <n-tab-pane :tab="$t('dialogue.connection.advanced')" display-directive="show" name="advanced">
<n-form <n-form
ref="advanceFormRef" ref="advanceFormRef"
:model="generalForm" :model="generalForm"
:rules="generalFormRules()" :rules="generalFormRules()"
:show-require-mark="false" :show-require-mark="false"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('conn_advn_filter')" path="defaultFilter"> <n-form-item :label="$t('dialogue.connection.advn_filter')" path="defaultFilter">
<n-input <n-input
v-model:value="generalForm.defaultFilter" v-model:value="generalForm.defaultFilter"
:placeholder="$t('conn_advn_filter_tip')" /> :placeholder="$t('dialogue.connection.advn_filter_tip')" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_advn_separator')" path="keySeparator"> <n-form-item :label="$t('dialogue.connection.advn_separator')" path="keySeparator">
<n-input <n-input
v-model:value="generalForm.keySeparator" v-model:value="generalForm.keySeparator"
:placeholder="$t('conn_advn_separator_tip')" /> :placeholder="$t('dialogue.connection.advn_separator_tip')" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_advn_conn_timeout')" path="connTimeout"> <n-form-item :label="$t('dialogue.connection.advn_conn_timeout')" path="connTimeout">
<n-input-number v-model:value="generalForm.connTimeout" :max="999999" :min="1"> <n-input-number v-model:value="generalForm.connTimeout" :max="999999" :min="1">
<template #suffix> <template #suffix>
{{ $t('second') }} {{ $t('common.second') }}
</template> </template>
</n-input-number> </n-input-number>
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_advn_exec_timeout')" path="execTimeout"> <n-form-item :label="$t('dialogue.connection.advn_exec_timeout')" path="execTimeout">
<n-input-number v-model:value="generalForm.execTimeout" :max="999999" :min="1"> <n-input-number v-model:value="generalForm.execTimeout" :max="999999" :min="1">
<template #suffix> <template #suffix>
{{ $t('second') }} {{ $t('common.second') }}
</template> </template>
</n-input-number> </n-input-number>
</n-form-item> </n-form-item>
<n-form-item :label="$t('conn_advn_mark_color')" path="markColor"> <n-form-item :label="$t('dialogue.connection.advn_mark_color')" path="markColor">
<div <div
v-for="color in predefineColors" v-for="color in predefineColors"
:key="color" :key="color"
@ -240,9 +244,9 @@ const onClose = () => {
<!-- test result alert--> <!-- test result alert-->
<n-alert <n-alert
v-if="showTestResult" v-if="showTestResult"
:title="isEmpty(testResult) ? '' : $t('conn_test_fail')" :title="isEmpty(testResult) ? '' : $t('dialogue.connection.test_fail')"
:type="isEmpty(testResult) ? 'success' : 'error'"> :type="isEmpty(testResult) ? 'success' : 'error'">
<template v-if="isEmpty(testResult)">{{ $t('conn_test_succ') }}</template> <template v-if="isEmpty(testResult)">{{ $t('dialogue.connection.test_succ') }}</template>
<template v-else>{{ testResult }}</template> <template v-else>{{ testResult }}</template>
</n-alert> </n-alert>
</n-spin> </n-spin>
@ -250,15 +254,15 @@ const onClose = () => {
<template #action> <template #action>
<div class="flex-item-expand"> <div class="flex-item-expand">
<n-button :focusable="false" :disabled="closingConnection" :loading="testing" @click="onTestConnection"> <n-button :focusable="false" :disabled="closingConnection" :loading="testing" @click="onTestConnection">
{{ $t('conn_test') }} {{ $t('dialogue.connection.test') }}
</n-button> </n-button>
</div> </div>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :focusable="false" :disabled="closingConnection" @click="onClose"> <n-button :focusable="false" :disabled="closingConnection" @click="onClose">
{{ $t('cancel') }} {{ $t('common.cancel') }}
</n-button> </n-button>
<n-button :focusable="false" :disabled="closingConnection" type="primary" @click="onSaveConnection"> <n-button :focusable="false" :disabled="closingConnection" type="primary" @click="onSaveConnection">
{{ isEditMode ? $t('update') : $t('confirm') }} {{ isEditMode ? $t('preferences.general.update') : $t('common.confirm') }}
</n-button> </n-button>
</div> </div>
</template> </template>

View File

@ -53,7 +53,7 @@ const onConfirmDelete = async () => {
const { server, db, key } = deleteForm const { server, db, key } = deleteForm
const success = await connectionStore.deleteKeyPrefix(server, db, key) const success = await connectionStore.deleteKeyPrefix(server, db, key)
if (success) { if (success) {
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} }
} catch (e) { } catch (e) {
$message.error(e.message) $message.error(e.message)
@ -73,20 +73,20 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:show-icon="false" :show-icon="false"
:title="$t('batch_delete_key')" :title="$t('interface.batch_delete_key')"
preset="dialog" preset="dialog"
transform-origin="center"> transform-origin="center">
<n-form :model="deleteForm" :show-require-mark="false" label-placement="top"> <n-form :model="deleteForm" :show-require-mark="false" label-placement="top">
<n-form-item :label="$t('server')"> <n-form-item :label="$t('dialogue.key.server')">
<n-input :value="deleteForm.server" readonly /> <n-input :value="deleteForm.server" readonly />
</n-form-item> </n-form-item>
<n-form-item :label="$t('db_index')"> <n-form-item :label="$t('dialogue.key.db_index')">
<n-input :value="deleteForm.db.toString()" readonly /> <n-input :value="deleteForm.db.toString()" readonly />
</n-form-item> </n-form-item>
<n-form-item :label="$t('key_expression')" required> <n-form-item :label="$t('dialogue.key.key_expression')" required>
<n-input v-model:value="deleteForm.key" placeholder="" @input="resetAffected" /> <n-input v-model:value="deleteForm.key" placeholder="" @input="resetAffected" />
</n-form-item> </n-form-item>
<n-card v-if="deleteForm.showAffected" :title="$t('affected_key')" size="small"> <n-card v-if="deleteForm.showAffected" :title="$t('dialogue.key.affected_key')" size="small">
<n-skeleton v-if="deleteForm.loadingAffected" :repeat="10" text /> <n-skeleton v-if="deleteForm.loadingAffected" :repeat="10" text />
<n-log <n-log
v-else v-else
@ -99,9 +99,9 @@ const onClose = () => {
<template #action> <template #action>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :focusable="false" @click="onClose">{{ $t('cancel') }}</n-button> <n-button :focusable="false" @click="onClose">{{ $t('common.cancel') }}</n-button>
<n-button v-if="!deleteForm.showAffected" type="primary" :focusable="false" @click="scanAffectedKey"> <n-button v-if="!deleteForm.showAffected" type="primary" :focusable="false" @click="scanAffectedKey">
{{ $t('show_affected_key') }} {{ $t('dialogue.key.show_affected_key') }}
</n-button> </n-button>
<n-button <n-button
v-else v-else
@ -109,7 +109,7 @@ const onClose = () => {
:disabled="isEmpty(deleteForm.affectedKeys)" :disabled="isEmpty(deleteForm.affectedKeys)"
type="error" type="error"
@click="onConfirmDelete"> @click="onConfirmDelete">
{{ $t('confirm_delete_key', { num: size(deleteForm.affectedKeys) }) }} {{ $t('dialogue.key.confirm_delete_key', { num: size(deleteForm.affectedKeys) }) }}
</n-button> </n-button>
</div> </div>
</template> </template>

View File

@ -34,14 +34,14 @@ const onConfirm = async () => {
if (isRenameMode.value) { if (isRenameMode.value) {
const { success, msg } = await connectionStore.renameGroup(editGroup.value, name) const { success, msg } = await connectionStore.renameGroup(editGroup.value, name)
if (success) { if (success) {
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
} else { } else {
const { success, msg } = await connectionStore.createGroup(name) const { success, msg } = await connectionStore.createGroup(name)
if (success) { if (success) {
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -68,17 +68,17 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:negative-button-props="{ size: 'medium' }" :negative-button-props="{ size: 'medium' }"
:negative-text="$t('cancel')" :negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }" :positive-button-props="{ size: 'medium' }"
:positive-text="$t('confirm')" :positive-text="$t('common.confirm')"
:show-icon="false" :show-icon="false"
:title="isRenameMode ? $t('rename_group') : $t('new_group')" :title="isRenameMode ? $t('dialogue.group.rename') : $t('dialogue.group.new')"
preset="dialog" preset="dialog"
transform-origin="center" transform-origin="center"
@positive-click="onConfirm" @positive-click="onConfirm"
@negative-click="onClose"> @negative-click="onClose">
<n-form :model="groupForm" :show-label="false" :show-require-mark="false" label-placement="top"> <n-form :model="groupForm" :show-label="false" :show-require-mark="false" label-placement="top">
<n-form-item :label="$t('group_name')" required> <n-form-item :label="$t('dialogue.group.name')" required>
<n-input v-model:value="groupForm.name" placeholder="" /> <n-input v-model:value="groupForm.name" placeholder="" />
</n-form-item> </n-form-item>
</n-form> </n-form>

View File

@ -20,7 +20,7 @@ const typeOptions = computed(() => {
})) }))
options.splice(0, 0, { options.splice(0, 0, {
value: '', value: '',
label: i18n.t('all'), label: i18n.t('common.all'),
}) })
return options return options
}) })
@ -58,11 +58,11 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:negative-button-props="{ size: 'medium' }" :negative-button-props="{ size: 'medium' }"
:negative-text="$t('cancel')" :negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }" :positive-button-props="{ size: 'medium' }"
:positive-text="$t('confirm')" :positive-text="$t('common.confirm')"
:show-icon="false" :show-icon="false"
:title="$t('set_key_filter')" :title="$t('dialogue.filter.set_key_filter')"
preset="dialog" preset="dialog"
style="width: 450px" style="width: 450px"
transform-origin="center" transform-origin="center"
@ -77,22 +77,22 @@ const onClose = () => {
<n-form-item :label="$t('server')" path="key"> <n-form-item :label="$t('server')" path="key">
<n-text>{{ filterForm.server }}</n-text> <n-text>{{ filterForm.server }}</n-text>
</n-form-item> </n-form-item>
<n-form-item :label="$t('db_index')" path="db"> <n-form-item :label="$t('dialogue.key.db_index')" path="db">
<n-text>{{ filterForm.db }}</n-text> <n-text>{{ filterForm.db }}</n-text>
</n-form-item> </n-form-item>
<n-form-item :label="$t('type')" path="type" required> <n-form-item :label="$t('interface.type')" path="type" required>
<n-select v-model:value="filterForm.type" :options="typeOptions" /> <n-select v-model:value="filterForm.type" :options="typeOptions" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('filter_pattern')" required> <n-form-item :label="$t('dialogue.filter.filter_pattern')" required>
<n-input-group> <n-input-group>
<n-tooltip trigger="focus"> <n-tooltip trigger="focus">
<template #trigger> <template #trigger>
<n-input v-model:value="filterForm.pattern" clearable placeholder="Filter Pattern" /> <n-input v-model:value="filterForm.pattern" clearable placeholder="Filter Pattern" />
</template> </template>
<div class="text-block">{{ $t('filter_pattern_tip') }}</div> <div class="text-block">{{ $t('dialogue.filter.filter_pattern_tip') }}</div>
</n-tooltip> </n-tooltip>
<n-button secondary type="primary" :focusable="false" @click="filterForm.pattern = '*'"> <n-button secondary type="primary" :focusable="false" @click="filterForm.pattern = '*'">
{{ $t('restore_defaults') }} {{ $t('preferences.restore_defaults') }}
</n-button> </n-button>
</n-input-group> </n-input-group>
</n-form-item> </n-form-item>

View File

@ -24,7 +24,7 @@ const newForm = reactive({
value: null, value: null,
}) })
const formRules = computed(() => { const formRules = computed(() => {
const requiredMsg = i18n.t('field_required') const requiredMsg = i18n.t('dialogue.field_required')
return { return {
key: { required: true, message: requiredMsg, trigger: 'input' }, key: { required: true, message: requiredMsg, trigger: 'input' },
type: { required: true, message: requiredMsg, trigger: 'input' }, type: { required: true, message: requiredMsg, trigger: 'input' },
@ -107,7 +107,7 @@ const onAdd = async () => {
$message.error(err.message) $message.error(err.message)
}) })
if (subFormRef.value?.validate && !subFormRef.value?.validate()) { if (subFormRef.value?.validate && !subFormRef.value?.validate()) {
$message.error(i18n.t('spec_field_required', { key: i18n.t('element') })) $message.error(i18n.t('dialogue.spec_field_required', { key: i18n.t('dialogue.field.element') }))
return false return false
} }
try { try {
@ -140,11 +140,11 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:negative-button-props="{ size: 'medium' }" :negative-button-props="{ size: 'medium' }"
:negative-text="$t('cancel')" :negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }" :positive-button-props="{ size: 'medium' }"
:positive-text="$t('confirm')" :positive-text="$t('common.confirm')"
:show-icon="false" :show-icon="false"
:title="$t('new_key')" :title="$t('dialogue.key.new')"
preset="dialog" preset="dialog"
style="width: 600px" style="width: 600px"
transform-origin="center" transform-origin="center"
@ -158,16 +158,16 @@ const onClose = () => {
:show-require-mark="false" :show-require-mark="false"
label-placement="top" label-placement="top"
style="padding-right: 15px"> style="padding-right: 15px">
<n-form-item :label="$t('key')" path="key" required> <n-form-item :label="$t('common.key')" path="key" required>
<n-input v-model:value="newForm.key" placeholder="" /> <n-input v-model:value="newForm.key" placeholder="" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('db_index')" path="db" required> <n-form-item :label="$t('dialogue.key.db_index')" path="db" required>
<n-select v-model:value="newForm.db" :options="dbOptions" filterable /> <n-select v-model:value="newForm.db" :options="dbOptions" filterable />
</n-form-item> </n-form-item>
<n-form-item :label="$t('type')" path="type" required> <n-form-item :label="$t('interface.type')" path="type" required>
<n-select v-model:value="newForm.type" :options="options" :render-label="renderTypeLabel" /> <n-select v-model:value="newForm.type" :options="options" :render-label="renderTypeLabel" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('ttl')" required> <n-form-item :label="$t('interface.ttl')" required>
<n-input-group> <n-input-group>
<n-input-number <n-input-number
v-model:value="newForm.ttl" v-model:value="newForm.ttl"
@ -175,11 +175,11 @@ const onClose = () => {
:min="-1" :min="-1"
placeholder="TTL"> placeholder="TTL">
<template #suffix> <template #suffix>
{{ $t('second') }} {{ $t('common.second') }}
</template> </template>
</n-input-number> </n-input-number>
<n-button secondary type="primary" :focusable="false" @click="newForm.ttl = -1"> <n-button secondary type="primary" :focusable="false" @click="newForm.ttl = -1">
{{ $t('persist_key') }} {{ $t('dialogue.key.persist_key') }}
</n-button> </n-button>
</n-input-group> </n-input-group>
</n-form-item> </n-form-item>

View File

@ -38,7 +38,7 @@ watch(
const onSavePreferences = async () => { const onSavePreferences = async () => {
const success = await prefStore.savePreferences() const success = await prefStore.savePreferences()
if (success) { if (success) {
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
dialogStore.closePreferencesDialog() dialogStore.closePreferencesDialog()
} }
} }
@ -58,57 +58,57 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:show-icon="false" :show-icon="false"
:title="$t('preferences')" :title="$t('preferences.name')"
preset="dialog" preset="dialog"
transform-origin="center"> transform-origin="center">
<!-- FIXME: set loading will slow down appear animation of dialog in linux --> <!-- FIXME: set loading will slow down appear animation of dialog in linux -->
<!-- <n-spin :show="loading"> --> <!-- <n-spin :show="loading"> -->
<n-tabs v-model:value="tab" animated type="line"> <n-tabs v-model:value="tab" animated type="line">
<n-tab-pane :tab="$t('general')" display-directive="show" name="general"> <n-tab-pane :tab="$t('preferences.general.name')" display-directive="show" name="general">
<n-form :disabled="loading" :model="prefStore.general" :show-require-mark="false" label-placement="top"> <n-form :disabled="loading" :model="prefStore.general" :show-require-mark="false" label-placement="top">
<n-form-item :label="$t('theme')" required> <n-form-item :label="$t('preferences.general.theme')" required>
<n-radio-group v-model:value="prefStore.general.theme" name="theme" size="medium"> <n-radio-group v-model:value="prefStore.general.theme" name="theme" size="medium">
<n-radio-button v-for="opt in prefStore.themeOption" :key="opt.value" :value="opt.value"> <n-radio-button v-for="opt in prefStore.themeOption" :key="opt.value" :value="opt.value">
{{ opt.label }} {{ opt.label }}
</n-radio-button> </n-radio-button>
</n-radio-group> </n-radio-group>
</n-form-item> </n-form-item>
<n-form-item :label="$t('language')" required> <n-form-item :label="$t('preferences.general.language')" required>
<n-select <n-select
v-model:value="prefStore.general.language" v-model:value="prefStore.general.language"
:options="prefStore.langOption" :options="prefStore.langOption"
filterable /> filterable />
</n-form-item> </n-form-item>
<n-form-item :label="$t('font')" required> <n-form-item :label="$t('preferences.general.font')" required>
<n-select v-model:value="prefStore.general.font" :options="prefStore.fontOption" filterable /> <n-select v-model:value="prefStore.general.font" :options="prefStore.fontOption" filterable />
</n-form-item> </n-form-item>
<n-form-item :label="$t('font_size')"> <n-form-item :label="$t('preferences.general.font_size')">
<n-input-number v-model:value="prefStore.general.fontSize" :max="65535" :min="1" /> <n-input-number v-model:value="prefStore.general.fontSize" :max="65535" :min="1" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('proxy')"> <n-form-item :label="$t('preferences.general.proxy')">
<n-space> <n-space>
<n-checkbox v-model:checked="prefStore.general.useSysProxy"> <n-checkbox v-model:checked="prefStore.general.useSysProxy">
{{ $t('use_system_proxy') }} {{ $t('preferences.general.use_system_proxy') }}
</n-checkbox> </n-checkbox>
<n-checkbox v-model:checked="prefStore.general.useSysProxyHttp"> <n-checkbox v-model:checked="prefStore.general.useSysProxyHttp">
{{ $t('use_system_proxy_http') }} {{ $t('preferences.general.use_system_proxy_http') }}
</n-checkbox> </n-checkbox>
</n-space> </n-space>
</n-form-item> </n-form-item>
<n-form-item :label="$t('update')"> <n-form-item :label="$t('preferences.general.update')">
<n-checkbox v-model:checked="prefStore.general.checkUpdate"> <n-checkbox v-model:checked="prefStore.general.checkUpdate">
{{ $t('auto_check_update') }} {{ $t('preferences.general.auto_check_update') }}
</n-checkbox> </n-checkbox>
</n-form-item> </n-form-item>
</n-form> </n-form>
</n-tab-pane> </n-tab-pane>
<n-tab-pane :tab="$t('editor')" display-directive="show" name="editor"> <n-tab-pane :tab="$t('preferences.editor.name')" display-directive="show" name="editor">
<n-form :disabled="loading" :model="prefStore.editor" :show-require-mark="false" label-placement="top"> <n-form :disabled="loading" :model="prefStore.editor" :show-require-mark="false" label-placement="top">
<n-form-item :label="$t('font')" required> <n-form-item :label="$t('preferences.general.font')" required>
<n-select v-model:value="prefStore.editor.font" :options="prefStore.fontOption" filterable /> <n-select v-model:value="prefStore.editor.font" :options="prefStore.fontOption" filterable />
</n-form-item> </n-form-item>
<n-form-item :label="$t('font_size')"> <n-form-item :label="$t('preferences.general.font_size')">
<n-input-number v-model:value="prefStore.editor.fontSize" :max="65535" :min="1" /> <n-input-number v-model:value="prefStore.editor.fontSize" :max="65535" :min="1" />
</n-form-item> </n-form-item>
</n-form> </n-form>
@ -119,12 +119,14 @@ const onClose = () => {
<template #action> <template #action>
<div class="flex-item-expand"> <div class="flex-item-expand">
<n-button :disabled="loading" @click="prefStore.restorePreferences"> <n-button :disabled="loading" @click="prefStore.restorePreferences">
{{ $t('restore_defaults') }} {{ $t('preferences.restore_defaults') }}
</n-button> </n-button>
</div> </div>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :disabled="loading" @click="onClose">{{ $t('cancel') }}</n-button> <n-button :disabled="loading" @click="onClose">{{ $t('common.cancel') }}</n-button>
<n-button :disabled="loading" type="primary" @click="onSavePreferences">{{ $t('save') }}</n-button> <n-button :disabled="loading" type="primary" @click="onSavePreferences">
{{ $t('common.save') }}
</n-button>
</div> </div>
</template> </template>
</n-modal> </n-modal>

View File

@ -33,7 +33,7 @@ const onRename = async () => {
const { success, msg } = await connectionStore.renameKey(server, db, key, newKey) const { success, msg } = await connectionStore.renameKey(server, db, key, newKey)
if (success) { if (success) {
await connectionStore.loadKeyValue(server, db, newKey) await connectionStore.loadKeyValue(server, db, newKey)
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} else { } else {
$message.error(msg) $message.error(msg)
} }
@ -55,11 +55,11 @@ const onClose = () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:negative-button-props="{ size: 'medium' }" :negative-button-props="{ size: 'medium' }"
:negative-text="$t('cancel')" :negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }" :positive-button-props="{ size: 'medium' }"
:positive-text="$t('confirm')" :positive-text="$t('common.confirm')"
:show-icon="false" :show-icon="false"
:title="$t('rename_key')" :title="$t('interface.rename_key')"
preset="dialog" preset="dialog"
transform-origin="center" transform-origin="center"
@positive-click="onRename" @positive-click="onRename"
@ -70,7 +70,7 @@ const onClose = () => {
:show-label="false" :show-label="false"
label-align="left" label-align="left"
label-placement="top"> label-placement="top">
<n-form-item :label="$t('new_key_name')" required> <n-form-item :label="$t('dialogue.key.new_name')" required>
<n-input v-model:value="renameForm.newKey" /> <n-input v-model:value="renameForm.newKey" />
</n-form-item> </n-form-item>
</n-form> </n-form>

View File

@ -69,21 +69,21 @@ const onConfirm = async () => {
:close-on-esc="false" :close-on-esc="false"
:mask-closable="false" :mask-closable="false"
:show-icon="false" :show-icon="false"
:title="$t('set_ttl')" :title="$t('dialogue.ttl.title')"
preset="dialog" preset="dialog"
transform-origin="center"> transform-origin="center">
<n-form :model="ttlForm" :show-require-mark="false" label-placement="top"> <n-form :model="ttlForm" :show-require-mark="false" label-placement="top">
<n-form-item :label="$t('key')"> <n-form-item :label="$t('common.key')">
<n-input :value="currentKey" readonly /> <n-input :value="currentKey" readonly />
</n-form-item> </n-form-item>
<n-form-item :label="$t('ttl')" required> <n-form-item :label="$t('interface.ttl')" required>
<n-input-number <n-input-number
v-model:value="ttlForm.ttl" v-model:value="ttlForm.ttl"
:max="Number.MAX_SAFE_INTEGER" :max="Number.MAX_SAFE_INTEGER"
:min="-1" :min="-1"
style="width: 100%"> style="width: 100%">
<template #suffix> <template #suffix>
{{ $t('second') }} {{ $t('common.second') }}
</template> </template>
</n-input-number> </n-input-number>
</n-form-item> </n-form-item>
@ -91,11 +91,11 @@ const onConfirm = async () => {
<template #action> <template #action>
<div class="flex-item-expand"> <div class="flex-item-expand">
<n-button :focusable="false" @click="ttlForm.ttl = -1">{{ $t('persist_key') }}</n-button> <n-button :focusable="false" @click="ttlForm.ttl = -1">{{ $t('dialogue.key.persist_key') }}</n-button>
</div> </div>
<div class="flex-item n-dialog__action"> <div class="flex-item n-dialog__action">
<n-button :focusable="false" @click="onClose">{{ $t('cancel') }}</n-button> <n-button :focusable="false" @click="onClose">{{ $t('common.cancel') }}</n-button>
<n-button type="primary" :focusable="false" @click="onConfirm">{{ $t('save') }}</n-button> <n-button type="primary" :focusable="false" @click="onConfirm">{{ $t('common.save') }}</n-button>
</div> </div>
</template> </template>
</n-modal> </n-modal>

View File

@ -16,11 +16,11 @@ const i18n = useI18n()
const updateOption = [ const updateOption = [
{ {
value: 0, value: 0,
label: i18n.t('overwrite_field'), label: i18n.t('dialogue.field.overwrite_field'),
}, },
{ {
value: 1, value: 1,
label: i18n.t('ignore_field'), label: i18n.t('dialogue.field.ignore_field'),
}, },
] ]
@ -45,16 +45,16 @@ const onUpdate = (val) => {
</script> </script>
<template> <template>
<n-form-item :label="$t('type')"> <n-form-item :label="$t('interface.type')">
<n-radio-group :value="props.type" @update:value="(val) => emit('update:type', val)"> <n-radio-group :value="props.type" @update:value="(val) => emit('update:type', val)">
<n-radio-button v-for="(op, i) in updateOption" :key="i" :label="op.label" :value="op.value" /> <n-radio-button v-for="(op, i) in updateOption" :key="i" :label="op.label" :value="op.value" />
</n-radio-group> </n-radio-group>
</n-form-item> </n-form-item>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input <n-dynamic-input
v-model:value="kvList" v-model:value="kvList"
:key-placeholder="$t('enter_field')" :key-placeholder="$t('dialogue.field.enter_field')"
:value-placeholder="$t('enter_value')" :value-placeholder="$t('dialogue.field.enter_value')"
preset="pair" preset="pair"
@update:value="onUpdate"> @update:value="onUpdate">
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">

View File

@ -16,11 +16,11 @@ const i18n = useI18n()
const insertOption = [ const insertOption = [
{ {
value: 0, value: 0,
label: i18n.t('append_item'), label: i18n.t('dialogue.field.append_item'),
}, },
{ {
value: 1, value: 1,
label: i18n.t('prepend_item'), label: i18n.t('dialogue.field.prepend_item'),
}, },
] ]
@ -32,13 +32,13 @@ const onUpdate = (val) => {
</script> </script>
<template> <template>
<n-form-item :label="$t('type')"> <n-form-item :label="$t('interface.type')">
<n-radio-group :value="props.type" @update:value="(val) => emit('update:type', val)"> <n-radio-group :value="props.type" @update:value="(val) => emit('update:type', val)">
<n-radio-button v-for="(op, i) in insertOption" :key="i" :label="op.label" :value="op.value" /> <n-radio-button v-for="(op, i) in insertOption" :key="i" :label="op.label" :value="op.value" />
</n-radio-group> </n-radio-group>
</n-form-item> </n-form-item>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input v-model:value="list" :placeholder="$t('enter_elem')" @update:value="onUpdate"> <n-dynamic-input v-model:value="list" :placeholder="$t('dialogue.field.enter_elem')" @update:value="onUpdate">
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">
<icon-button v-if="list.length > 1" :icon="Delete" size="18" @click="() => remove(index)" /> <icon-button v-if="list.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button :icon="Add" size="18" @click="() => create(index)" /> <icon-button :icon="Add" size="18" @click="() => create(index)" />

View File

@ -19,11 +19,11 @@ const i18n = useI18n()
const updateOption = [ const updateOption = [
{ {
value: 0, value: 0,
label: i18n.t('overwrite_field'), label: i18n.t('dialogue.field.overwrite_field'),
}, },
{ {
value: 1, value: 1,
label: i18n.t('ignore_field'), label: i18n.t('dialogue.field.ignore_field'),
}, },
] ]
@ -53,20 +53,23 @@ const onUpdate = () => {
</script> </script>
<template> <template>
<n-form-item :label="$t('type')"> <n-form-item :label="$t('interface.type')">
<n-radio-group :value="props.type" @update:value="(val) => emit('update:type', val)"> <n-radio-group :value="props.type" @update:value="(val) => emit('update:type', val)">
<n-radio-button v-for="(op, i) in updateOption" :key="i" :label="op.label" :value="op.value" /> <n-radio-button v-for="(op, i) in updateOption" :key="i" :label="op.label" :value="op.value" />
</n-radio-group> </n-radio-group>
</n-form-item> </n-form-item>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input v-model:value="zset" @create="onCreate" @update:value="onUpdate"> <n-dynamic-input v-model:value="zset" @create="onCreate" @update:value="onUpdate">
<template #default="{ value }"> <template #default="{ value }">
<n-input <n-input
v-model:value="value.value" v-model:value="value.value"
:placeholder="$t('enter_elem')" :placeholder="$t('dialogue.field.enter_elem')"
type="text" type="text"
@update:value="onUpdate" /> @update:value="onUpdate" />
<n-input-number v-model:value="value.score" :placeholder="$t('enter_score')" @update:value="onUpdate" /> <n-input-number
v-model:value="value.score"
:placeholder="$t('dialogue.field.enter_score')"
@update:value="onUpdate" />
</template> </template>
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">
<icon-button v-if="zset.length > 1" :icon="Delete" size="18" @click="() => remove(index)" /> <icon-button v-if="zset.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />

View File

@ -37,11 +37,11 @@ defineExpose({
</script> </script>
<template> <template>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input <n-dynamic-input
v-model:value="kvList" v-model:value="kvList"
:key-placeholder="$t('enter_field')" :key-placeholder="$t('dialogue.field.enter_field')"
:value-placeholder="$t('enter_value')" :value-placeholder="$t('dialogue.field.enter_value')"
preset="pair" preset="pair"
@update:value="onUpdate"> @update:value="onUpdate">
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">

View File

@ -24,8 +24,8 @@ defineExpose({
</script> </script>
<template> <template>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input v-model:value="list" :placeholder="$t('enter_elem')" @update:value="onUpdate"> <n-dynamic-input v-model:value="list" :placeholder="$t('dialogue.field.enter_elem')" @update:value="onUpdate">
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">
<icon-button v-if="list.length > 1" :icon="Delete" size="18" @click="() => remove(index)" /> <icon-button v-if="list.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button :icon="Add" size="18" @click="() => create(index)" /> <icon-button :icon="Add" size="18" @click="() => create(index)" />

View File

@ -24,8 +24,8 @@ defineExpose({
</script> </script>
<template> <template>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input v-model:value="set" :placeholder="$t('enter_elem')" @update:value="onUpdate"> <n-dynamic-input v-model:value="set" :placeholder="$t('dialogue.field.enter_elem')" @update:value="onUpdate">
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">
<icon-button v-if="set.length > 1" :icon="Delete" size="18" @click="() => remove(index)" /> <icon-button v-if="set.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />
<icon-button :icon="Add" size="18" @click="() => create(index)" /> <icon-button :icon="Add" size="18" @click="() => create(index)" />

View File

@ -43,11 +43,11 @@ defineExpose({
<n-form-item label="ID"> <n-form-item label="ID">
<n-input v-model:value="id" /> <n-input v-model:value="id" />
</n-form-item> </n-form-item>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input <n-dynamic-input
v-model:value="kvList" v-model:value="kvList"
:key-placeholder="$t('enter_field')" :key-placeholder="$t('dialogue.field.enter_field')"
:value-placeholder="$t('enter_value')" :value-placeholder="$t('dialogue.field.enter_value')"
preset="pair" preset="pair"
@update:value="onUpdate"> @update:value="onUpdate">
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">

View File

@ -7,7 +7,7 @@ const emit = defineEmits(['update:value'])
</script> </script>
<template> <template>
<n-form-item :label="$t('value')"> <n-form-item :label="$t('common.value')">
<n-input <n-input
:rows="6" :rows="6"
:value="props.value" :value="props.value"

View File

@ -41,15 +41,18 @@ defineExpose({
</script> </script>
<template> <template>
<n-form-item :label="$t('element')" required> <n-form-item :label="$t('dialogue.field.element')" required>
<n-dynamic-input v-model:value="zset" @create="onCreate" @update:value="onUpdate"> <n-dynamic-input v-model:value="zset" @create="onCreate" @update:value="onUpdate">
<template #default="{ value }"> <template #default="{ value }">
<n-input <n-input
v-model:value="value.value" v-model:value="value.value"
:placeholder="$t('enter_member')" :placeholder="$t('dialogue.field.enter_member')"
type="text" type="text"
@update:value="onUpdate" /> @update:value="onUpdate" />
<n-input-number v-model:value="value.score" :placeholder="$t('enter_score')" @update:value="onUpdate" /> <n-input-number
v-model:value="value.score"
:placeholder="$t('dialogue.field.enter_score')"
@update:value="onUpdate" />
</template> </template>
<template #action="{ index, create, remove, move }"> <template #action="{ index, create, remove, move }">
<icon-button v-if="zset.length > 1" :icon="Delete" size="18" @click="() => remove(index)" /> <icon-button v-if="zset.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />

View File

@ -56,7 +56,7 @@ const filterTypeOptions = computed(() => {
})) }))
options.splice(0, 0, { options.splice(0, 0, {
value: '', value: '',
label: i18n.t('all'), label: i18n.t('common.all'),
}) })
return options return options
}) })
@ -83,10 +83,15 @@ const filterTypeOptions = computed(() => {
</div> </div>
<!-- bottom function bar --> <!-- bottom function bar -->
<div class="nav-pane-bottom flex-box-h"> <div class="nav-pane-bottom flex-box-h">
<icon-button :icon="Status" size="20" stroke-width="4" t-tooltip="status" @click="onInfo" /> <icon-button :icon="Status" size="20" stroke-width="4" t-tooltip="interface.status" @click="onInfo" />
<icon-button :icon="Refresh" size="20" stroke-width="4" t-tooltip="reload" @click="onRefresh" /> <icon-button :icon="Refresh" size="20" stroke-width="4" t-tooltip="interface.reload" @click="onRefresh" />
<div class="flex-item-expand"></div> <div class="flex-item-expand"></div>
<icon-button :icon="Unlink" size="20" stroke-width="4" t-tooltip="disconnect" @click="onDisconnect" /> <icon-button
:icon="Unlink"
size="20"
stroke-width="4"
t-tooltip="interface.disconnect"
@click="onDisconnect" />
</div> </div>
</div> </div>
</template> </template>

View File

@ -88,12 +88,12 @@ const menuOptions = {
return [ return [
{ {
key: 'server_reload', key: 'server_reload',
label: i18n.t('reload'), label: i18n.t('interface.reload'),
icon: renderIcon(Refresh), icon: renderIcon(Refresh),
}, },
{ {
key: 'server_close', key: 'server_close',
label: i18n.t('disconnect'), label: i18n.t('interface.disconnect'),
icon: renderIcon(Unlink), icon: renderIcon(Unlink),
}, },
] ]
@ -103,17 +103,17 @@ const menuOptions = {
return [ return [
{ {
key: 'db_reload', key: 'db_reload',
label: i18n.t('reload'), label: i18n.t('interface.reload'),
icon: renderIcon(Refresh), icon: renderIcon(Refresh),
}, },
{ {
key: 'db_newkey', key: 'db_newkey',
label: i18n.t('new_key'), label: i18n.t('interface.new_key'),
icon: renderIcon(Add), icon: renderIcon(Add),
}, },
{ {
key: 'db_filter', key: 'db_filter',
label: i18n.t('filter_key'), label: i18n.t('interface.filter_key'),
icon: renderIcon(Filter), icon: renderIcon(Filter),
}, },
{ {
@ -122,7 +122,7 @@ const menuOptions = {
}, },
{ {
key: 'key_remove', key: 'key_remove',
label: i18n.t('batch_delete'), label: i18n.t('interface.batch_delete'),
icon: renderIcon(Delete), icon: renderIcon(Delete),
}, },
{ {
@ -131,7 +131,7 @@ const menuOptions = {
}, },
{ {
key: 'db_close', key: 'db_close',
label: i18n.t('close_db'), label: i18n.t('interface.close_db'),
icon: renderIcon(Close), icon: renderIcon(Close),
}, },
] ]
@ -139,7 +139,7 @@ const menuOptions = {
return [ return [
{ {
key: 'db_open', key: 'db_open',
label: i18n.t('open_db'), label: i18n.t('interface.open_db'),
icon: renderIcon(Connect), icon: renderIcon(Connect),
}, },
] ]
@ -148,17 +148,17 @@ const menuOptions = {
[ConnectionType.RedisKey]: () => [ [ConnectionType.RedisKey]: () => [
{ {
key: 'key_reload', key: 'key_reload',
label: i18n.t('reload'), label: i18n.t('interface.reload'),
icon: renderIcon(Refresh), icon: renderIcon(Refresh),
}, },
{ {
key: 'key_newkey', key: 'key_newkey',
label: i18n.t('new_key'), label: i18n.t('interface.new_key'),
icon: renderIcon(Add), icon: renderIcon(Add),
}, },
{ {
key: 'key_copy', key: 'key_copy',
label: i18n.t('copy_path'), label: i18n.t('interface.copy_path'),
icon: renderIcon(CopyLink), icon: renderIcon(CopyLink),
}, },
{ {
@ -167,19 +167,19 @@ const menuOptions = {
}, },
{ {
key: 'key_remove', key: 'key_remove',
label: i18n.t('batch_delete'), label: i18n.t('interface.batch_delete'),
icon: renderIcon(Delete), icon: renderIcon(Delete),
}, },
], ],
[ConnectionType.RedisValue]: () => [ [ConnectionType.RedisValue]: () => [
{ {
key: 'value_reload', key: 'value_reload',
label: i18n.t('reload'), label: i18n.t('interface.reload'),
icon: renderIcon(Refresh), icon: renderIcon(Refresh),
}, },
{ {
key: 'value_copy', key: 'value_copy',
label: i18n.t('copy_key'), label: i18n.t('interface.copy_key'),
icon: renderIcon(CopyLink), icon: renderIcon(CopyLink),
}, },
{ {
@ -188,7 +188,7 @@ const menuOptions = {
}, },
{ {
key: 'value_remove', key: 'value_remove',
label: i18n.t('remove_key'), label: i18n.t('interface.remove_key'),
icon: renderIcon(Delete), icon: renderIcon(Delete),
}, },
], ],
@ -233,7 +233,7 @@ const handleSelectContextMenu = (key) => {
expandedKeys.value = [props.server] expandedKeys.value = [props.server]
tabStore.setSelectedKeys(props.server) tabStore.setSelectedKeys(props.server)
connectionStore.openConnection(props.server, true).then(() => { connectionStore.openConnection(props.server, true).then(() => {
$message.success(i18n.t('reload_succ')) $message.success(i18n.t('dialogue.reload_succ'))
}) })
break break
case 'server_close': case 'server_close':
@ -267,10 +267,10 @@ const handleSelectContextMenu = (key) => {
dialogStore.openDeleteKeyDialog(props.server, db, isEmpty(redisKey) ? '*' : redisKey + ':*') dialogStore.openDeleteKeyDialog(props.server, db, isEmpty(redisKey) ? '*' : redisKey + ':*')
break break
case 'value_remove': case 'value_remove':
$dialog.warning(i18n.t('remove_tip', { name: redisKey }), () => { $dialog.warning(i18n.t('dialogue.remove_tip', { name: redisKey }), () => {
connectionStore.deleteKey(props.server, db, redisKey).then((success) => { connectionStore.deleteKey(props.server, db, redisKey).then((success) => {
if (success) { if (success) {
$message.success(i18n.t('delete_key_succ', { key: redisKey })) $message.success(i18n.t('dialogue.delete_key_succ', { key: redisKey }))
} }
}) })
}) })
@ -280,7 +280,7 @@ const handleSelectContextMenu = (key) => {
ClipboardSetText(redisKey) ClipboardSetText(redisKey)
.then((succ) => { .then((succ) => {
if (succ) { if (succ) {
$message.success(i18n.t('copy_succ')) $message.success(i18n.t('dialogue.copy_succ'))
} }
}) })
.catch((e) => { .catch((e) => {
@ -451,22 +451,22 @@ const getDatabaseMenu = (opened) => {
if (opened) { if (opened) {
btns.push( btns.push(
h(IconButton, { h(IconButton, {
tTooltip: 'filter_key', tTooltip: 'interface.filter_key',
icon: Filter, icon: Filter,
onClick: () => handleSelectContextMenu('db_filter'), onClick: () => handleSelectContextMenu('db_filter'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'reload', tTooltip: 'interface.reload',
icon: Refresh, icon: Refresh,
onClick: () => handleSelectContextMenu('db_reload'), onClick: () => handleSelectContextMenu('db_reload'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'new_key', tTooltip: 'interface.new_key',
icon: Add, icon: Add,
onClick: () => handleSelectContextMenu('db_newkey'), onClick: () => handleSelectContextMenu('db_newkey'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'batch_delete', tTooltip: 'interface.batch_delete',
icon: Delete, icon: Delete,
onClick: () => handleSelectContextMenu('key_remove'), onClick: () => handleSelectContextMenu('key_remove'),
}), }),
@ -474,7 +474,7 @@ const getDatabaseMenu = (opened) => {
} else { } else {
btns.push( btns.push(
h(IconButton, { h(IconButton, {
tTooltip: 'open_db', tTooltip: 'interface.open_db',
icon: Connect, icon: Connect,
onClick: () => handleSelectContextMenu('db_open'), onClick: () => handleSelectContextMenu('db_open'),
}), }),
@ -486,17 +486,17 @@ const getDatabaseMenu = (opened) => {
const getLayerMenu = () => { const getLayerMenu = () => {
return [ return [
h(IconButton, { h(IconButton, {
tTooltip: 'reload', tTooltip: 'interface.reload',
icon: Refresh, icon: Refresh,
onClick: () => handleSelectContextMenu('key_reload'), onClick: () => handleSelectContextMenu('key_reload'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'new_key', tTooltip: 'interface.new_key',
icon: Add, icon: Add,
onClick: () => handleSelectContextMenu('key_newkey'), onClick: () => handleSelectContextMenu('key_newkey'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'batch_delete', tTooltip: 'interface.batch_delete',
icon: Delete, icon: Delete,
onClick: () => handleSelectContextMenu('key_remove'), onClick: () => handleSelectContextMenu('key_remove'),
}), }),
@ -506,7 +506,7 @@ const getLayerMenu = () => {
const getValueMenu = () => { const getValueMenu = () => {
return [ return [
h(IconButton, { h(IconButton, {
tTooltip: 'remove_key', tTooltip: 'interface.remove_key',
icon: Delete, icon: Delete,
onClick: () => handleSelectContextMenu('value_remove'), onClick: () => handleSelectContextMenu('value_remove'),
}), }),

View File

@ -25,15 +25,15 @@ const filterPattern = ref('')
:icon="AddLink" :icon="AddLink"
size="20" size="20"
stroke-width="4" stroke-width="4"
t-tooltip="new_conn" t-tooltip="interface.new_conn"
@click="dialogStore.openNewDialog()" /> @click="dialogStore.openNewDialog()" />
<icon-button <icon-button
:icon="AddGroup" :icon="AddGroup"
size="20" size="20"
stroke-width="4" stroke-width="4"
t-tooltip="new_group" t-tooltip="interface.new_group"
@click="dialogStore.openNewGroupDialog()" /> @click="dialogStore.openNewGroupDialog()" />
<n-input v-model:value="filterPattern" :placeholder="$t('filter')" clearable> <n-input v-model:value="filterPattern" :placeholder="$t('interface.filter')" clearable>
<template #prefix> <template #prefix>
<n-icon :component="Filter" size="20" /> <n-icon :component="Filter" size="20" />
</template> </template>

View File

@ -55,12 +55,12 @@ const menuOptions = {
[ConnectionType.Group]: ({ opened }) => [ [ConnectionType.Group]: ({ opened }) => [
{ {
key: 'group_rename', key: 'group_rename',
label: i18n.t('rename_conn_group'), label: i18n.t('interface.rename_conn_group'),
icon: renderIcon(Edit), icon: renderIcon(Edit),
}, },
{ {
key: 'group_delete', key: 'group_delete',
label: i18n.t('remove_conn_group'), label: i18n.t('interface.remove_conn_group'),
icon: renderIcon(Delete), icon: renderIcon(Delete),
}, },
], ],
@ -70,17 +70,17 @@ const menuOptions = {
return [ return [
{ {
key: 'server_close', key: 'server_close',
label: i18n.t('disconnect'), label: i18n.t('interface.disconnect'),
icon: renderIcon(Unlink), icon: renderIcon(Unlink),
}, },
{ {
key: 'server_dup', key: 'server_dup',
label: i18n.t('dup_conn'), label: i18n.t('interface.dup_conn'),
icon: renderIcon(CopyLink), icon: renderIcon(CopyLink),
}, },
{ {
key: 'server_edit', key: 'server_edit',
label: i18n.t('edit_conn'), label: i18n.t('interface.edit_conn'),
icon: renderIcon(Config), icon: renderIcon(Config),
}, },
{ {
@ -89,7 +89,7 @@ const menuOptions = {
}, },
{ {
key: 'server_remove', key: 'server_remove',
label: i18n.t('remove_conn'), label: i18n.t('interface.remove_conn'),
icon: renderIcon(Delete), icon: renderIcon(Delete),
}, },
] ]
@ -97,12 +97,12 @@ const menuOptions = {
return [ return [
{ {
key: 'server_open', key: 'server_open',
label: i18n.t('open_connection'), label: i18n.t('interface.open_connection'),
icon: renderIcon(Connect), icon: renderIcon(Connect),
}, },
{ {
key: 'server_edit', key: 'server_edit',
label: i18n.t('edit_conn'), label: i18n.t('interface.edit_conn'),
icon: renderIcon(Config), icon: renderIcon(Config),
}, },
{ {
@ -111,7 +111,7 @@ const menuOptions = {
}, },
{ {
key: 'server_remove', key: 'server_remove',
label: i18n.t('remove_conn'), label: i18n.t('interface.remove_conn'),
icon: renderIcon(Delete), icon: renderIcon(Delete),
}, },
] ]
@ -207,12 +207,12 @@ const getServerMenu = (connected) => {
if (connected) { if (connected) {
btns.push( btns.push(
h(IconButton, { h(IconButton, {
tTooltip: 'disconnect', tTooltip: 'interface.disconnect',
icon: Unlink, icon: Unlink,
onClick: () => handleSelectContextMenu('server_close'), onClick: () => handleSelectContextMenu('server_close'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'edit_conn', tTooltip: 'interface.edit_conn',
icon: Config, icon: Config,
onClick: () => handleSelectContextMenu('server_edit'), onClick: () => handleSelectContextMenu('server_edit'),
}), }),
@ -220,17 +220,17 @@ const getServerMenu = (connected) => {
} else { } else {
btns.push( btns.push(
h(IconButton, { h(IconButton, {
tTooltip: 'open_connection', tTooltip: 'interface.open_connection',
icon: Connect, icon: Connect,
onClick: () => handleSelectContextMenu('server_open'), onClick: () => handleSelectContextMenu('server_open'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'edit_conn', tTooltip: 'interface.edit_conn',
icon: Config, icon: Config,
onClick: () => handleSelectContextMenu('server_edit'), onClick: () => handleSelectContextMenu('server_edit'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'remove_conn', tTooltip: 'interface.remove_conn',
icon: Delete, icon: Delete,
onClick: () => handleSelectContextMenu('server_remove'), onClick: () => handleSelectContextMenu('server_remove'),
}), }),
@ -242,12 +242,12 @@ const getServerMenu = (connected) => {
const getGroupMenu = () => { const getGroupMenu = () => {
return [ return [
h(IconButton, { h(IconButton, {
tTooltip: 'edit_conn', tTooltip: 'interface.edit_conn',
icon: Config, icon: Config,
onClick: () => handleSelectContextMenu('group_rename'), onClick: () => handleSelectContextMenu('group_rename'),
}), }),
h(IconButton, { h(IconButton, {
tTooltip: 'remove_conn', tTooltip: 'interface.remove_conn',
icon: Delete, icon: Delete,
onClick: () => handleSelectContextMenu('group_delete'), onClick: () => handleSelectContextMenu('group_delete'),
}), }),
@ -298,17 +298,20 @@ const openConnection = async (name) => {
} }
const removeConnection = (name) => { const removeConnection = (name) => {
$dialog.warning(i18n.t('remove_tip', { type: i18n.t('conn_name'), name }), async () => { $dialog.warning(
i18n.t('dialogue.remove_tip', { type: i18n.t('dialogue.connection.conn_name'), name }),
async () => {
connectionStore.deleteConnection(name).then(({ success, msg }) => { connectionStore.deleteConnection(name).then(({ success, msg }) => {
if (!success) { if (!success) {
$message.error(msg) $message.error(msg)
} }
}) })
}) },
)
} }
const removeGroup = async (name) => { const removeGroup = async (name) => {
$dialog.warning(i18n.t('remove_group_tip', { name }), async () => { $dialog.warning(i18n.t('dialogue.remove_group_tip', { name }), async () => {
connectionStore.deleteGroup(name).then(({ success, msg }) => { connectionStore.deleteGroup(name).then(({ success, msg }) => {
if (!success) { if (!success) {
$message.error(msg) $message.error(msg)
@ -376,7 +379,7 @@ const handleSelectContextMenu = (key) => {
case 'server_edit': case 'server_edit':
// ask for close relevant connections before edit // ask for close relevant connections before edit
if (connectionStore.isConnected(name)) { if (connectionStore.isConnected(name)) {
$dialog.warning(i18n.t('edit_close_confirm'), () => { $dialog.warning(i18n.t('dialogue.edit_close_confirm'), () => {
connectionStore.closeConnection(name) connectionStore.closeConnection(name)
dialogStore.openEditDialog(name) dialogStore.openEditDialog(name)
}) })
@ -390,7 +393,7 @@ const handleSelectContextMenu = (key) => {
case 'server_close': case 'server_close':
connectionStore.closeConnection(name).then((closed) => { connectionStore.closeConnection(name).then((closed) => {
if (closed) { if (closed) {
$message.success(i18n.t('handle_succ')) $message.success(i18n.t('dialogue.handle_succ'))
} }
}) })
break break
@ -459,7 +462,10 @@ const handleDrop = ({ node, dragNode, dropPosition }) => {
</script> </script>
<template> <template>
<n-empty v-if="isEmpty(connectionStore.connections)" :description="$t('empty_server_list')" class="empty-content" /> <n-empty
v-if="isEmpty(connectionStore.connections)"
:description="$t('interface.empty_server_list')"
class="empty-content" />
<n-tree <n-tree
v-else v-else
:animated="false" :animated="false"
@ -491,7 +497,7 @@ const handleDrop = ({ node, dragNode, dropPosition }) => {
style="width: 400px"> style="width: 400px">
<n-spin> <n-spin>
<template #description> <template #description>
{{ $t('opening_connection') }} {{ $t('dialogue.opening_connection') }}
</template> </template>
</n-spin> </n-spin>
</n-card> </n-card>

View File

@ -39,18 +39,18 @@ const i18n = useI18n()
const menuOptions = computed(() => { const menuOptions = computed(() => {
return [ return [
{ {
label: i18n.t('browser'), label: i18n.t('ribbon.browser'),
key: 'browser', key: 'browser',
icon: renderIcon(ToggleDb), icon: renderIcon(ToggleDb),
show: connectionStore.anyConnectionOpened, show: connectionStore.anyConnectionOpened,
}, },
{ {
label: i18n.t('server'), label: i18n.t('ribbon.server'),
key: 'server', key: 'server',
icon: renderIcon(ToggleServer), icon: renderIcon(ToggleServer),
}, },
{ {
label: i18n.t('log'), label: i18n.t('ribbon.log'),
key: 'log', key: 'log',
icon: renderIcon(Record), icon: renderIcon(Record),
}, },
@ -60,17 +60,17 @@ const menuOptions = computed(() => {
const preferencesOptions = computed(() => { const preferencesOptions = computed(() => {
return [ return [
{ {
label: i18n.t('preferences'), label: i18n.t('menu.preferences'),
key: 'preferences', key: 'preferences',
icon: renderIcon(Config), icon: renderIcon(Config),
}, },
// {
// label: i18n.t('menu.help'),
// key: 'help',
// icon: renderIcon(Help),
// },
{ {
label: i18n.t('help'), label: i18n.t('menu.check_update'),
key: 'help',
icon: renderIcon(Help),
},
{
label: i18n.t('check_update'),
key: 'update', key: 'update',
}, },
] ]

View File

@ -1,6 +1,6 @@
{ {
"name": "English", "name": "English",
"system_lang": "Use System Language", "common": {
"confirm": "Confirm", "confirm": "Confirm",
"cancel": "Cancel", "cancel": "Cancel",
"success": "Success", "success": "Success",
@ -8,30 +8,61 @@
"error": "Error", "error": "Error",
"save": "Save", "save": "Save",
"none": "None", "none": "None",
"second": "Second(s)",
"unit_day": "D",
"unit_hour": "H",
"unit_minute": "M",
"all": "All",
"key": "Key",
"value": "Value",
"field": "Field"
},
"preferences": {
"name": "Preferences",
"restore_defaults": "Restore Defaults",
"general": {
"name": "General",
"theme": "Theme",
"theme_light": "Light",
"theme_dark": "Dark",
"theme_auto": "Auto",
"language": "Language",
"system_lang": "Use System Language",
"default": "Default", "default": "Default",
"font": "Font",
"font_size": "Font Size",
"proxy": "Proxy",
"use_system_proxy": "Use system proxy",
"use_system_proxy_http": "Use system proxy only for HTTP(S) request",
"update": "Update",
"auto_check_update": "Automatically check for updates"
},
"editor": {
"name": "Editor"
}
},
"interface": {
"new_conn": "Add New Connection", "new_conn": "Add New Connection",
"new_group": "Add New Group", "new_group": "Add New Group",
"rename_group": "Rename Group",
"disconnect_all": "Disconnect all", "disconnect_all": "Disconnect all",
"status": "Status", "status": "Status",
"filter": "Filter", "filter": "Filter",
"sort_conn": "Sort Connections", "sort_conn": "Sort Connections",
"close_confirm": "Confirm close this tab and connection", "open_db": "Open Database",
"edit_close_confirm": "Please close the relevant connections before editing. Do you want to continue?", "close_db": "Close Database",
"opening_connection": "Opening Connection...", "filter_key": "Filter Key",
"remove_tip": "{type} \"{name}\" will be deleted", "disconnect": "Disconnect",
"remove_group_tip": "Group \"{name}\" and all connections in it will be deleted", "dup_conn": "Duplicate Connection",
"remove_conn": "Delete Connection",
"edit_conn": "Edit Connection Config",
"edit_conn_group": "Edit Connection Group",
"rename_conn_group": "Rename Connection Group",
"remove_conn_group": "Delete Connection Group",
"ttl": "TTL", "ttl": "TTL",
"forever": "Forever", "forever": "Forever",
"rename_key": "Rename Key", "rename_key": "Rename Key",
"delete_key": "Delete Key", "delete_key": "Delete Key",
"batch_delete_key": "Batch Delete Keys", "batch_delete_key": "Batch Delete Keys",
"db_index": "Database Index",
"key_expression": "Key Expression",
"affected_key": "Affected Keys",
"show_affected_key": "Show Affected Keys",
"confirm_delete_key": "Confirm Delete {num} Keys",
"delete_key_succ": "\"{key}\" has been deleted",
"copy_value": "Copy Value", "copy_value": "Copy Value",
"edit_value": "Edit Value", "edit_value": "Edit Value",
"save_update": "Save Update", "save_update": "Save Update",
@ -45,53 +76,84 @@
"view_as": "View As", "view_as": "View As",
"reload": "Reload", "reload": "Reload",
"open_connection": "Open Connection", "open_connection": "Open Connection",
"open_db": "Open Database",
"close_db": "Close Database",
"filter_key": "Filter Key",
"disconnect": "Disconnect",
"dup_conn": "Duplicate Connection",
"remove_conn": "Delete Connection",
"edit_conn": "Edit Connection Config",
"edit_conn_group": "Edit Connection Group",
"rename_conn_group": "Rename Connection Group",
"remove_conn_group": "Delete Connection Group",
"no_group": "No Group",
"copy_path": "Copy Path",
"batch_delete": "Batch Delete", "batch_delete": "Batch Delete",
"copy_path": "Copy Path",
"copy_key": "Copy Key", "copy_key": "Copy Key",
"remove_key": "Remove Key", "remove_key": "Remove Key",
"new_conn_title": "New Connection", "new_key": "Add New Key",
"edit_conn_title": "Edit Connection", "nonexist_tab_content": "Selected key does not exist. Please retry",
"empty_server_content": "Select and open a connection from the left",
"empty_server_list": "No redis server",
"action": "Action",
"type": "Type",
"score": "Score"
},
"ribbon": {
"server": "Server",
"browser": "Browser",
"log": "Log"
},
"dialogue": {
"close_confirm": "Confirm close this tab and connection",
"edit_close_confirm": "Please close the relevant connections before editing. Do you want to continue?",
"opening_connection": "Opening Connection...",
"remove_tip": "{type} \"{name}\" will be deleted",
"remove_group_tip": "Group \"{name}\" and all connections in it will be deleted",
"delete_key_succ": "\"{key}\" has been deleted",
"save_value_succ": "Value Saved !",
"copy_succ": "Value Copied !",
"handle_succ": "Success!",
"reload_succ": "Reloaded!",
"field_required": "This item should not be blank",
"spec_field_required": "\"{key}\" should not be blank",
"illegal_characters": "Include illegal characters",
"connection": {
"new_title": "New Connection",
"edit_title": "Edit Connection",
"general": "General", "general": "General",
"advanced": "Advanced", "advanced": "Advanced",
"editor": "Editor", "no_group": "No Group",
"conn_group": "Group", "group": "Group",
"group_name": "Group Name",
"conn_name": "Name", "conn_name": "Name",
"conn_addr": "Address", "addr": "Address",
"conn_usr": "Username", "usr": "Username",
"conn_pwd": "Password", "pwd": "Password",
"conn_name_tip": "Connection name", "name_tip": "Connection name",
"conn_addr_tip": "Redis server host", "addr_tip": "Redis server host",
"conn_usr_tip": "(Optional) Redis server username", "usr_tip": "(Optional) Redis server username",
"conn_pwd_tip": "(Optional) Redis server authentication password (Redis > 6.0)", "pwd_tip": "(Optional) Redis server authentication password (Redis > 6.0)",
"conn_test": "Test Connection", "test": "Test Connection",
"conn_test_succ": "Successful connection to redis-server", "test_succ": "Successful connection to redis-server",
"conn_test_fail": "Fail Connection", "test_fail": "Fail Connection",
"conn_advn_filter": "Default Filter", "advn_filter": "Default Filter",
"conn_advn_filter_tip": "Pattern which defines loaded keys from redis server", "advn_filter_tip": "Pattern which defines loaded keys from redis server",
"conn_advn_separator": "Key Separator", "advn_separator": "Key Separator",
"conn_advn_separator_tip": "Separator used for key path item", "advn_separator_tip": "Separator used for key path item",
"conn_advn_conn_timeout": "Connection Timeout", "advn_conn_timeout": "Connection Timeout",
"conn_advn_exec_timeout": "Execution Timeout", "advn_exec_timeout": "Execution Timeout",
"conn_advn_mark_color": "Mark Color", "advn_mark_color": "Mark Color"
"second": "Second(s)", },
"new_key_name": "New Key Name", "group": {
"new_key": "Add New Key", "name": "Group Name",
"new_field": "Add New Field", "rename": "Rename Group",
"new": "New Group"
},
"key": {
"new": "New Key",
"new_name": "New Key Name",
"persist_key": "Persist Key",
"server": "Belong",
"db_index": "Database Index",
"key_expression": "Key Expression",
"affected_key": "Affected Keys",
"show_affected_key": "Show Affected Keys",
"confirm_delete_key": "Confirm Delete {num} Keys"
},
"field": {
"new": "Add New Field",
"new_item": "Add New Item",
"overwrite_field": "Overwrite Existing Field", "overwrite_field": "Overwrite Existing Field",
"ignore_field": "Ignore Existing Field", "ignore_field": "Ignore Existing Field",
"new_item": "Add New Item",
"insert_type": "Insert", "insert_type": "Insert",
"append_item": "Append", "append_item": "Append",
"prepend_item": "Prepend", "prepend_item": "Prepend",
@ -102,67 +164,45 @@
"enter_member": "Enter Member", "enter_member": "Enter Member",
"enter_score": "Enter Score", "enter_score": "Enter Score",
"element": "Element", "element": "Element",
"reload_when_succ": "Reload immediately after success"
},
"filter": {
"set_key_filter": "Set Key Filter", "set_key_filter": "Set Key Filter",
"filter_pattern": "Pattern", "filter_pattern": "Pattern",
"filter_pattern_tip": "prefix_*: Matches key names starting with \"prefix_\".\n*_suffix: Matches key names ending with \"_suffix\".\n*pattern*: Matches key names containing \"pattern\".\nprefix_??: Matches key names starting with \"prefix_\" followed by any two characters.\n*abc*: Matches key names containing \"abc\" at any position.", "filter_pattern_tip": "prefix_*: Matches key names starting with \"prefix_\".\n*_suffix: Matches key names ending with \"_suffix\".\n*pattern*: Matches key names containing \"pattern\".\nprefix_??: Matches key names starting with \"prefix_\" followed by any two characters.\n*abc*: Matches key names containing \"abc\" at any position."
"key": "Key", },
"value": "Value", "ttl": {
"field": "Field", "title": "Set Key TTL"
"action": "Action", },
"type": "Type", "upgrade": {
"score": "Score",
"order_no": "Order",
"preferences": "Preferences",
"theme": "Theme",
"theme_light": "Light",
"theme_dark": "Dark",
"theme_auto": "Auto",
"language": "Language",
"font": "Font",
"font_size": "Font Size",
"restore_defaults": "Restore Defaults",
"proxy": "Proxy",
"use_system_proxy": "Use system proxy",
"use_system_proxy_http": "Use system proxy only for HTTP(S) request",
"update": "Update",
"auto_check_update": "Automatically check for updates",
"set_ttl": "Set Key TTL",
"persist_key": "Persist Key",
"copy_succ": "Value Copied !",
"save_value_succ": "Value Saved !",
"handle_succ": "Success!",
"reload_succ": "Reloaded!",
"field_required": "This item should not be blank",
"spec_field_required": "\"{key}\" should not be blank",
"illegal_characters": "Include illegal characters",
"nonexist_tab_content": "Selected key does not exist. Please retry",
"empty_server_content": "Select and open a connection from the left",
"empty_server_list": "No redis server",
"reload_when_succ": "Reload immediately after success",
"server": "Server",
"browser": "Browser",
"log": "Log",
"help": "Help",
"check_update": "Check for Updates...",
"auto_refresh": "Auto Refresh",
"new_version_tip": "A new version is available. Download now?", "new_version_tip": "A new version is available. Download now?",
"no_update": "You're update to date", "no_update": "You're update to date"
"refresh": "Refresh", }
"uptime": "Uptime", },
"connected_clients": "Clients", "menu": {
"total_keys": "Keys", "preferences": "Preferences",
"memory_used": "Memory", "help": "Help",
"unit_day": "D", "check_update": "Check for Updates..."
"unit_hour": "H", },
"unit_minute": "M", "log": {
"all_info": "All Info",
"all": "All",
"launch_log": "Launch Log", "launch_log": "Launch Log",
"filter_server": "Filter Server", "filter_server": "Filter Server",
"filter_keyword": "Filter Keyword", "filter_keyword": "Filter Keyword",
"clean_log": "Clean Launch Log", "clean_log": "Clean Launch Log",
"confirm_clean_log": "Confirm clean launch log", "confirm_clean_log": "Confirm clean launch log",
"exec_time": "Exec Time", "exec_time": "Exec Time",
"server": "Server",
"cmd": "Command", "cmd": "Command",
"cost_time": "Cost" "cost_time": "Cost",
"refresh": "Refresh"
},
"status": {
"uptime": "Uptime",
"connected_clients": "Clients",
"total_keys": "Keys",
"memory_used": "Memory",
"all_info": "All Info",
"refresh": "Refresh",
"auto_refresh": "Auto Refresh"
}
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "简体中文", "name": "简体中文",
"system_lang": "使用系统语言", "common": {
"confirm": "确认", "confirm": "确认",
"cancel": "取消", "cancel": "取消",
"success": "成功", "success": "成功",
@ -8,30 +8,62 @@
"error": "错误", "error": "错误",
"save": "保存", "save": "保存",
"none": "无", "none": "无",
"second": "秒",
"unit_day": "天",
"unit_hour": "小时",
"unit_minute": "分钟",
"all": "全部",
"key": "键",
"value": "值",
"field": "字段"
},
"preferences": {
"name": "偏好设置",
"restore_defaults": "重置为默认",
"general": {
"name": "常规配置",
"theme": "主题",
"theme_light": "浅色",
"theme_dark": "深色",
"theme_auto": "自动",
"language": "语言",
"system_lang": "使用系统语言",
"default": "默认", "default": "默认",
"font": "字体",
"font_size": "字体尺寸",
"proxy": "代理",
"use_system_proxy": "使用系统代理",
"use_system_proxy_http": "仅在HTTP请求时使用系统代理",
"update": "更新",
"auto_check_update": "自动检查更新"
},
"editor": {
"name": "编辑器"
}
},
"interface": {
"new_conn": "添加新连接", "new_conn": "添加新连接",
"new_group": "添加新分组", "new_group": "添加新分组",
"rename_group": "重命名分组",
"disconnect_all": "断开所有连接", "disconnect_all": "断开所有连接",
"status": "状态", "status": "状态",
"filter": "筛选", "filter": "筛选",
"sort_conn": "调整连接顺序", "sort_conn": "调整连接顺序",
"close_confirm": "是否关闭当前连接", "new_conn_title": "新建连接",
"edit_close_confirm": "编辑前需要关闭相关连接,是否继续", "open_db": "打开数据库",
"opening_connection": "正在打开连接...", "close_db": "关闭数据库",
"remove_tip": "{type} \"{name}\" 将会被删除", "filter_key": "过滤键",
"remove_group_tip": "分组 \"{name}\"及其所有连接将会被删除", "disconnect": "断开连接",
"dup_conn": "复制连接",
"remove_conn": "删除连接",
"edit_conn": "编辑连接配置",
"edit_conn_group": "编辑连接分组",
"rename_conn_group": "重命名连接分组",
"remove_conn_group": "删除连接分组",
"ttl": "TTL", "ttl": "TTL",
"forever": "永久", "forever": "永久",
"rename_key": "重命名键", "rename_key": "重命名键",
"delete_key": "删除键", "delete_key": "删除键",
"batch_delete_key": "批量删除键", "batch_delete_key": "批量删除键",
"db_index": "数据库编号",
"key_expression": "键名表达式",
"affected_key": "受影响的键名",
"show_affected_key": "查看受影响的键名",
"confirm_delete_key": "确认删除{num}个键",
"delete_key_succ": "{key} 已被删除",
"copy_value": "复制值", "copy_value": "复制值",
"edit_value": "修改值", "edit_value": "修改值",
"save_update": "保存修改", "save_update": "保存修改",
@ -45,53 +77,84 @@
"view_as": "查看方式", "view_as": "查看方式",
"reload": "重新载入", "reload": "重新载入",
"open_connection": "打开连接", "open_connection": "打开连接",
"open_db": "打开数据库",
"close_db": "关闭数据库",
"filter_key": "过滤键",
"disconnect": "断开连接",
"dup_conn": "复制连接",
"remove_conn": "删除连接",
"edit_conn": "编辑连接配置",
"edit_conn_group": "编辑连接分组",
"rename_conn_group": "重命名连接分组",
"remove_conn_group": "删除连接分组",
"no_group": "无分组",
"copy_path": "复制路径",
"batch_delete": "批量删除键", "batch_delete": "批量删除键",
"copy_path": "复制路径",
"copy_key": "复制键名", "copy_key": "复制键名",
"remove_key": "删除键", "remove_key": "删除键",
"new_conn_title": "新建连接", "new_key": "添加新键",
"edit_conn_title": "编辑连接", "nonexist_tab_content": "所选键不存在,请尝试刷新重试",
"empty_server_content": "可以从左边选择并打开连接",
"empty_server_list": "还没添加Redis服务器",
"action": "操作",
"type": "类型",
"score": "分值"
},
"ribbon": {
"server": "服务器",
"browser": "浏览器",
"log": "日志"
},
"dialogue": {
"close_confirm": "是否关闭当前连接",
"edit_close_confirm": "编辑前需要关闭相关连接,是否继续",
"opening_connection": "正在打开连接...",
"remove_tip": "{type} \"{name}\" 将会被删除",
"remove_group_tip": "分组 \"{name}\"及其所有连接将会被删除",
"delete_key_succ": "{key} 已被删除",
"save_value_succ": "已保存值",
"copy_succ": "已复制到剪切板",
"handle_succ": "操作成功",
"reload_succ": "已重新载入",
"field_required": "此项不能为空",
"spec_field_required": "{key} 不能为空",
"illegal_characters": "包含非法字符",
"connection": {
"new_title": "新建连接",
"edit_title": "编辑连接",
"general": "常规配置", "general": "常规配置",
"advanced": "高级配置", "advanced": "高级配置",
"editor": "编辑器", "no_group": "无分组",
"conn_group": "分组", "group": "分组",
"group_name": "分组名",
"conn_name": "连接名", "conn_name": "连接名",
"conn_addr": "连接地址", "addr": "连接地址",
"conn_usr": "用户名", "usr": "用户名",
"conn_pwd": "密码", "pwd": "密码",
"conn_name_tip": "连接名", "name_tip": "连接名",
"conn_addr_tip": "Redis服务地址", "addr_tip": "Redis服务地址",
"conn_usr_tip": "(可选)Redis服务授权用户名", "usr_tip": "(可选)Redis服务授权用户名",
"conn_pwd_tip": "(可选)Redis服务授权密码 (Redis > 6.0)", "pwd_tip": "(可选)Redis服务授权密码 (Redis > 6.0)",
"conn_test": "测试连接", "test": "测试连接",
"conn_test_succ": "成功连接到Redis服务器", "test_succ": "成功连接到Redis服务器",
"conn_test_fail": "连接失败", "test_fail": "连接失败",
"conn_advn_filter": "默认过滤", "advn_filter": "默认过滤",
"conn_advn_filter_tip": "需要加载的键名表达式", "advn_filter_tip": "需要加载的键名表达式",
"conn_advn_separator": "键分隔符", "advn_separator": "键分隔符",
"conn_advn_separator_tip": "键名路径分隔符", "advn_separator_tip": "键名路径分隔符",
"conn_advn_conn_timeout": "连接超时", "advn_conn_timeout": "连接超时",
"conn_advn_exec_timeout": "执行超时", "advn_exec_timeout": "执行超时",
"conn_advn_mark_color": "标记颜色", "advn_mark_color": "标记颜色"
"second": "秒", },
"new_key_name": "新键名", "group": {
"new_key": "添加新键", "name": "分组名",
"new_field": "添加新字段", "rename": "重命名分组",
"new": "添加新分组"
},
"key": {
"new": "添加新键",
"new_name": "新键名",
"persist_key": "持久化键",
"server": "所属连接",
"db_index": "数据库编号",
"key_expression": "键名表达式",
"affected_key": "受影响的键名",
"show_affected_key": "查看受影响的键名",
"confirm_delete_key": "确认删除{num}个键"
},
"field": {
"new": "添加新字段",
"new_item": "添加新元素",
"overwrite_field": "覆盖同名字段", "overwrite_field": "覆盖同名字段",
"ignore_field": "忽略同名字段", "ignore_field": "忽略同名字段",
"new_item": "添加新元素",
"insert_type": "插入类型", "insert_type": "插入类型",
"append_item": "尾部追加", "append_item": "尾部追加",
"prepend_item": "插入头部", "prepend_item": "插入头部",
@ -102,67 +165,45 @@
"enter_member": "输入成员", "enter_member": "输入成员",
"enter_score": "输入分值", "enter_score": "输入分值",
"element": "元素", "element": "元素",
"reload_when_succ": "操作成功后立即重新加载"
},
"filter": {
"set_key_filter": "设置键过滤器", "set_key_filter": "设置键过滤器",
"filter_pattern": "过滤表达式", "filter_pattern": "过滤表达式",
"filter_pattern_tip": "prefix_*:匹配以\"prefix_\"开头的键名\n*_suffix匹配以\"_suffix\"结尾的键名\n*pattern*:匹配包含\"pattern\"的键名\nprefix_??:匹配以\"prefix_\"开头后跟两个任意字符的键名\n*abc*:匹配包含\"abc\"的任意位置的键名", "filter_pattern_tip": "prefix_*:匹配以\"prefix_\"开头的键名\n*_suffix匹配以\"_suffix\"结尾的键名\n*pattern*:匹配包含\"pattern\"的键名\nprefix_??:匹配以\"prefix_\"开头后跟两个任意字符的键名\n*abc*:匹配包含\"abc\"的任意位置的键名"
"key": "键", },
"value": "值", "ttl": {
"field": "字段", "title": "设置键存活时间"
"action": "操作", },
"type": "类型", "upgrade":{
"score": "分值",
"order_no": "序号",
"preferences": "偏好设置",
"theme": "主题",
"theme_light": "浅色",
"theme_dark": "深色",
"theme_auto": "自动",
"language": "语言",
"font": "字体",
"font_size": "字体尺寸",
"restore_defaults": "重置为默认",
"proxy": "代理",
"use_system_proxy": "使用系统代理",
"use_system_proxy_http": "仅在HTTP请求时使用系统代理",
"update": "更新",
"auto_check_update": "自动检查更新",
"set_ttl": "设置键存活时间",
"persist_key": "持久化键",
"copy_succ": "已复制到剪切板",
"save_value_succ": "已保存值",
"handle_succ": "操作成功",
"reload_succ": "已重新载入",
"field_required": "此项不能为空",
"spec_field_required": "{key} 不能为空",
"illegal_characters": "包含非法字符",
"nonexist_tab_content": "所选键不存在,请尝试刷新重试",
"empty_server_content": "可以从左边选择并打开连接",
"empty_server_list": "还没添加Redis服务器",
"reload_when_succ": "操作成功后立即重新加载",
"server": "服务器",
"browser": "浏览器",
"log": "日志",
"help": "帮助",
"check_update": "检查更新...",
"auto_refresh": "自动刷新",
"new_version_tip": "有可用的新版本,是否立即下载", "new_version_tip": "有可用的新版本,是否立即下载",
"no_update": "当前已是最新版", "no_update": "当前已是最新版"
"refresh": "立即刷新", }
"uptime": "运行时间", },
"connected_clients": "已连客户端", "menu": {
"total_keys": "键总数", "preferences": "偏好设置",
"memory_used": "内存使用", "help": "帮助",
"unit_day": "天", "check_update": "检查更新..."
"unit_hour": "小时", },
"unit_minute": "分钟", "log": {
"all_info": "全部信息",
"all": "全部",
"launch_log": "运行日志", "launch_log": "运行日志",
"filter_server": "筛选服务器", "filter_server": "筛选服务器",
"filter_keyword": "筛选关键字", "filter_keyword": "筛选关键字",
"clean_log": "清空运行日志", "clean_log": "清空运行日志",
"confirm_clean_log": "确定清空运行日志", "confirm_clean_log": "确定清空运行日志",
"exec_time": "执行时间", "exec_time": "执行时间",
"server": "服务器",
"cmd": "命令", "cmd": "命令",
"cost_time": "耗时" "cost_time": "耗时",
"refresh": "立即刷新"
},
"status": {
"uptime": "运行时间",
"connected_clients": "已连客户端",
"total_keys": "键总数",
"memory_used": "内存使用",
"all_info": "全部信息",
"refresh": "立即刷新",
"auto_refresh": "自动刷新"
}
} }

View File

@ -27,7 +27,7 @@ async function setupApp() {
try { try {
const content = err.toString() const content = err.toString()
$notification.error({ $notification.error({
title: i18n.global.t('error'), title: i18n.global.t('common.error'),
content, content,
// meta: err.stack, // meta: err.stack,
}) })

View File

@ -56,15 +56,15 @@ const usePreferencesStore = defineStore('preferences', {
return [ return [
{ {
value: 'light', value: 'light',
label: i18nGlobal.t('theme_light'), label: i18nGlobal.t('preferences.general.theme_light'),
}, },
{ {
value: 'dark', value: 'dark',
label: i18nGlobal.t('theme_dark'), label: i18nGlobal.t('preferences.general.theme_dark'),
}, },
{ {
value: 'auto', value: 'auto',
label: i18nGlobal.t('theme_auto'), label: i18nGlobal.t('preferences.general.theme_auto'),
}, },
] ]
}, },
@ -80,7 +80,7 @@ const usePreferencesStore = defineStore('preferences', {
})) }))
options.splice(0, 0, { options.splice(0, 0, {
value: 'auto', value: 'auto',
label: i18nGlobal.t('system_lang'), label: i18nGlobal.t('preferences.general.system_lang'),
}) })
return options return options
}, },
@ -97,7 +97,7 @@ const usePreferencesStore = defineStore('preferences', {
})) }))
option.splice(0, 0, { option.splice(0, 0, {
value: '', value: '',
label: i18nGlobal.t('default'), label: i18nGlobal.t('preferences.general.default'),
path: '', path: '',
}) })
return option return option
@ -252,7 +252,7 @@ const usePreferencesStore = defineStore('preferences', {
if (success) { if (success) {
const { version, latest, pageUrl } = data const { version, latest, pageUrl } = data
if (latest > version) { if (latest > version) {
$dialog.warning(i18nGlobal.t('new_version_tip'), () => { $dialog.warning(i18nGlobal.t('dialogue.upgrade.new_version_tip'), () => {
BrowserOpenURL(pageUrl) BrowserOpenURL(pageUrl)
}) })
return return
@ -260,7 +260,7 @@ const usePreferencesStore = defineStore('preferences', {
} }
if (manual) { if (manual) {
$message.info(i18nGlobal.t('no_update')) $message.info(i18nGlobal.t('dialogue.upgrade.no_update'))
} }
} finally { } finally {
if (msgRef != null) { if (msgRef != null) {

View File

@ -30,7 +30,7 @@ function setupNotification(notification) {
return { return {
error: (content, option = {}) => { error: (content, option = {}) => {
option.content = content option.content = content
option.title = option.title || i18nGlobal.t('error') option.title = option.title || i18nGlobal.t('common.error')
return notification.error(option) return notification.error(option)
}, },
info: (content, option = {}) => { info: (content, option = {}) => {
@ -39,12 +39,12 @@ function setupNotification(notification) {
}, },
success: (content, option = {}) => { success: (content, option = {}) => {
option.content = content option.content = content
option.title = option.title || i18nGlobal.t('success') option.title = option.title || i18nGlobal.t('common.success')
return notification.success(option) return notification.success(option)
}, },
warning: (content, option = {}) => { warning: (content, option = {}) => {
option.content = content option.content = content
option.title = option.title || i18nGlobal.t('warning') option.title = option.title || i18nGlobal.t('common.warning')
return notification.warning(option) return notification.warning(option)
}, },
} }
@ -54,13 +54,13 @@ function setupDialog(dialog) {
return { return {
warning: (content, onConfirm) => { warning: (content, onConfirm) => {
return dialog.warning({ return dialog.warning({
title: i18nGlobal.t('warning'), title: i18nGlobal.t('common.warning'),
content: content, content: content,
closable: false, closable: false,
autoFocus: false, autoFocus: false,
transformOrigin: 'center', transformOrigin: 'center',
positiveText: i18nGlobal.t('confirm'), positiveText: i18nGlobal.t('common.confirm'),
negativeText: i18nGlobal.t('cancel'), negativeText: i18nGlobal.t('common.cancel'),
onPositiveClick: () => { onPositiveClick: () => {
onConfirm && onConfirm() onConfirm && onConfirm()
}, },