chore: add entrance about user guide and custom decoder
This commit is contained in:
parent
a13bf788eb
commit
6430deeaea
|
@ -13,6 +13,7 @@ import Edit from '@/components/icons/Edit.vue'
|
|||
import { joinCommand } from '@/utils/decoder_cmd.js'
|
||||
import AddLink from '@/components/icons/AddLink.vue'
|
||||
import Checked from '@/components/icons/Checked.vue'
|
||||
import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js'
|
||||
|
||||
const prefStore = usePreferencesStore()
|
||||
|
||||
|
@ -145,6 +146,19 @@ const decoderColumns = computed(() => {
|
|||
]
|
||||
})
|
||||
|
||||
const openDecodeHelp = () => {
|
||||
let helpUrl = ''
|
||||
switch (prefStore.currentLanguage) {
|
||||
case 'zh':
|
||||
helpUrl = 'https://redis.tinycraft.cc/zh/guide/custom-decoder.html'
|
||||
break
|
||||
default:
|
||||
helpUrl = 'https://redis.tinycraft.cc/guide/custom-decoder.html'
|
||||
break
|
||||
}
|
||||
BrowserOpenURL(helpUrl)
|
||||
}
|
||||
|
||||
const onSavePreferences = async () => {
|
||||
const success = await prefStore.savePreferences()
|
||||
if (success) {
|
||||
|
@ -354,13 +368,21 @@ const onClose = () => {
|
|||
|
||||
<!-- custom decoder pane -->
|
||||
<n-tab-pane :tab="$t('preferences.decoder.name')" display-directive="show:lazy" name="decoder">
|
||||
<n-space>
|
||||
<n-button @click="dialogStore.openDecoderDialog()">
|
||||
<template #icon>
|
||||
<n-icon :component="AddLink" size="18" />
|
||||
</template>
|
||||
{{ $t('preferences.decoder.new') }}
|
||||
</n-button>
|
||||
<n-space vertical>
|
||||
<n-space justify="space-between">
|
||||
<n-button @click="dialogStore.openDecoderDialog()">
|
||||
<template #icon>
|
||||
<n-icon :component="AddLink" size="18" />
|
||||
</template>
|
||||
{{ $t('preferences.decoder.new') }}
|
||||
</n-button>
|
||||
<n-button @click="openDecodeHelp">
|
||||
<template #icon>
|
||||
<n-icon :component="Help" size="18" />
|
||||
</template>
|
||||
{{ $t('preferences.decoder.help') }}
|
||||
</n-button>
|
||||
</n-space>
|
||||
<n-data-table
|
||||
:columns="decoderColumns"
|
||||
:data="decoderList"
|
||||
|
|
|
@ -76,6 +76,10 @@ const preferencesOptions = computed(() => {
|
|||
label: 'menu.report_bug',
|
||||
key: 'report',
|
||||
},
|
||||
{
|
||||
label: 'menu.user_guide',
|
||||
key: 'help',
|
||||
},
|
||||
{
|
||||
label: 'menu.check_update',
|
||||
key: 'update',
|
||||
|
@ -104,6 +108,13 @@ const onSelectPreferenceMenu = (key) => {
|
|||
case 'report':
|
||||
BrowserOpenURL('https://github.com/tiny-craft/tiny-rdm/issues')
|
||||
break
|
||||
case 'help':
|
||||
if (prefStore.currentLanguage === 'zh') {
|
||||
BrowserOpenURL('https://redis.tinycraft.cc/zh/guide/intro.html')
|
||||
} else {
|
||||
BrowserOpenURL('https://redis.tinycraft.cc/guide/intro.html')
|
||||
}
|
||||
break
|
||||
case 'about':
|
||||
dialogStore.openAboutDialog()
|
||||
break
|
||||
|
|
|
@ -71,7 +71,8 @@
|
|||
"decoder_name": "Name",
|
||||
"cmd_preview": "Preview",
|
||||
"status": "Status",
|
||||
"path": "Decoder Execution Path"
|
||||
"auto_enabled": "Automatic Decoding Enabled",
|
||||
"help": "Help"
|
||||
}
|
||||
},
|
||||
"interface": {
|
||||
|
@ -395,6 +396,7 @@
|
|||
"close": "Close",
|
||||
"preferences": "Preferences",
|
||||
"help": "Help",
|
||||
"user_guide": "User Guide",
|
||||
"check_update": "Check for Updates...",
|
||||
"report_bug": "Report a Bug",
|
||||
"about": "About"
|
||||
|
|
|
@ -71,7 +71,8 @@
|
|||
"decoder_name": "解码器名称",
|
||||
"cmd_preview": "命令预览",
|
||||
"status": "状态",
|
||||
"auto_enabled": "已加入自动解码"
|
||||
"auto_enabled": "已加入自动解码",
|
||||
"help": "帮助"
|
||||
}
|
||||
},
|
||||
"interface": {
|
||||
|
@ -395,6 +396,7 @@
|
|||
"close": "关闭",
|
||||
"preferences": "偏好设置",
|
||||
"help": "帮助",
|
||||
"user_guide": "使用指南",
|
||||
"check_update": "检查更新...",
|
||||
"report_bug": "报告错误",
|
||||
"about": "关于"
|
||||
|
|
Loading…
Reference in New Issue