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