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 v-else class="flex-box-h edit-column-func">
<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>
<icon-button :icon="Delete" />
</template>
{{ $t('remove_tip', { name: props.bindKey }) }}
{{ $t('dialogue.remove_tip', { name: props.bindKey }) }}
</n-popconfirm>
</div>
</template>

View File

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

View File

@ -138,9 +138,9 @@ const onReloadKey = async () => {
@refresh="refreshInfo(true)" />
</div>
<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>
<n-button :focusable="false" @click="onReloadKey">{{ $t('reload') }}</n-button>
<n-button :focusable="false" @click="onReloadKey">{{ $t('interface.reload') }}</n-button>
</template>
</n-empty>
</div>

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@ const onCopyKey = () => {
ClipboardSetText(props.keyPath)
.then((succ) => {
if (succ) {
$message.success(i18n.t('copy_succ'))
$message.success(i18n.t('dialogue.copy_succ'))
}
})
.catch((e) => {
@ -50,10 +50,10 @@ const onCopyKey = () => {
}
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) => {
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" />
<n-input v-model:value="props.keyPath">
<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>
</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-button-group>
<n-tooltip>
@ -79,9 +79,9 @@ const onDeleteKey = () => {
<n-icon :component="Timer" size="18" />
</template>
<template v-if="ttl < 0">
{{ $t('forever') }}
{{ $t('interface.forever') }}
</template>
<template v-else>{{ ttl }} {{ $t('second') }}</template>
<template v-else>{{ ttl }} {{ $t('common.second') }}</template>
</n-button>
</template>
TTL
@ -90,7 +90,7 @@ const onDeleteKey = () => {
:icon="Edit"
border
size="18"
t-tooltip="rename_key"
t-tooltip="interface.rename_key"
@click="dialogStore.openRenameKeyDialog(props.server, props.db, props.keyPath)" />
</n-button-group>
<n-tooltip>
@ -101,7 +101,7 @@ const onDeleteKey = () => {
</template>
</n-button>
</template>
{{ $t('delete_key') }}
{{ $t('interface.delete_key') }}
</n-tooltip>
</div>
</template>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -18,7 +18,7 @@ const i18n = useI18n()
const editName = ref('')
const generalForm = ref(null)
const generalFormRules = () => {
const requiredMsg = i18n.t('field_required')
const requiredMsg = i18n.t('dialogue.field_required')
const illegalChars = ['/', '\\']
return {
name: [
@ -27,7 +27,7 @@ const generalFormRules = () => {
validator: (rule, value) => {
return every(illegalChars, (c) => !includes(value, c))
},
message: i18n.t('illegal_characters'),
message: i18n.t('dialogue.illegal_characters'),
trigger: 'input',
},
],
@ -50,7 +50,7 @@ const groupOptions = computed(() => {
value: group,
}))
options.splice(0, 0, {
label: i18n.t('no_group'),
label: i18n.t('dialogue.connection.no_group'),
value: '',
})
return options
@ -86,7 +86,7 @@ const onSaveConnection = async () => {
return
}
$message.success(i18n.t('handle_succ'))
$message.success(i18n.t('dialogue.handle_succ'))
onClose()
}
@ -149,26 +149,30 @@ const onClose = () => {
:mask-closable="false"
:on-after-leave="resetForm"
: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"
transform-origin="center">
<n-spin :show="closingConnection">
<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
ref="generalFormRef"
:model="generalForm"
:rules="generalFormRules()"
:show-require-mark="false"
label-placement="top">
<n-form-item :label="$t('conn_name')" path="name" required>
<n-input v-model:value="generalForm.name" :placeholder="$t('conn_name_tip')" />
<n-form-item :label="$t('dialogue.connection.conn_name')" path="name" required>
<n-input
v-model:value="generalForm.name"
:placeholder="$t('dialogue.connection.name_tip')" />
</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-form-item>
<n-form-item :label="$t('conn_addr')" path="addr" required>
<n-input v-model:value="generalForm.addr" :placeholder="$t('conn_addr_tip')" />
<n-form-item :label="$t('dialogue.connection.addr')" path="addr" required>
<n-input
v-model:value="generalForm.addr"
:placeholder="$t('dialogue.connection.addr_tip')" />
<n-text style="width: 40px; text-align: center">:</n-text>
<n-input-number
v-model:value="generalForm.port"
@ -176,51 +180,51 @@ const onClose = () => {
:min="1"
style="width: 200px" />
</n-form-item>
<n-form-item :label="$t('conn_pwd')" path="password">
<n-form-item :label="$t('dialogue.connection.pwd')" path="password">
<n-input
v-model:value="generalForm.password"
:placeholder="$t('conn_pwd_tip')"
:placeholder="$t('dialogue.connection.pwd_tip')"
show-password-on="click"
type="password" />
</n-form-item>
<n-form-item :label="$t('conn_usr')" path="username">
<n-input v-model="generalForm.username" :placeholder="$t('conn_usr_tip')" />
<n-form-item :label="$t('dialogue.connection.usr')" path="username">
<n-input v-model="generalForm.username" :placeholder="$t('dialogue.connection.usr_tip')" />
</n-form-item>
</n-form>
</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
ref="advanceFormRef"
:model="generalForm"
:rules="generalFormRules()"
:show-require-mark="false"
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
v-model:value="generalForm.defaultFilter"
:placeholder="$t('conn_advn_filter_tip')" />
:placeholder="$t('dialogue.connection.advn_filter_tip')" />
</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
v-model:value="generalForm.keySeparator"
:placeholder="$t('conn_advn_separator_tip')" />
:placeholder="$t('dialogue.connection.advn_separator_tip')" />
</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">
<template #suffix>
{{ $t('second') }}
{{ $t('common.second') }}
</template>
</n-input-number>
</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">
<template #suffix>
{{ $t('second') }}
{{ $t('common.second') }}
</template>
</n-input-number>
</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
v-for="color in predefineColors"
:key="color"
@ -240,9 +244,9 @@ const onClose = () => {
<!-- test result alert-->
<n-alert
v-if="showTestResult"
:title="isEmpty(testResult) ? '' : $t('conn_test_fail')"
:title="isEmpty(testResult) ? '' : $t('dialogue.connection.test_fail')"
: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>
</n-alert>
</n-spin>
@ -250,15 +254,15 @@ const onClose = () => {
<template #action>
<div class="flex-item-expand">
<n-button :focusable="false" :disabled="closingConnection" :loading="testing" @click="onTestConnection">
{{ $t('conn_test') }}
{{ $t('dialogue.connection.test') }}
</n-button>
</div>
<div class="flex-item n-dialog__action">
<n-button :focusable="false" :disabled="closingConnection" @click="onClose">
{{ $t('cancel') }}
{{ $t('common.cancel') }}
</n-button>
<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>
</div>
</template>

View File

@ -53,7 +53,7 @@ const onConfirmDelete = async () => {
const { server, db, key } = deleteForm
const success = await connectionStore.deleteKeyPrefix(server, db, key)
if (success) {
$message.success(i18n.t('handle_succ'))
$message.success(i18n.t('dialogue.handle_succ'))
}
} catch (e) {
$message.error(e.message)
@ -73,20 +73,20 @@ const onClose = () => {
:close-on-esc="false"
:mask-closable="false"
:show-icon="false"
:title="$t('batch_delete_key')"
:title="$t('interface.batch_delete_key')"
preset="dialog"
transform-origin="center">
<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-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-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-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-log
v-else
@ -99,9 +99,9 @@ const onClose = () => {
<template #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">
{{ $t('show_affected_key') }}
{{ $t('dialogue.key.show_affected_key') }}
</n-button>
<n-button
v-else
@ -109,7 +109,7 @@ const onClose = () => {
:disabled="isEmpty(deleteForm.affectedKeys)"
type="error"
@click="onConfirmDelete">
{{ $t('confirm_delete_key', { num: size(deleteForm.affectedKeys) }) }}
{{ $t('dialogue.key.confirm_delete_key', { num: size(deleteForm.affectedKeys) }) }}
</n-button>
</div>
</template>

View File

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

View File

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

View File

@ -24,7 +24,7 @@ const newForm = reactive({
value: null,
})
const formRules = computed(() => {
const requiredMsg = i18n.t('field_required')
const requiredMsg = i18n.t('dialogue.field_required')
return {
key: { required: true, message: requiredMsg, trigger: 'input' },
type: { required: true, message: requiredMsg, trigger: 'input' },
@ -107,7 +107,7 @@ const onAdd = async () => {
$message.error(err.message)
})
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
}
try {
@ -140,11 +140,11 @@ const onClose = () => {
:close-on-esc="false"
:mask-closable="false"
:negative-button-props="{ size: 'medium' }"
:negative-text="$t('cancel')"
:negative-text="$t('common.cancel')"
:positive-button-props="{ size: 'medium' }"
:positive-text="$t('confirm')"
:positive-text="$t('common.confirm')"
:show-icon="false"
:title="$t('new_key')"
:title="$t('dialogue.key.new')"
preset="dialog"
style="width: 600px"
transform-origin="center"
@ -158,16 +158,16 @@ const onClose = () => {
: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="" />
</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-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-form-item>
<n-form-item :label="$t('ttl')" required>
<n-form-item :label="$t('interface.ttl')" required>
<n-input-group>
<n-input-number
v-model:value="newForm.ttl"
@ -175,11 +175,11 @@ const onClose = () => {
:min="-1"
placeholder="TTL">
<template #suffix>
{{ $t('second') }}
{{ $t('common.second') }}
</template>
</n-input-number>
<n-button secondary type="primary" :focusable="false" @click="newForm.ttl = -1">
{{ $t('persist_key') }}
{{ $t('dialogue.key.persist_key') }}
</n-button>
</n-input-group>
</n-form-item>

View File

@ -38,7 +38,7 @@ watch(
const onSavePreferences = async () => {
const success = await prefStore.savePreferences()
if (success) {
$message.success(i18n.t('handle_succ'))
$message.success(i18n.t('dialogue.handle_succ'))
dialogStore.closePreferencesDialog()
}
}
@ -58,57 +58,57 @@ const onClose = () => {
:close-on-esc="false"
:mask-closable="false"
:show-icon="false"
:title="$t('preferences')"
:title="$t('preferences.name')"
preset="dialog"
transform-origin="center">
<!-- FIXME: set loading will slow down appear animation of dialog in linux -->
<!-- <n-spin :show="loading"> -->
<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-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-button v-for="opt in prefStore.themeOption" :key="opt.value" :value="opt.value">
{{ opt.label }}
</n-radio-button>
</n-radio-group>
</n-form-item>
<n-form-item :label="$t('language')" required>
<n-form-item :label="$t('preferences.general.language')" required>
<n-select
v-model:value="prefStore.general.language"
:options="prefStore.langOption"
filterable />
</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-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-form-item>
<n-form-item :label="$t('proxy')">
<n-form-item :label="$t('preferences.general.proxy')">
<n-space>
<n-checkbox v-model:checked="prefStore.general.useSysProxy">
{{ $t('use_system_proxy') }}
{{ $t('preferences.general.use_system_proxy') }}
</n-checkbox>
<n-checkbox v-model:checked="prefStore.general.useSysProxyHttp">
{{ $t('use_system_proxy_http') }}
{{ $t('preferences.general.use_system_proxy_http') }}
</n-checkbox>
</n-space>
</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">
{{ $t('auto_check_update') }}
{{ $t('preferences.general.auto_check_update') }}
</n-checkbox>
</n-form-item>
</n-form>
</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-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-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-form-item>
</n-form>
@ -119,12 +119,14 @@ const onClose = () => {
<template #action>
<div class="flex-item-expand">
<n-button :disabled="loading" @click="prefStore.restorePreferences">
{{ $t('restore_defaults') }}
{{ $t('preferences.restore_defaults') }}
</n-button>
</div>
<div class="flex-item n-dialog__action">
<n-button :disabled="loading" @click="onClose">{{ $t('cancel') }}</n-button>
<n-button :disabled="loading" type="primary" @click="onSavePreferences">{{ $t('save') }}</n-button>
<n-button :disabled="loading" @click="onClose">{{ $t('common.cancel') }}</n-button>
<n-button :disabled="loading" type="primary" @click="onSavePreferences">
{{ $t('common.save') }}
</n-button>
</div>
</template>
</n-modal>

View File

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

View File

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

View File

@ -16,11 +16,11 @@ const i18n = useI18n()
const updateOption = [
{
value: 0,
label: i18n.t('overwrite_field'),
label: i18n.t('dialogue.field.overwrite_field'),
},
{
value: 1,
label: i18n.t('ignore_field'),
label: i18n.t('dialogue.field.ignore_field'),
},
]
@ -45,16 +45,16 @@ const onUpdate = (val) => {
</script>
<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-button v-for="(op, i) in updateOption" :key="i" :label="op.label" :value="op.value" />
</n-radio-group>
</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="kvList"
:key-placeholder="$t('enter_field')"
:value-placeholder="$t('enter_value')"
:key-placeholder="$t('dialogue.field.enter_field')"
:value-placeholder="$t('dialogue.field.enter_value')"
preset="pair"
@update:value="onUpdate">
<template #action="{ index, create, remove, move }">

View File

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

View File

@ -19,11 +19,11 @@ const i18n = useI18n()
const updateOption = [
{
value: 0,
label: i18n.t('overwrite_field'),
label: i18n.t('dialogue.field.overwrite_field'),
},
{
value: 1,
label: i18n.t('ignore_field'),
label: i18n.t('dialogue.field.ignore_field'),
},
]
@ -53,20 +53,23 @@ const onUpdate = () => {
</script>
<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-button v-for="(op, i) in updateOption" :key="i" :label="op.label" :value="op.value" />
</n-radio-group>
</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">
<template #default="{ value }">
<n-input
v-model:value="value.value"
:placeholder="$t('enter_elem')"
:placeholder="$t('dialogue.field.enter_elem')"
type="text"
@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 #action="{ index, create, remove, move }">
<icon-button v-if="zset.length > 1" :icon="Delete" size="18" @click="() => remove(index)" />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -41,15 +41,18 @@ defineExpose({
</script>
<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">
<template #default="{ value }">
<n-input
v-model:value="value.value"
:placeholder="$t('enter_member')"
:placeholder="$t('dialogue.field.enter_member')"
type="text"
@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 #action="{ index, create, remove, move }">
<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, {
value: '',
label: i18n.t('all'),
label: i18n.t('common.all'),
})
return options
})
@ -83,10 +83,15 @@ const filterTypeOptions = computed(() => {
</div>
<!-- bottom function bar -->
<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="Refresh" size="20" stroke-width="4" t-tooltip="reload" @click="onRefresh" />
<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="interface.reload" @click="onRefresh" />
<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>
</template>

View File

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

View File

@ -25,15 +25,15 @@ const filterPattern = ref('')
:icon="AddLink"
size="20"
stroke-width="4"
t-tooltip="new_conn"
t-tooltip="interface.new_conn"
@click="dialogStore.openNewDialog()" />
<icon-button
:icon="AddGroup"
size="20"
stroke-width="4"
t-tooltip="new_group"
t-tooltip="interface.new_group"
@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>
<n-icon :component="Filter" size="20" />
</template>

View File

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

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "English",
"system_lang": "Use System Language",
"common": {
"confirm": "Confirm",
"cancel": "Cancel",
"success": "Success",
@ -8,30 +8,61 @@
"error": "Error",
"save": "Save",
"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",
"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_group": "Add New Group",
"rename_group": "Rename Group",
"disconnect_all": "Disconnect all",
"status": "Status",
"filter": "Filter",
"sort_conn": "Sort Connections",
"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",
"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",
"ttl": "TTL",
"forever": "Forever",
"rename_key": "Rename Key",
"delete_key": "Delete Key",
"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",
"edit_value": "Edit Value",
"save_update": "Save Update",
@ -45,53 +76,84 @@
"view_as": "View As",
"reload": "Reload",
"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",
"copy_path": "Copy Path",
"copy_key": "Copy Key",
"remove_key": "Remove Key",
"new_conn_title": "New Connection",
"edit_conn_title": "Edit Connection",
"new_key": "Add New Key",
"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",
"advanced": "Advanced",
"editor": "Editor",
"conn_group": "Group",
"group_name": "Group Name",
"no_group": "No Group",
"group": "Group",
"conn_name": "Name",
"conn_addr": "Address",
"conn_usr": "Username",
"conn_pwd": "Password",
"conn_name_tip": "Connection name",
"conn_addr_tip": "Redis server host",
"conn_usr_tip": "(Optional) Redis server username",
"conn_pwd_tip": "(Optional) Redis server authentication password (Redis > 6.0)",
"conn_test": "Test Connection",
"conn_test_succ": "Successful connection to redis-server",
"conn_test_fail": "Fail Connection",
"conn_advn_filter": "Default Filter",
"conn_advn_filter_tip": "Pattern which defines loaded keys from redis server",
"conn_advn_separator": "Key Separator",
"conn_advn_separator_tip": "Separator used for key path item",
"conn_advn_conn_timeout": "Connection Timeout",
"conn_advn_exec_timeout": "Execution Timeout",
"conn_advn_mark_color": "Mark Color",
"second": "Second(s)",
"new_key_name": "New Key Name",
"new_key": "Add New Key",
"new_field": "Add New Field",
"addr": "Address",
"usr": "Username",
"pwd": "Password",
"name_tip": "Connection name",
"addr_tip": "Redis server host",
"usr_tip": "(Optional) Redis server username",
"pwd_tip": "(Optional) Redis server authentication password (Redis > 6.0)",
"test": "Test Connection",
"test_succ": "Successful connection to redis-server",
"test_fail": "Fail Connection",
"advn_filter": "Default Filter",
"advn_filter_tip": "Pattern which defines loaded keys from redis server",
"advn_separator": "Key Separator",
"advn_separator_tip": "Separator used for key path item",
"advn_conn_timeout": "Connection Timeout",
"advn_exec_timeout": "Execution Timeout",
"advn_mark_color": "Mark Color"
},
"group": {
"name": "Group Name",
"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",
"ignore_field": "Ignore Existing Field",
"new_item": "Add New Item",
"insert_type": "Insert",
"append_item": "Append",
"prepend_item": "Prepend",
@ -102,67 +164,45 @@
"enter_member": "Enter Member",
"enter_score": "Enter Score",
"element": "Element",
"reload_when_succ": "Reload immediately after success"
},
"filter": {
"set_key_filter": "Set Key Filter",
"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.",
"key": "Key",
"value": "Value",
"field": "Field",
"action": "Action",
"type": "Type",
"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",
"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."
},
"ttl": {
"title": "Set Key TTL"
},
"upgrade": {
"new_version_tip": "A new version is available. Download now?",
"no_update": "You're update to date",
"refresh": "Refresh",
"uptime": "Uptime",
"connected_clients": "Clients",
"total_keys": "Keys",
"memory_used": "Memory",
"unit_day": "D",
"unit_hour": "H",
"unit_minute": "M",
"all_info": "All Info",
"all": "All",
"no_update": "You're update to date"
}
},
"menu": {
"preferences": "Preferences",
"help": "Help",
"check_update": "Check for Updates..."
},
"log": {
"launch_log": "Launch Log",
"filter_server": "Filter Server",
"filter_keyword": "Filter Keyword",
"clean_log": "Clean Launch Log",
"confirm_clean_log": "Confirm clean launch log",
"exec_time": "Exec Time",
"server": "Server",
"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": "简体中文",
"system_lang": "使用系统语言",
"common": {
"confirm": "确认",
"cancel": "取消",
"success": "成功",
@ -8,30 +8,62 @@
"error": "错误",
"save": "保存",
"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": "默认",
"font": "字体",
"font_size": "字体尺寸",
"proxy": "代理",
"use_system_proxy": "使用系统代理",
"use_system_proxy_http": "仅在HTTP请求时使用系统代理",
"update": "更新",
"auto_check_update": "自动检查更新"
},
"editor": {
"name": "编辑器"
}
},
"interface": {
"new_conn": "添加新连接",
"new_group": "添加新分组",
"rename_group": "重命名分组",
"disconnect_all": "断开所有连接",
"status": "状态",
"filter": "筛选",
"sort_conn": "调整连接顺序",
"close_confirm": "是否关闭当前连接",
"edit_close_confirm": "编辑前需要关闭相关连接,是否继续",
"opening_connection": "正在打开连接...",
"remove_tip": "{type} \"{name}\" 将会被删除",
"remove_group_tip": "分组 \"{name}\"及其所有连接将会被删除",
"new_conn_title": "新建连接",
"open_db": "打开数据库",
"close_db": "关闭数据库",
"filter_key": "过滤键",
"disconnect": "断开连接",
"dup_conn": "复制连接",
"remove_conn": "删除连接",
"edit_conn": "编辑连接配置",
"edit_conn_group": "编辑连接分组",
"rename_conn_group": "重命名连接分组",
"remove_conn_group": "删除连接分组",
"ttl": "TTL",
"forever": "永久",
"rename_key": "重命名键",
"delete_key": "删除键",
"batch_delete_key": "批量删除键",
"db_index": "数据库编号",
"key_expression": "键名表达式",
"affected_key": "受影响的键名",
"show_affected_key": "查看受影响的键名",
"confirm_delete_key": "确认删除{num}个键",
"delete_key_succ": "{key} 已被删除",
"copy_value": "复制值",
"edit_value": "修改值",
"save_update": "保存修改",
@ -45,53 +77,84 @@
"view_as": "查看方式",
"reload": "重新载入",
"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": "批量删除键",
"copy_path": "复制路径",
"copy_key": "复制键名",
"remove_key": "删除键",
"new_conn_title": "新建连接",
"edit_conn_title": "编辑连接",
"new_key": "添加新键",
"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": "常规配置",
"advanced": "高级配置",
"editor": "编辑器",
"conn_group": "分组",
"group_name": "分组名",
"no_group": "无分组",
"group": "分组",
"conn_name": "连接名",
"conn_addr": "连接地址",
"conn_usr": "用户名",
"conn_pwd": "密码",
"conn_name_tip": "连接名",
"conn_addr_tip": "Redis服务地址",
"conn_usr_tip": "(可选)Redis服务授权用户名",
"conn_pwd_tip": "(可选)Redis服务授权密码 (Redis > 6.0)",
"conn_test": "测试连接",
"conn_test_succ": "成功连接到Redis服务器",
"conn_test_fail": "连接失败",
"conn_advn_filter": "默认过滤",
"conn_advn_filter_tip": "需要加载的键名表达式",
"conn_advn_separator": "键分隔符",
"conn_advn_separator_tip": "键名路径分隔符",
"conn_advn_conn_timeout": "连接超时",
"conn_advn_exec_timeout": "执行超时",
"conn_advn_mark_color": "标记颜色",
"second": "秒",
"new_key_name": "新键名",
"new_key": "添加新键",
"new_field": "添加新字段",
"addr": "连接地址",
"usr": "用户名",
"pwd": "密码",
"name_tip": "连接名",
"addr_tip": "Redis服务地址",
"usr_tip": "(可选)Redis服务授权用户名",
"pwd_tip": "(可选)Redis服务授权密码 (Redis > 6.0)",
"test": "测试连接",
"test_succ": "成功连接到Redis服务器",
"test_fail": "连接失败",
"advn_filter": "默认过滤",
"advn_filter_tip": "需要加载的键名表达式",
"advn_separator": "键分隔符",
"advn_separator_tip": "键名路径分隔符",
"advn_conn_timeout": "连接超时",
"advn_exec_timeout": "执行超时",
"advn_mark_color": "标记颜色"
},
"group": {
"name": "分组名",
"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": "覆盖同名字段",
"ignore_field": "忽略同名字段",
"new_item": "添加新元素",
"insert_type": "插入类型",
"append_item": "尾部追加",
"prepend_item": "插入头部",
@ -102,67 +165,45 @@
"enter_member": "输入成员",
"enter_score": "输入分值",
"element": "元素",
"reload_when_succ": "操作成功后立即重新加载"
},
"filter": {
"set_key_filter": "设置键过滤器",
"filter_pattern": "过滤表达式",
"filter_pattern_tip": "prefix_*:匹配以\"prefix_\"开头的键名\n*_suffix匹配以\"_suffix\"结尾的键名\n*pattern*:匹配包含\"pattern\"的键名\nprefix_??:匹配以\"prefix_\"开头后跟两个任意字符的键名\n*abc*:匹配包含\"abc\"的任意位置的键名",
"key": "键",
"value": "值",
"field": "字段",
"action": "操作",
"type": "类型",
"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": "自动刷新",
"filter_pattern_tip": "prefix_*:匹配以\"prefix_\"开头的键名\n*_suffix匹配以\"_suffix\"结尾的键名\n*pattern*:匹配包含\"pattern\"的键名\nprefix_??:匹配以\"prefix_\"开头后跟两个任意字符的键名\n*abc*:匹配包含\"abc\"的任意位置的键名"
},
"ttl": {
"title": "设置键存活时间"
},
"upgrade":{
"new_version_tip": "有可用的新版本,是否立即下载",
"no_update": "当前已是最新版",
"refresh": "立即刷新",
"uptime": "运行时间",
"connected_clients": "已连客户端",
"total_keys": "键总数",
"memory_used": "内存使用",
"unit_day": "天",
"unit_hour": "小时",
"unit_minute": "分钟",
"all_info": "全部信息",
"all": "全部",
"no_update": "当前已是最新版"
}
},
"menu": {
"preferences": "偏好设置",
"help": "帮助",
"check_update": "检查更新..."
},
"log": {
"launch_log": "运行日志",
"filter_server": "筛选服务器",
"filter_keyword": "筛选关键字",
"clean_log": "清空运行日志",
"confirm_clean_log": "确定清空运行日志",
"exec_time": "执行时间",
"server": "服务器",
"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 {
const content = err.toString()
$notification.error({
title: i18n.global.t('error'),
title: i18n.global.t('common.error'),
content,
// meta: err.stack,
})

View File

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

View File

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